tedd
V2EX  ›  问与答

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

  •  
  •   tedd · Nov 14, 2013 · 3554 views
    This topic created in 4573 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
        1
    chloerei  
       Nov 14, 2013
    pygments 这个 python 库装了没。
    tedd
        2
    tedd  
    OP
       Nov 14, 2013
    @chloerei 回pygments,我之前是直接push到github上面,那里不存在有没有装pigments库吧?我现在是clone到mac本机了,看了你的提示倒也去pip安装上了pygments,但在本机上预览效果也没有任何变化...
    chloerei
        3
    chloerei  
       Nov 14, 2013
    还有个参数:

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