Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: HTMLify - Turn code snippets into HTML, for tech bloggers (htmlify.net)
27 points by Nurdok on May 18, 2013 | hide | past | favorite | 21 comments

Was expecting full html markup with colours etc like in most IDEs. maybe add that as a optional feature? 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.

Pygments (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):


no 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.

<pre> doesn't help with HTML escaping though.

Great, but I'd like to see a preview of the output on that page.

What do you mean? It shows the output in the bottom text area.

Edit: you mean, show a rendering of the output in the page?

That's right: I meant a rendering.

Edit: actually, never mind. The UI is fine for its intended use.

Got a preview rendering to work. Check it out again. Thanks for the suggestion!

Awesome, that's some quick turnaround!

Export your font-locked (colored) emacs buffer to html:




I 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.

I 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.

If you write blog posts in markdown, it's useless.

It 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.

I blog with tumblr (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.

You can switch to the Markdown editor on your settings page; https://www.tumblr.com/settings

You can use HTML in Markdown.

Does it just wrap your code in pre and code tags or am I missing something?

It also maintains whitespaces and escapes special html symbols (&, <, >). I know it doesn't do much. As I said, it's only a convenience.

this 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.

It also escapes html tags and such.

Applications are open for YC Winter 2024

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact