tedd
V2EX  ›  问与答

jekyll下面redcarpet怎么弄都不高亮代码...

  •  
  •   tedd · Nov 14, 2013 · 3854 views
    This topic created in 4737 days ago, the information mentioned may be changed or developed.
    按照最新的jekyll指引弄好了github page,redcarpet默认版本也是2+,在配置文件最后也加入了
    markdown: redcarpet
    redcarpet:
    extensions: ["fenced_code_blocks", "autolink", "tables", "strikethrough"]

    但高亮就是不出现...

    ```python
    print 'hello'
    ```

    看了下gem list,需要的gem都有呀,到底肿么了...
    pygments.rb (0.5.4)
    redcarpet (2.3.0)
    jekyll (1.3.0)
    6 replies  •  1970-01-01 08:00:00 +08:00
    chloerei
    chloerei
    Nov 14, 2013
    1
    pygments 这个 python 库装了没。
    tedd
    tedd
    OP
    Nov 14, 2013
    2
    @chloerei 回pygments,我之前是直接push到github上面,那里不存在有没有装pigments库吧?我现在是clone到mac本机了,看了你的提示倒也去pip安装上了pygments,但在本机上预览效果也没有任何变化...
    chloerei
    chloerei
    Nov 14, 2013
    3
    还有个参数:

    pygments: true
    tedd
    tedd
    OP
    Nov 14, 2013
    4
    @chloerei 回chloerel,看了下配置,是true的...
    ijse
    ijse
    Nov 14, 2013
    5
    高亮代码还是通过页面JS实现吧,也没什么不好的。
    airwalker
    airwalker
    Nov 14, 2013
    6
    有设定代码高亮的css吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3193 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 11:12 · PVG 19:12 · LAX 03:12 · JFK 06:12
    ♥ Do have faith in what you're doing.