Pygments syntax highlighting in Jekyll without starting a

后端 未结 4 1440
心在旅途
心在旅途 2021-01-21 06:18

If you use Jekyll with the Pygments syntax-highlighting package, it’s possible to write

{% highlight clojure %}
(def something :foobar)
{% endhighlight %}
         


        
4条回答
  •  独厮守ぢ
    2021-01-21 07:02

    You can add a CSS class to any object you put in a post.

    If you define a CSS entry like this:

    .inlined { display:inline; }
    

    You can then add this class to the generated

    doing this:

    In Clojure, keywords like 
    {% highlight clojure %}:foobar{% endhighlight %}{: .inlined } 
    are prepended by colons.
    

    This works with all kind of objects (tables, images, etc). I can not test it right now, but I think this will solve the issue.

    When you test it, look at the output HTML. You will then find that your

    now has the class=inlined attribute set.

提交回复
热议问题