-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Expose code highlight extend point to use other highlight tools. #1300
Comments
What's stopping you from adding one of these library to your theme ? |
Actually I've made it by "adding one of these library to my theme". see here. But It's ugly hack I think. I've tried that highlight it by use codemirror on server side. But many things need care. Scripts in theme or plugin doesn't have a good hook point to replace hexo's builtin code highlight generation. Maybe monkey patch the highlight method in |
Server-side highlight may be good because it doesn't depend on JavaScript at all, transforming your source code into valid HTML code, but client-side is fine too : it does not alter your source code, making it easier to index by search engine. Also, copy-paste is easier for your visitors. I think we could debate on that, but as you may have already understand, I'm rather found of client-side code hightlighting myself. |
Client side highlight is almost good. |
Maybe we can add another filter named |
If you use the Markdown-It renderer, you can decorate it with the I've proposed a Pull-Request : hexojs/hexo-renderer-markdown-it#15 |
It is pretty easy to integrate Google Prettify (suggested by @liuzc #1718 (comment)) |
@hackwaly I had meet the same problem as yours. I think it's good idea for highlighting at front-end. |
I'd like to use CodeMirror or other static analyze tools for generate semantic code highlight.
Other users may prefer prism.js over highlight.js.
The text was updated successfully, but these errors were encountered: