【问题标题】:Rouge syntax highlighting in Jekyll: enable start_inline by default?Jekyll 中的 Rouge 语法高亮:默认启用 start_inline?
【发布时间】:2017-01-16 21:33:21
【问题描述】:

有没有办法为 Rouge 中的所有代码块默认启用 start_inline?

我正在使用 Jekyll 3 (rouge, kramdown) 写博客,并且我有很多 PHP 代码块。我希望语法高亮工作而不必将所有 ```php 标记替换为 ```php?start_inline=1

【问题讨论】:

  • 您找到解决方案了吗?
  • @JCarlos no :-(

标签: jekyll kramdown rouge


【解决方案1】:
kramdown:
  syntax_highlighter: rouge
  syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
    css_class: highlight
    # default_lang: console
    span:
      line_numbers: false
    block:
      line_numbers: true
      start_line: 1

【讨论】:

  • 感谢您提供答案。您能否编辑您的答案以包括对您的代码的解释?这将有助于未来的读者更好地了解正在发生的事情,尤其是那些刚接触该语言并难以理解概念的社区成员。
猜你喜欢
  • 2012-07-01
  • 1970-01-01
  • 2021-05-01
  • 2016-10-06
  • 1970-01-01
  • 1970-01-01
  • 2016-11-09
  • 2016-12-19
  • 1970-01-01
相关资源
最近更新 更多