3 ms·
Show HN: HTMLify - Turn code snippets into HTML, for tech bloggers
- kranner 13y agoGreat, but I'd like to see a preview of the output on that page.
- Nurdok 13y agoWhat do you mean? It shows the output in the bottom text area. Edit: you mean, show a rendering of the output in the page?
- Perrydu 13y agoIf you write blog posts in markdown, it's useless.
- Nurdok 13y agoI blog with tumblr (http://blog.amir.rachum.com http://blog.amir.rachum.com) and HTML is the only viable option I see there. Yeah, I probably need to change my venue :) In any case, this project (as stated in the footer) is more of an experience for me. I don't expect this to revolutionize anything. Just a nice tool which I personally need.
- elliottcarlson 13y agoYou can switch to the Markdown editor on your settings page; https://www.tumblr.com/settings https://www.tumblr.com/settings
- jabbernotty 13y agoIt is for html. It is called Htmlify. I don't see why you feel a need to call it useless, just because it doesn't apply to markdown.
- deepdog 13y agoYou can use HTML in Markdown.
- oakaz 13y agono colors? I would just prefer to wrap my code with <pre></pre> instead of using a whitespace generator which makes pain in the ass to make modifications on the code.
- sp332 13y ago<pre> doesn't help with HTML escaping though.
- arb99 13y agoWas expecting full html markup with colours etc like in most IDEs. maybe add that as a optional feature? http://qbnz.com/highlighter/ http://qbnz.com/highlighter/ or similar library might help there. This seems like a slightly extended htmlentities(nl2br($input)) (if done in php). handy in those times you need stuff converted so it'll output the same way as what you are pasting in.
- buttscicles 13y agoPygments (http://pygments.org/ http://pygments.org/) is the best Python library for this. (op is using Django) It's pretty configurable, and outputs something like this (both the pastebin and linked paste make use of it): https://paste.buttscicl.es/u/877a8d68d88239985e6bb39a4ccaa818/ https://paste.buttscicl.es/u/877a8d68d88239985e6bb39a4ccaa81...
- borplk 13y agoDoes it just wrap your code in pre and code tags or am I missing something?
- Nurdok 13y agoIt also maintains whitespaces and escapes special html symbols (&, <, >). I know it doesn't do much. As I said, it's only a convenience.
- tuananh 13y agothis can be done easily with a script as it simply wrap the tex with a pre tag. i don't see the need for this kind of thing. tech bloggers usually got enough knowledge for this kind of stuff.
- Nurdok 13y agoIt also escapes html tags and such.
- kruhft 13y agoExport your font-locked (colored) emacs buffer to html: http://www.emacswiki.org/emacs/Htmlize http://www.emacswiki.org/emacs/Htmlize or http://www.emacswiki.org/emacs/HtmlFontify http://www.emacswiki.org/emacs/HtmlFontify
- alipang 13y agoI can definitely recommend using org-mode for tech blogging. With the #+BEGIN_SRC tag you can automatically get an export of code set by the emacs-mode for that language, in addition to markup for other text.
- franzwong 13y agoI would recommend you to write a javascript version to render on the fly. So that you can keep your code being saved without any modification.