-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1277 from cryspen/fix-docs-playground
fix(mkdocs): use codemirror instead of ace, re-setup on page reload
- Loading branch information
Showing
3 changed files
with
56 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block site_meta %} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.37.0/ace.min.js" | ||
integrity="sha512-ir9JaQR8EgducDjvBjP9spPK+QWvlQDRv3vWn8c1+PAd2+W1wswCI2XDGJSr8V7s3wS/8bKnvK86tNtLbTapdQ==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script type="module" src="https://esm.sh/run"></script> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" | ||
integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | ||
<script type="module"> | ||
import * as codemirror from "https://esm.sh/codemirror"; | ||
import { rust } from "https://esm.sh/@codemirror/lang-rust"; | ||
globalThis.codemirror = { rust, ...codemirror } | ||
</script> | ||
{{ super() }} | ||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
.md-hax-playground::after { | ||
display: none; | ||
} | ||
} | ||
|
||
textarea.code.inline+div.CodeMirror div.CodeMirror-lines { | ||
padding: 0px !important; | ||
/* added !important as padding is an inline stlye */ | ||
} | ||
|
||
.cm-editor { | ||
outline: none !important; | ||
} | ||
|
||
.md-hax-playground~.md-code__content { | ||
padding: 14px 7px 14px 7px !important; | ||
} | ||
|
||
pre.md-hax-playground-pre { | ||
margin: 0 !important; | ||
} |