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

You may have blocks of code syntax highlighting? #28

Open
tanrax opened this issue Aug 6, 2016 · 4 comments
Open

You may have blocks of code syntax highlighting? #28

tanrax opened this issue Aug 6, 2016 · 4 comments
Assignees

Comments

@tanrax
Copy link

tanrax commented Aug 6, 2016

I said above :)

@caffo
Copy link
Owner

caffo commented Aug 8, 2016

@tanrax as of right now, there's no support, but I have something in the works. Keeping this issue opened and will update it when I'm done.

@tanrax
Copy link
Author

tanrax commented Aug 8, 2016

thanks!

@caffo
Copy link
Owner

caffo commented Aug 15, 2016

@tanrax, I don't think I will have free time to actually implement this in the next few weeks. Anyway I come up with a way to implement it for you. Just replace the contents of your .setup file with this:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://orgminimal.tizi.moe/bundle.min.css"/>
#+HTML_HEAD: <script src="http://orgminimal.tizi.moe/bundle.min.js" type="text/javascript" ></script>
#+HTML_HEAD: <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
#+HTML_HEAD: <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
#+HTML_HEAD: <script>
#+HTML_HEAD: document.addEventListener("DOMContentLoaded", function(event) {
#+HTML_HEAD: var blocks = document.getElementsByTagName('pre')
#+HTML_HEAD: for (index = 0; index < blocks.length; ++index) {
#+HTML_HEAD:   hljs.highlightBlock(blocks[index])
#+HTML_HEAD:   console.log(blocks[index]);
#+HTML_HEAD: }
#+HTML_HEAD: });
#+HTML_HEAD: </script>

Let me know if you have questions.

@caffo caffo self-assigned this Aug 15, 2016
@ryukinix
Copy link

ryukinix commented Nov 12, 2017

Why just not use htmlize package? We already have default syntax-highlight with that on export. I have another problem with this is because the blocks of code is not dynamic, if I write a little long line it exceeds the block as here

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

3 participants