【发布时间】:2017-01-29 13:30:48
【问题描述】:
我将 Jekyll 与 Github Pages 一起使用,但在我的网站上显示具有正确语法突出显示的 Julia 代码时遇到问题。
这是我的博文:
---
layout: post
title: 'Example post'
---
Here the highlighting works:
{% highlight python %}
# Python
x = 9
for i in range(1, 11):
y = sqrt(x) - i
print(y)
{% endhighlight %}
Here it doesn't:
{% highlight julia %}
# Julia
x = 9
for i = 1:10
y = sqrt(x) - i
println(y)
end
{% endhighlight %}
当我使用 bundle exec jekyll serve --drafts 在本地运行 Jekyll 时,会产生以下内容(屏幕截图):
我read 应该支持 Julia,所以我不确定可能出了什么问题。
我的config_yml 看起来像这样:
# Permalinks
permalink: pretty
# Setup
title: MyTitle
url: http://mywebsite.github.io
description: "Hello, I'm me."
paginate: 4
baseurl: ""
# Assets
# We specify the directory for Jekyll so we can use @imports.
sass:
sass_dir: _sass
style: :compressed
# About/contact
author:
name: Firstname Surname
email: hi@me.com
# Custom vars
version: 2.0.0
github:
repo: https://github.com/poole/poole
# Gems
gems:
- jekyll-paginate
- jekyll-gist
pages_list:
FistPage: '/FirstPage'
SecondPage: '/SecondPage'
encoding: utf-8
# Choose Markdown version
markdown: kramdown
任何关于我如何使它工作的想法都将不胜感激。
【问题讨论】:
-
您显示支持 Julia 的链接已过期。从版本 3 Jekyll uses Rouge for highlighting 开始,而不是 Pygments。但无论如何Julia should be supported by Rouge。您是否尝试过推送到 GitHub 以查看它是否在那里工作?你在本地有哪些版本的 Jekyll 和 Rouge?
-
查看answer,我在其中解释了如何以一般方式使突出显示为 jekyll 工作。我认为您可以根据自己的情况进行调整。
-
当我推送到 Github 时,它确实可以正确构建,并且 Julia 也有正确的语法突出显示。我正在使用 Jekyll 3.0.3,但我不知道如何检查 Rouge 版本。我怀疑我的本地 ruby+ jekyll + gems + bundler 安装可能不正确。
-
我认为克里斯已经回答了,但如果您仍需要帮助,请在评论中提及我的名字,以便我收到通知 @ulima2_
标签: markdown jekyll julia syntax-highlighting github-pages