Skip to content

Commit 25367f4

Browse files
committed
[docs] refactor usage docs syntax highlighting
1 parent ba5984d commit 25367f4

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

site/src/_includes/components/usage.njk

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,31 @@
44
{{ "Once initialized, `quicklink` will automatically prefetch URLs for links that are in-viewport during idle time." | markdown | safe }}
55

66
{{ "Quickstart:" | markdown | safe }}
7-
{% markdownConvert %}
8-
```
7+
8+
{% highlight "html" %}
99
<!-- Include quicklink from dist -->
1010
<script src="dist/quicklink.umd.js"></script>
1111
<!-- Initialize (you can do this whenever you want) -->
1212
<script>
1313
quicklink.listen();
1414
</script>
15-
```
16-
{% endmarkdownConvert %}
15+
{% endhighlight %}
1716

1817
{{ "For example, you can initialize after the `load` event fires:" | markdown | safe }}
19-
{% markdownConvert %}
20-
```html
18+
{% highlight "html" %}
2119
<script>
2220
window.addEventListener('load', () => {
2321
quicklink.listen();
2422
});
2523
</script>
26-
```
27-
{% endmarkdownConvert %}
24+
{% endhighlight %}
2825

2926
{{ "ES Module import:" | markdown | safe }}
30-
{% markdownConvert %}
31-
```js
27+
{% highlight "js" %}
3228
import quicklink from "quicklink/dist/quicklink.mjs";
3329
quicklink.listen();
34-
```
35-
{% endmarkdownConvert %}
30+
{% endhighlight %}
31+
3632
{{ "The above options are best for multi-page sites. Single-page apps have a few options available for using quicklink with a router:" | markdown | safe }}
3733
{{ "* Call `quicklink.listen()` once a navigation to a new route has completed" | markdown | safe }}
3834
{{ "* Call `quicklink.listen()` against a specific DOM element / component" | markdown | safe }}

0 commit comments

Comments
 (0)