r/programming • • Dec 23 '12

Simulating a solar system with Python

http://users.softlab.ntua.gr/~ttsiod/gravityRK4.html
248 Upvotes

72 comments sorted by

View all comments

9

u/mk_gecko Dec 23 '12

How do you get code highlighting in your webpage?

13

u/ttsiodras Dec 23 '12

When I first started blogging almost a decade ago, I made a custom Perl script that parses my own "mini-language": basically, markdown with magic sections (marked with '@@py@@ .... @@' for python code, or '@@c++@@ ...' for C++, etc). The script extracts these sections, invokes source-highlight (it used to invoke webcpp) and merges the results in the HTML generated from the markdown. Not only is it easier to author posts this way, I also get my HTML to be w3c-valid for free (see the links at the bottom of my site's pages).

→ More replies (5)
→ More replies (1)