- The tool must not require me to embed a third-party widget into my blog post. That rules out Github Gists.
- The tool must not require me to make changes to my main blog template, especially not changes that load any additional files. That rules out SyntaxHighlighter.
I found a tool called hilite.me by Alexander Kojevnikov which met the above criteria. It's pretty awesome:
Now, adding code blocks to blog posts is easy:
- Paste your source code into the left box
- Click Highlight!
- Copy the generated HTML/CSS code into the HTML for your blog post. (For example, if you're on Blogger, click HTML next to Compose and then paste the code into its place.)
- Preview and edit to make sure that the in-between whitespace looks decent.
As a bonus, it's open source, and it's powered by Flask and Pygments, two other nice open-source Python packages.
No comments:
Post a Comment