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

Add support for a custom highlighter function. #15

Merged
merged 1 commit into from
May 6, 2018
Merged

Add support for a custom highlighter function. #15

merged 1 commit into from
May 6, 2018

Conversation

bradhowes
Copy link

Existing code works fine when Prismjs is run in a browser to colorize code.
However, for static site builders such as Metalsmith, we would like to not
rely on browser Javascript. Setting an appropriate highlighter method on a
notebookjs object allows us to continue the rendering process using Prismjs
to highlight code and error cells and save the resulting HTML to a file.

Existing code works fine when Prismjs is run in a browser to colorize code.
Howver, for static site builders such as Metalsmith, we would like to not
rely on browser Javascript. Setting an appopriate highlighter method on a
notebookjs object allows us to continue the rendering process using Prismjs
to highlight code and error cells.
@jsvine
Copy link
Owner

jsvine commented Apr 17, 2018

Thanks, @bradhowes! This seems like a useful feature. Would you be able to share a reproducible repository/zipfile demonstrating the intended usage?

@bradhowes
Copy link
Author

Thanks @jsvine. I've created a demo repo at https://github.com/bradhowes/notebookjs-highliter
The README also has links to my blog where it is being put to good use.

@jsvine jsvine merged commit cfa4831 into jsvine:master May 6, 2018
@jsvine
Copy link
Owner

jsvine commented May 6, 2018

Many thanks, @bradhowes. Looks great, and works for me. Merging.

@jsvine
Copy link
Owner

jsvine commented May 6, 2018

Now available in v0.3.1, on master and via NPM.

@bradhowes
Copy link
Author

Great. Thanks for the merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants