Skip to content

How to pass {{< highlight r >}} for pygments (instead of using highlight.js) #125

@ciflikli

Description

@ciflikli

After being directed to the bookdown upon creating my first issue (the answer to my problem was sitting there quite obviously) I took my time looking around (Hugo forums, GitHub) however still lacking the solution for my syntax highlighting problem.

Basically, I want to use pygments to be able to manipulate class colors (with pygmentsuseclasses = true. However, I cannot seem to find where to pass Hugo's highlight function in blogdown. I have the library on the path.

Highligth.js works fine with a customized .css, but syntax like operators, functions etc. do not span their own class. This post for example has the functionality I want (just inspect any code chunk), however it was built by Jekyll. He seems to pass {% highlight r %} before the code. How can I do that with blogdown? Thanks.

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

    Issue actions