mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
[markdown] Switch to Remarkable (#153)
* Switch to Remarkable * Clean up references to custom code blocks * Remove valdiateDOMNesting warning * Add syntax highlighting * Add Reason support * Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs * Completely remove Prism and associated CSS rules * Support loading plugins and scripts * Remove CSS rules, allowing Highlight.js theme to be used entirely * Remove unnecessary webplayer script
This commit is contained in:
parent
58613545b6
commit
b832176dc6
18 changed files with 231 additions and 2744 deletions
|
@ -32,6 +32,10 @@ class Site extends React.Component {
|
|||
(this.props.url || "index.html");
|
||||
let latestVersion;
|
||||
|
||||
const highlightDefaultVersion = '9.12.0';
|
||||
const highlightConfig = this.props.config.highlight
|
||||
|| { version: highlightDefaultVersion, theme: 'default' };
|
||||
const highlightVersion = highlightConfig.version || highlightDefaultVersion;
|
||||
if (fs.existsSync(CWD + "/versions.json")) {
|
||||
latestVersion = require(CWD + "/versions.json")[0];
|
||||
}
|
||||
|
@ -124,6 +128,12 @@ class Site extends React.Component {
|
|||
}}
|
||||
/>
|
||||
))}
|
||||
<script src={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/highlight.min.js`}></script>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `hljs.initHighlightingOnLoad();`
|
||||
}}
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue