Skip to content

Commit

Permalink
Allows for standard Jekyll code highlighting with distill template (#…
Browse files Browse the repository at this point in the history
…3002)

As described in #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.
  • Loading branch information
jacobaustin123 authored Feb 12, 2025
1 parent e3f029d commit 10d007a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
1 change: 0 additions & 1 deletion _layouts/distill.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<!-- Distill js -->
<script src="{{ '/assets/js/distillpub/template.v2.js' | relative_url }}"></script>
<script src="{{ '/assets/js/distillpub/transforms.v2.js' | relative_url }}"></script>
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>
{% if page._styles %}
<!-- Page/Post style -->
<style type="text/css">
Expand Down
10 changes: 8 additions & 2 deletions _posts/2018-12-22-distill.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ For larger blocks of code, add a `block` attribute:
}
</d-code>

**Note:** `<d-code>` blocks do not look good in the dark mode.
You can always use the default code-highlight using the `highlight` liquid tag:
**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.

{% highlight javascript %}
var x = 25;
Expand All @@ -141,6 +140,13 @@ return x \* x;
}
{% endhighlight %}

You can also write standard Markdown code blocks in triple ticks with a language tag, for instance:

```python
def foo(x):
return x
```

---

## Interactive Plots
Expand Down
28 changes: 0 additions & 28 deletions assets/js/distillpub/overrides.js

This file was deleted.

2 changes: 1 addition & 1 deletion assets/js/distillpub/template.v2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10d007a

Please sign in to comment.