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
Octocat-spinner-32 lib now its really working the way i want it September 21, 2011
Octocat-spinner-32 spec first commit September 19, 2011
Octocat-spinner-32 .gitignore posts September 19, 2011
Octocat-spinner-32 .rspec first commit September 19, 2011
Octocat-spinner-32 README.md first commit September 19, 2011
Octocat-spinner-32 Rakefile posts September 19, 2011
Octocat-spinner-32 post-modern.gemspec now its really working the way i want it September 21, 2011
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.