Skip to content

Commit 10d007a

Browse files
Allows for standard Jekyll code highlighting with distill template (#3002)
As described in alshedivat/al-folio#300, standard Markdown code highlighting doesn't work in the Distill template because it is clobbered by the Distill "Prism" syntax highlighting. This PR will allow d-code tags (distill-specific code tags) to function with the Distill syntax highlighter, but will default `highlight` and Markdown code blocks to use the Jekyll/Rouge highlighter. This PR also removes overrides.js, which is currently broken because jquery isn't loaded.
1 parent e3f029d commit 10d007a

File tree

4 files changed

+9
-32
lines changed

4 files changed

+9
-32
lines changed

_layouts/distill.liquid

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<!-- Distill js -->
77
<script src="{{ '/assets/js/distillpub/template.v2.js' | relative_url }}"></script>
88
<script src="{{ '/assets/js/distillpub/transforms.v2.js' | relative_url }}"></script>
9-
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>
109
{% if page._styles %}
1110
<!-- Page/Post style -->
1211
<style type="text/css">

_posts/2018-12-22-distill.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ For larger blocks of code, add a `block` attribute:
131131
}
132132
</d-code>
133133

134-
**Note:** `<d-code>` blocks do not look good in the dark mode.
135-
You can always use the default code-highlight using the `highlight` liquid tag:
134+
**Note:** `<d-code>` blocks do not look good in the dark mode. You can instead use the standard Jekyll syntax highlight with the `highlight` liquid tag.
136135

137136
{% highlight javascript %}
138137
var x = 25;
@@ -141,6 +140,13 @@ return x \* x;
141140
}
142141
{% endhighlight %}
143142

143+
You can also write standard Markdown code blocks in triple ticks with a language tag, for instance:
144+
145+
```python
146+
def foo(x):
147+
return x
148+
```
149+
144150
---
145151

146152
## Interactive Plots

assets/js/distillpub/overrides.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

assets/js/distillpub/template.v2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)