Thanks for considering contributing to this repository! We're happy to review Pull Requests for improving the syntax highlighting of LookML.
Clone this repo and the highlight.js repo as separate repos.
From inside the highlight.js repository, cd extra
and symlink the highlightjs-lookml repository, naming the symlink lookml
.
When you're done, you should have a symlink named lookml
in the extra
directory of your highlight.js repo. The symlink should point to your highlightjs-lookml repo.
Whenever you make changes in the highlightjs-lookml repo, they will be immediately reflected in the highlight.js repo. Immediate updates will be useful for building and testing with the tools there.
Depending on which build command you run (npm run build
, node tools/build.js
, minification for CDN, etc.), highlight.js will build itself differently. Depending on what you want to test, you will need to build highlight.js the right way. You may need to reference the highlight.js Building and Testing docs.
You'll probably want to start by testing highlight.js in the browser. highlight.js ships with an in-browser development tool that's extremely useful for testing changes to the language definition.
To use it, first build highlight.js, only building the lookml
language and skipping compression for better error messages (-n
). At the root of the highlight.js repo, run:
node tools/build.js -n lookml
Run open tools/developer.html
to open the webpage in your browser. On this page, you can input text to be highlighted. You can change the theme and view the parsed structure of the document, which is very helpful for debugging the language definition.
Whenever you make changes to the language definition, rebuild (see above) and refresh the page to see changes.
Good luck! Open an issue on this repo if you get stuck or need help configuring your development environment.
To understand highlight.js and how language definitions work, consult this documentation: