Skip to content

Explore enabling syntax highlight for codeblock #490

@sivaraam

Description

@sivaraam
Member

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?

Activity

chriscool

chriscool commented on Mar 28, 2021

@chriscool
Collaborator

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

sivaraam commented on Mar 29, 2021

@sivaraam
MemberAuthor

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

chriscool commented on Mar 31, 2021

@chriscool
Collaborator

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

sivaraam commented on Apr 5, 2021

@sivaraam
MemberAuthor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @chriscool@sivaraam

        Issue actions

          Explore enabling syntax highlight for codeblock · Issue #490 · git/git.github.io