pygments

Pygments syntax highlighting in Jekyll without starting a <div>

徘徊边缘 提交于 2019-12-01 21:24:20
If you use Jekyll with the Pygments syntax-highlighting package, it’s possible to write {% highlight clojure %} (def something :foobar) {% endhighlight %} which produces a <div> containing that line, syntax-highlighted according to Clojure syntax. But is there a way to get the syntax highlighting in the middle of a paragraph? I’d like to be able to write In Clojure, keywords like {% highlight clojure %}:foobar{% endhighlight %} are prepended by colons. The desired behavior here is that the Clojure keyword would be highlighted using the same style as was used for the keyword in the first

How to support scrolling when using pygments with Jekyll

一世执手 提交于 2019-11-30 05:04:12
Is it possible to use horizontal scrolling rather than text wrapping in a code section highlughted with pygments when working in Jekyll. Source of document: {% highlight bash %} Full thread dump OpenJDK Client VM (19.0-b09 mixed mode, sharing): "Attach Listener" daemon prio=10 tid=0x0a482400 nid=0x5105 waiting on condition [0x00000000] java.lang.Thread.State: RUNNABLE .... {% endhighlight %} Generated page (Notice the hex address being wrapped rather than scrolled): Find your highlight.css at: /PROJECT_ROOT/assets/themes/THEME_NAME/css/highlight.css and add this line at the end: pre { white

Do I need to generate a css file from Pygments for my jekyll blog, to enable colorful code snippet?

梦想的初衷 提交于 2019-11-30 05:02:07
This is my first time to use Jekyll and Pygments. But I don't know how to insert colorful code snippet. I successfully installed Pygments, following the official steps, with the markdown like this: {% highlight ruby %} def foo puts 'foo' end {% endhighlight %} I see the html source code including the classes, however there is no color for the this snippet. Do I need to generate some css files from Pygments and include them? And how? You need to include syntax.css You can take the sample from my repo https://github.com/madhur/madhur.github.com/blob/master/files/css/syntax.css and then customize

Highlight with Jekyll and pygments doesn't work

折月煮酒 提交于 2019-11-29 22:15:47
I want to use pygments with jekyll I have the following code: {% highlight java %} NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap {% endhighlight %} When I generate my site with jekyll --pygments , the html result is: <div> <pre><code class="java">NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap</code> </pre> </div> In this html output there aren't the expected <span class="n"> or <span class="s2"> tags, and the code is not highlighted. Am I doing something wrong? You need to have the css generated to highlight. $

How do I implement Rouge syntax highlighting in Rails?

依然范特西╮ 提交于 2019-11-29 02:48:54
问题 There are a bunch of tutorials floating around, but they seem to be incomplete or not fully current or don't fully work for me. This is what I have done. Gemfile: gem 'rouge' gem 'redcarpet' Then I created a config/initializer/rouge.rb : require 'rouge/plugins/redcarpet' Then I created a file called app/assets/stylesheets/rouge.css.erb <%= Rouge::Themes::Github.render(:scope => '.highlight') %> Then in my app/helpers/application_helper.rb , I added this: module ApplicationHelper class HTML <

Do I need to generate a css file from Pygments for my jekyll blog, to enable colorful code snippet?

我的梦境 提交于 2019-11-29 02:45:08
问题 This is my first time to use Jekyll and Pygments. But I don't know how to insert colorful code snippet. I successfully installed Pygments, following the official steps, with the markdown like this: {% highlight ruby %} def foo puts 'foo' end {% endhighlight %} I see the html source code including the classes, however there is no color for the this snippet. Do I need to generate some css files from Pygments and include them? And how? 回答1: You need to include syntax.css You can take the sample

How to support scrolling when using pygments with Jekyll

我们两清 提交于 2019-11-29 02:19:56
问题 Is it possible to use horizontal scrolling rather than text wrapping in a code section highlughted with pygments when working in Jekyll. Source of document: {% highlight bash %} Full thread dump OpenJDK Client VM (19.0-b09 mixed mode, sharing): "Attach Listener" daemon prio=10 tid=0x0a482400 nid=0x5105 waiting on condition [0x00000000] java.lang.Thread.State: RUNNABLE .... {% endhighlight %} Generated page (Notice the hex address being wrapped rather than scrolled): 回答1: Find your highlight

Highlight with Jekyll and pygments doesn't work

筅森魡賤 提交于 2019-11-28 17:27:55
问题 I want to use pygments with jekyll I have the following code: {% highlight java %} NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap {% endhighlight %} When I generate my site with jekyll --pygments , the html result is: <div> <pre><code class="java">NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap</code> </pre> </div> In this html output there aren't the expected <span class="n"> or <span class="s2"> tags, and the

Jekyll on Windows: Pygments not working

淺唱寂寞╮ 提交于 2019-11-28 17:23:47
问题 I updated to the latest JekyllBuild (1.0.3) before I always used the RC. After updating the parsing of codes (with Pygments) doesn't work anymore. I always get the following error: C:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162: warning: cannot close fd before spawn ←[31m Liquid Exception: No such file or directory - /bin/sh in 2012-01-17-test-post.md←[0m Did anyone also ran into this problem? I have no clue about ruby, so I can not debug this myself :( 回答1: I

Github flavored Markdown and pygments highlighting in Jekyll

假装没事ソ 提交于 2019-11-28 16:51:45
I've deployed my Jekyll blog on a VPS. I would now like to add Github-flavored Markdown to it, using Pygments highlighting, but I don't know which files do I have to edit and how. So far, the only file I've configured is _config.yml wich looks like this: 1 safe: false 2 auto: false 3 server: false 4 server_port: 4000 5 baseurl: / 6 url: http://localhost:4000 7 8 source: . 9 destination: ./_site 10 plugins: ./_plugins 11 12 future: true 13 lsi: false 14 pygments: false 15 markdown: maruku 16 permalink: date 17 18 maruku: 19 use_tex: false 20 use_divs: false 21 png_engine: blahtex 22 png_dir: