Support for the linenos option on highlighted code

The added examples in `docs/index-test.md` extend the previous examplees of highlighting, documenting the required inout.
This commit is contained in:
PLanCompS
2020-07-04 19:21:49 +02:00
parent 50d727871e
commit b41f28dade
3 changed files with 133 additions and 1 deletions

View File

@@ -33,12 +33,44 @@ var fun = function lang(l) {
```
```ruby
# Ruby code with syntax highlighting
# Ruby code with syntax highlighting in fences
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
```
{% highlight ruby %}
# Ruby code with syntax highlighting using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}
{% capture fix_linenos_code %}{% highlight ruby linenos %}
# Ruby code with syntax highlighting and fixed line numbers using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}{% endcapture %}{% include fix_linenos.html %}{{ fix_linenos_code }}
{% comment %}
The code example below requires the following setting in `_config.yml`:
```yaml
compress_html:
ignore:
envs: all
```
{% highlight ruby linenos %}
# Ruby code with syntax highlighting and unfixed line numbers using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}
{% endcomment %}
#### [](#header-4)Header 4
* This is an unordered list following a header.