Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Write Haml in Markdown, Syntax Highlight with Pygments, and Pretty Print the output HTML, in Ruby.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 post-modern.gemspec
README.md

PostModern

Write Haml in Markdown, Syntax Highlight with Pygments, and Pretty Print the output HTML, in Ruby.

Install

gem install post-modern

Usage

---
title: My Post
tags: a, b, c
---

Here's a table of stuff:

@@@ haml
%table
  %thead
    %tr
      %th Column A
      %th Column B
  %tbody
    %tr
      %td Item A
      %td Item B
@@@

This table is:

1. written in Haml
2. compiled to html, along with the markdown
require 'post-modern'

post = Post.read("docs/my-post.md")
{
  :title     => "My Post",
  :tags      => ["a", "b", "c"], 
  :format    => "markdown", 
  :keywords  => [], 
  :slug      => "my-post", 
  :file      => "post.md", 
  :published => false
  :content   => %{
<p>Here's a table of stuff:</p>
<table>
  <thead>
    <tr>
      <th>Column A</th>
      <th>Column B</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Item A</td>
      <td>Item B</td>
    </tr>
  </tbody>
</table>
<p>This table is:</p>
<ol>
  <li>written in Haml</li>
  <li>compiled to html, along with the markdown</li>
</ol>}
}

If you have github style code blocks (3 backticks with lang surrounding code), it will be run through the pygments syntax highlighter (requires python). It's really easy to then use Guard to watch as files change, and update your records by parsing the content with this.


MIT License. © 2011 Lance Pollard. Free to use for whatever.

Something went wrong with that request. Please try again.