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

Code block syntax highlighting #18

Open
tnguyen14 opened this issue Oct 13, 2014 · 3 comments
Open

Code block syntax highlighting #18

tnguyen14 opened this issue Oct 13, 2014 · 3 comments

Comments

@tnguyen14
Copy link
Owner

Instead of using Prism, parse and highlight code block in the import_contents task using pygmentize-bundled (async) https://github.com/chjj/marked#highlight

@tnguyen14
Copy link
Owner Author

Or use prism with npm

var Prism = require('prismjs');

// The code snippet you want to highlight, as a string
var code = "var data = 1;";

// Returns a highlighted HTML string
var html = Prism.highlight(code, Prism.languages.javascript);

http://prismjs.com/

@tnguyen14
Copy link
Owner Author

In order to use the Prism API, does the language have to be declared? And the code separated? If so, this would involve parsing the generated HTML to find code block?

@tnguyen14
Copy link
Owner Author

Is the point of doing this to reduce load on client-side JavaScript, thus making it a bit faster? If so, maybe this could be abstracted out as a plugin, and not part of core tobiko?

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

No branches or pull requests

1 participant