Ask HN: Easy way to display non-parsed HTML blocks?

1 points by ThinkWriteMute ↗ HN
One of the things I've started to realize while writing Learn You An Ruby, and doing other web based projects, is that HTML in HTML is absolutely impossible or inanely complex.

I want to write a web tutorial for HTML, but I don't want to have to get into using complex/poorly done Javascript crap. The only option I can see is using screenshots, but those suck for copy/pasting.

Ideas?

4 comments

[ 10.2 ms ] story [ 44.5 ms ] thread
How about the <pre> tag?

You could also do a preprocessor that converts your angle brackets in certain divs to &lt; and &gt;. It should be pretty easy (<1 hour) to whip something up in Python that uses BeautifulSoup and string search/replace to do this.

The <pre> tag doesn't stop the browser from rendering the HTML.
You don't mention whether you intend to host the tutorial yourself. If not, you might consider setting up a blog on wordpress.com where you can use the [sourcecode] tag when composing a post that provides all sorts of options for displaying text from various programming languages.

HTML used to be supported, but I don't see it in the current list. You might just use 'text' as the language type and then use one of the other options to highlight lines and such.

You can see a complete description here:

http://en.support.wordpress.com/code/posting-source-code/

I've used Wordpress on two projects and it took me only 3 days to get fed up with it.

It's like having an entire Home Depot when you just need a tool box.

Thanks for the suggestion, though.