Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to load highlight.js from another location #2580

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 63 additions & 32 deletions plugin/highlight/highlight.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions plugin/highlight/highlight.min.js

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions test/examples/code-highlight.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">

<title>reveal.js - Highlight Plugin</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<link rel="stylesheet" href="../../css/reveal.css">
<link rel="stylesheet" href="../../lib/css/monokai.css">
<link rel="stylesheet" href="../../css/theme/night.css" id="theme">
</head>

<body>

<div class="reveal">

<div class="slides">

<section>
<h2>reveal.js Highlight Plugin</h2>
<p>A thin wrapper for Highlight.js</p>
</section>

<section>
<h3>Fibonacci</h3>

<pre><code data-trim data-noescape>
(def lazy-fib
(concat
[0 1]
((fn rfib [a b]
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
</code></pre>
</section>

</div>

</div>

<script src="../../js/reveal.js"></script>

<script>

Reveal.initialize({
history: true,
transition: 'linear',

highlight: {
// highlightOnLoad: true,
// escapeHTML: true,
// location: 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build',
location: '../../plugin/highlight'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should not be needed as the default location should be relative to the plugin directory.

},

dependencies: [
{ src: '../../plugin/highlight/highlight.js', async: true }
]
});

</script>

</body>
</html>