Skip to content

Commit

Permalink
refs #147: GDScript codeblocks are now highlighted in documentation s…
Browse files Browse the repository at this point in the history
…ite. Added support for ancillary languages that may come in handy (md, bash, yaml, json, dockerfile, makefile).
  • Loading branch information
stickgrinder committed Feb 17, 2024
1 parent 937e0f8 commit 473c40f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/content/_assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,10 @@ code,
border: none;
border-radius: 4px;
}
.rst-content pre code {
color: inherit;
background-color: var(--code-background-color);
}

.rst-content tt.literal,
.rst-content code.literal {
Expand Down
3 changes: 3 additions & 0 deletions docs/content/_assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ $(document).ready(() => {
}
}

// Activate Highlight.js syntax-highlighter
hljs.highlightAll();

// Change indentation from spaces to tabs for codeblocks.
const codeBlocks = document.querySelectorAll('.rst-content div[class^="highlight"] pre');
for (const codeBlock of codeBlocks) {
Expand Down
1 change: 1 addition & 0 deletions docs/content/_assets/js/gdscript.min.js

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

9 changes: 9 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
site_name: Popochiu
extra_css:
- _assets/css/custom.css
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/tomorrow-night-bright.min.css
extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/markdown.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/yaml.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/json.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/dockerfile.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/makefile.min.js
- _assets/js/gdscript.min.js
- _assets/js/custom.js
markdown_extensions:
- admonition
Expand Down

0 comments on commit 473c40f

Please sign in to comment.