mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Move all HTML/CSS/JS related to preview and syntax highlighting in the docs into a shared folder
This will also be the place where the .60 language definition for highlight.js can go.
This commit is contained in:
parent
3f5ad42683
commit
8003c06f3a
7 changed files with 6 additions and 6 deletions
4
api/sixtyfps-cpp/docs/_templates/layout.html
vendored
4
api/sixtyfps-cpp/docs/_templates/layout.html
vendored
|
@ -1,6 +1,6 @@
|
|||
{% extends "!layout.html" %}
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
{% include "../../../sixtyfps-rs/sixtyfps-docs-preview.html" %}
|
||||
{% include "../sixtyfps-docs-highlight.html" %}
|
||||
{% include "../../../../docs/html/sixtyfps-docs-preview.html" %}
|
||||
{% include "../../../../docs/html/sixtyfps-docs-highlight-cpp.html" %}
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
<!--
|
||||
This file is used to add syntax highlighting of the `.60` snippets in the generated C++ documentation.
|
||||
It is injected in the Sphinx documentation via _templates/layout.html.
|
||||
-->
|
||||
<link rel="stylesheet" href="https://sixtyfps.io/highlight-default.css">
|
||||
<script src="https://sixtyfps.io/highlight.pack.js"></script>
|
||||
<script src="https://sixtyfps.io/highlight_60.js"></script>
|
||||
<script>
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
// The Sphinx/my_st generated HTML for code blocks does not use <code> tags, so highlight.js'
|
||||
// default selector "pre code" does not match. Let's do it by hand:
|
||||
for (block of document.querySelectorAll("div.highlight-60 div.highlight pre")) {
|
||||
hljs.highlightBlock(block)
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue