forked from asciidoctor/asciidoctor-reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolves asciidoctor#21 load highlight.js from a CDN
- Loading branch information
1 parent
3ee563f
commit 52d550d
Showing
21 changed files
with
1,006 additions
and
20 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 |
---|---|---|
|
@@ -231,7 +231,7 @@ The executables are built using the <<Node / JavaScript Setup,Node / JavaScript> | |
* Copy or clone the reveal.js presentation framework in the directory where you will build your slidedeck. | ||
Here we do a shallow clone of the repo: | ||
|
||
$ git clone -b 3.9.2 --depth 1 https://github.com/hakimel/reveal.js.git | ||
$ git clone -b 3.7.0 --depth 1 https://github.com/hakimel/reveal.js.git | ||
|
||
=== Convert AsciiDoc into slides | ||
|
||
|
@@ -530,9 +530,9 @@ To override that behavior use the `width` and `height` named attributes. | |
|
||
=== Syntax highlighting | ||
|
||
Reveal.js is well integrated with https://highlightjs.org/[highlight.js] for syntax highlighting. | ||
reveal.js is well integrated with https://highlightjs.org/[Highlight.js] for syntax highlighting. | ||
Asciidoctor reveal.js supports that. | ||
You can activate highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows: | ||
You can activate Highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows: | ||
|
||
[source, asciidoc] | ||
---- | ||
|
@@ -541,7 +541,26 @@ You can activate highlight.js syntax highlighting (disabled by default) by setti | |
:source-highlighter: highlightjs | ||
---- | ||
|
||
Once enabled you can write code blocks as usual: | ||
[NOTE] | ||
---- | ||
By default, we are using a prebuilt version of Highlight.js with 34 commonly used languages hosted on https://cdnjs.com/[cdnjs]. | ||
You can load additionnal languages using the `:highlightjs-languages:` attribute: | ||
``` | ||
// load yaml and scilab languages | ||
:highlightjs-languages: yaml, scilab | ||
``` | ||
You can also load Highlight.js from a custom base directory (or remote URL) using the `:highlightjsdir:` attribute: | ||
``` | ||
// load from a local path | ||
:highlightjsdir: highlight | ||
// load from jsdelivr CDN | ||
//:highlightjsdir: https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build | ||
---- | ||
|
||
Once enabled, you can write code blocks as usual: | ||
|
||
[source, asciidoc] | ||
.... | ||
|
@@ -571,7 +590,8 @@ print "$0: hello world\n" | |
.... | ||
|
||
[NOTE] | ||
Alternatively, you can use http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as syntax highlighters if you are using the Asciidoctor/Ruby/Bundler toolchain (not Asciidoctor.js/JavaScript/npm). | ||
Alternatively, you can use http://rouge.jneen.net/[Rouge], http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as syntax highlighters, | ||
if you are using the Asciidoctor/Ruby/Bundler toolchain (not Asciidoctor.js/JavaScript/npm). | ||
Check the `examples/` directory for examples and notes about what needs to be done for them to work. | ||
They are considered unsupported by the asciidoctor-reveal.js project. | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// .source-highlightjs-languages | ||
// Demonstration of source highlighting with highlight.js using additional languages | ||
// :include: //div[@class="slides"] | //body/script | ||
// :header_footer: | ||
= Scilab Code with Highlight.js: using additional languages | ||
:source-highlighter: highlight.js | ||
:highlightjs-languages: yaml, scilab | ||
|
||
== Use the Source | ||
|
||
[source,scilab] | ||
---- | ||
function B=gauss_filter_3_3(A) | ||
x=size(A,2); | ||
y=size(A,1); | ||
B = zeros(y, x); | ||
for j = 2:y-1 | ||
for i= 2:x-1 | ||
val= 4*A(j,i)+2*(A(j,i-1)+A(j,i+1)+A(j+1,i)+A(j-1,i))+A(j+1,i+1)+A(j-1,i+1)+A(j+1,i-1)+A(j-1,i-1); | ||
B(j,i) = val/16; | ||
end | ||
end | ||
endfunction | ||
A = rand(10, 10) * 256; | ||
B = gauss_filter_3_3(A); | ||
---- |
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
Oops, something went wrong.