mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-22 02:52:23 -06:00
Make examples more clear
This commit is contained in:
parent
c587c0b217
commit
1b0a313c16
@ -76,10 +76,10 @@ Dmitry Hrabrov at
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
✅ Using code fences + workaround:
|
||||||
Some unknown code in fences
|
|
||||||
```
|
|
||||||
|
|
||||||
|
{% highlight default %}
|
||||||
|
{% raw %}{% capture code_fence %}
|
||||||
```js
|
```js
|
||||||
// Javascript code with syntax highlighting in fences
|
// Javascript code with syntax highlighting in fences
|
||||||
var fun = function lang(l) {
|
var fun = function lang(l) {
|
||||||
@ -87,21 +87,13 @@ var fun = function lang(l) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
{% endcapture %}
|
||||||
```ruby
|
{% assign code_fence = code_fence | markdownify %}
|
||||||
# Ruby code with syntax highlighting in fences
|
{% include fix_linenos.html code=code_fence %}{% endraw %}
|
||||||
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 %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
✅ Using liquid highlighting + workaround:
|
||||||
|
|
||||||
{% capture code %}
|
{% capture code %}
|
||||||
{% highlight ruby linenos %}
|
{% highlight ruby linenos %}
|
||||||
# Ruby code with syntax highlighting and fixed line numbers using Liquid
|
# Ruby code with syntax highlighting and fixed line numbers using Liquid
|
||||||
@ -113,8 +105,8 @@ end
|
|||||||
{% include fix_linenos.html code=code %}
|
{% include fix_linenos.html code=code %}
|
||||||
{% assign code = nil %}
|
{% assign code = nil %}
|
||||||
|
|
||||||
With the default configuration options, the following example illustrates
|
❌ With the default configuration options, the following example illustrates
|
||||||
the incorrect formatting arising from the incompatibility of HTML compression
|
the **incorrect** formatting arising from the incompatibility of HTML compression
|
||||||
and the non-conforming HTML produced by Jekyll for line numbers:
|
and the non-conforming HTML produced by Jekyll for line numbers:
|
||||||
|
|
||||||
{% highlight ruby linenos %}
|
{% highlight ruby linenos %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user