Generate HTML from a Folder of Markdown Files

Generate HTML from a Folder of Markdown Files:

I have some Markdown files that I’m editing and I wanted to generate a folder of HTML files. I looked around on my machine and was surprised I didn’t have anything at hand for that already.

So I wrote a script. I’m a Ruby novice, and it’s quite likely that my Ruby is weird in a dozen different ways. But the script still might be useful to you. (The script requires the RDiscount gem.)

[one of my faves is to turn those if/then statements into guard clauses:

so this: if extension == ‘.markdown’ then return true end

becomes

return true if extension == ‘.markdown’

Just a personal fave, nothing more. I find them easy to read.]

Source: inessential.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s