This is an awesome feature. Naturally, Emacs also supports this, right out of the box. Just use M-x htmlfontify-buffer. Here's a sample of the output: http://inst.eecs.berkeley.edu/~tikhon/Interpreter.hs.html EDIT: Also, note that while the VIM one uses a bunch of tags, the Emacs one uses a bunch of span tags with reasonable class names like "function-name" or "string", so it produces much nicer code and is easy to u…
Add Syntax Highlighting To Your Blog With VIM
11–20 of 41 posts
Re: Add Syntax Highlighting To Your Blog With VIM
#12In Lightbulb, I used the rst Pygments CodeBlock directive by Georg Brandl (https://github.com/espeed/lightbulb/blob/master/lightbulb/di...) to incorporate code blocks like in Sphinx:
.. code: python
>>> from bulbs.neo4jserver import Graph
>>> g = Graph()
ReStructuredText also allows you to easily add CSS classes to the markup without dropping down into the raw HTML. The rst container directive (http://docutils.sourceforge.net/docs/ref/rst/directives.html...) enables you to add divs so you can allow the content to drive the page layout instead of always being boxed in by the same default template.See Jason Santa Maria's 12 min talk on this design concept http://vimeo.com/4394152.
Re: Add Syntax Highlighting To Your Blog With VIM
#13Re: Add Syntax Highlighting To Your Blog With VIM
#14This is an awesome feature. Naturally, Emacs also supports this, right out of the box. Just use M-x htmlfontify-buffer. Here's a sample of the output: http://inst.eecs.berkeley.edu/~tikhon/Interpreter.hs.html EDIT: Also, note that while the VIM one uses a bunch of tags, the Emacs one uses a bunch of span tags with reasonable class names like "function-name" or "string", so it produces much nicer code and is easy to u…
M-x htmlize-buffer
Re: Add Syntax Highlighting To Your Blog With VIM
#15Re: Add Syntax Highlighting To Your Blog With VIM
#16Re: Add Syntax Highlighting To Your Blog With VIM
#17It seems the output uses the element. That element has been deprecated since HTML4( https://developer.mozilla.org/en/HTML/Element/font ).
Re: Add Syntax Highlighting To Your Blog With VIM
#18Pygments ( http://pygments.org/ ) will also turn code into syntax highlighted HTML.
Re: Add Syntax Highlighting To Your Blog With VIM
#19Probably a little too off-topic, but after years of using similar "custom" methods of doing syntax highlighting, trying several WordPress plugins to automatically highlight, and several other options, I have found embedding GitHub Gists in blog posts to be the most reliable and lowest maintenance approach. This probably won't matter to most people, but if you're the kind of person that has tutorials or examples or an…
Re: Add Syntax Highlighting To Your Blog With VIM
#20Probably a little too off-topic, but after years of using similar "custom" methods of doing syntax highlighting, trying several WordPress plugins to automatically highlight, and several other options, I have found embedding GitHub Gists in blog posts to be the most reliable and lowest maintenance approach. This probably won't matter to most people, but if you're the kind of person that has tutorials or examples or an…
Unfortunately Gists aren't very viewable on a mobile (certainly on an iPhone) as they're truncated and there's no way to scroll to the right. A number of times I've been disappointed to find articles (The Zen of R that's on the front page at the moment, for example) that I can't read. There's a button to view in raw but it's a bit of a shame that I can't view the content with highlighting and proper (non)wrapping.
> (...) and there's no way to scroll to the right
Just swipe using two fingers, and everything works as intended.