git / git.github.io

Git Developer Pages (This is NOT the place to discuss Git issues. See: https://git-scm.com/community)
https://git.github.io
314 stars 281 forks source link

Explore enabling syntax highlight for codeblock #490

Open sivaraam opened 3 years ago

sivaraam commented 3 years ago

Right now, the language of the codeblock mentioned near the starting part seems ignored in the rendered page. We could explore if we could use some plug-in to properly syntax highlight the codeblocks using the language mentioned.

Would that be a good enhancement?

chriscool commented 3 years ago

Are you talking about a specific page here? It's not clear which one.

Also about "the language of the codeblock mentioned near the starting part", do you mean that codeblocks that are far from the start don't have the same issue?

In general, yeah, I would be ok with improving syntax highlighting.

sivaraam commented 3 years ago

Are you talking about a specific page here? It's not clear which one.

Nope. I'm talking about codeblocks in general. A specific example would be the first codeblock found in edition 73. The codeblock was qualified with the language "shell" as one could see in the raw text of the edition. It was syntax highlighted properly in GitHub's markdown rendering (observed the comments being dimmed). But in the website, the codeblock doesn't appear to be syntax highlighted. That's the thing I thought of improving.

Also about "the language of the codeblock mentioned near the starting part", do you mean that codeblocks that are far from the start don't have the same issue?

No. I was trying to refer to the first line in a markdown block like the following where the language of the codeblock is mentioned:

```shell
gitdir=$(git rev-parse --git-dir)
# We need delete_self to pick up changes to HEAD (since it gets renamed
# over), and "move" to pick up changes in the refs directories.
inotifywait -qq -t 60 -e delete_self -e move -r "$gitdir/HEAD" "$gitdir/refs"
```

! In general, yeah, I would be ok with improving syntax highlighting. Ok 👍🏼

chriscool commented 3 years ago

Ok, sorry for my misunderstanding. I guess it's because it was late and I was tired. And yeah, I think it's a good idea to have syntax highlighting on the website too.

I don't know the reason why it doesn't work and what we could do about that though. If you find a plugin that could do it, yeah I am ok with testing it. Thanks!

sivaraam commented 3 years ago

Ok, sorry for my misunderstanding. I guess it's because it was late and I was tired. And yeah, I think it's a good idea to have syntax highlighting on the website too.

No worries. I didn't quite detail it so well in the initial description either 🙂

I don't know the reason why it doesn't work and what we could do about that though. If you find a plugin that could do it, yeah I am ok with testing it. Thanks!

Great! Let me see what I get.