Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use CodeRay in github pages?

I'm using Jekyll-Bootstrap now. In my local environment, I can enable CodeRay in jekyll's _config.yml and use it in my posts without any problem. But the same code cannot work on github.

My _config.yml (jekyll-bootstrap configs are omitted):

# Use kramdown as markdown parser engine.
markdown:      kramdown
markdown_ext:  markdown,mkd,mkdn,md
textile_ext:   textile

kramdown:
  auto_ids: true
  footnote_nr: 1
  entity_output: as_char
  toc_levels: 1..6
  smart_quotes: lsquo,rsquo,ldquo,rdquo
  use_coderay: true

  coderay:
    coderay_wrap: div
    coderay_line_numbers: nil
    coderay_tab_width: 4
    coderay_bold_every: 10
    coderay_css: class
like image 604
huandu Avatar asked Oct 20 '22 23:10

huandu


2 Answers

You can use kramdown with coderay on github pages. Just include

markdown: kramdown
kramdown:
  use_coderay: true

in your _config.yml.

like image 94
StandByUkraine Avatar answered Oct 27 '22 18:10

StandByUkraine


GithHb pages runs a minimal ruby / ruby gems configuration, it will also overide some of your _config.yml settings see https://help.github.com/articles/using-jekyll-with-pages for some more information.

One way around this is to build locally and then sync the generated output with GitHub pages bypassing GitGub's Jekyll configuration.

like image 23
RobertKenny Avatar answered Oct 27 '22 18:10

RobertKenny