This project adds highlighters for the semantic languages Turtle and SPARQL to highlight.js, and then reveal.js. It assumes the three projects are cloned next to each other.
- https://github.com/hakimel/reveal.js/blob/master/plugin/highlight/highlight.js embeds v9.11.0 (13 months old)
- highlightjs/highlight.js#1553 adds sparql/turtle, and has been waiting for 11 months.
- can be downloaded from https://github.com/ellismarkf/highlight.js/tree/feature/language-sparql-ttl
- hakimel/reveal.js#2148 is to upgrade reveal.js (to a future 9.13)
- highlightjs/highlight.js#1736 (notified @ellismarkf) asks for fixes to ttl parser
- git clone https://github.com/ellismarkf/highlight.js/
- switch highlight.js to branch feature/language-sparql-ttl
- git clone https://github.com/hakimel/reveal.js
- read https://github.com/isagalaev/highlight.js/blob/master/docs/building-testing.rst
- install node.js from https://nodejs.org/en/download/
- install prerequisites
cd highlight.js npm install
- OPT: see options of the build tool
node tools/build.js --help
- OPT: build semantic languages (2) without compression, so they can be debugged
node tools/build.js -n sparql ttl pie
- OPT: check highlighting: open tools/developer.html and try these files:
- test/detect/sparql/default.txt
- test/detect/ttl/default.txt
- test/detect/pie/default.txt
- build all required languages (23 core + 2 semantic) with compression
node tools/build.js :common sparql ttl pie
- copy
highlight.js/build/highlight.pack.js
intoreveal.js/plugin/highlight/highlight.js
using the script ./highlight-to-reveal.sh
Add sub-modules to your project (.gitmodules
)
[submodule "scripts/highlight.js"] path = scripts/highlight.js url = https://github.com/VladimirAlexiev/highlight.js branch = feature/language-sparql-ttl [submodule "scripts/highlight-to-reveal"] path = scripts/highlight-to-reveal url = https://github.com/VladimirAlexiev/highlight-to-reveal
If you don’t need to modify reveal
, also use it as a sub-module.
The version below patches plugin/highlight/highlight.js
to add sparql and turtle:
[submodule "scripts/reveal.js"] path = scripts/highlight.js url = https://github.com/VladimirAlexiev/reveal.js
If you need to modify reveal
(eg to add an Ontotext theme), clone this repo and modify it.