Project

postage

0.0
No commit activity in last 3 years
No release in over 3 years
Postage is an API developed for handle text files for posts for blogs or anything else.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.6.0
>= 4.2.2
 Project Readme

Postage¶ ↑

Description¶ ↑

A generic interface (API) for handle text files filtered by Markdown or Textile syntax.

Synopsis¶ ↑

Postage is a generic interface (API) which load your text files and handle the contents in Markdown or Textile. It help you handle easily plain text files for parse to HTML.

Example:

require 'postage'

text = Postage::Entry.file("path/to/text_file.mkd")
# => #<Postage::Entry:0x7f4fbd9ad418
#      @file=#<Pathname:path/to/text_file.mkd>>
text.extract_attributes!
# => #<Postage::Entry:0x7f4fbd9ad418
# =>   @filter=:markdown,
# =>   @title="Entry *test*\n============\n",
# =>   @content=["\n",
# =>     "Entry *test*. This content uses [Markdown][] syntax.\n",
# =>     "\n", "[markdown]: http://daringfireball.net/projects/markdown/\n",
# =>     "\n"],
# =>   @file=#<Pathname:path/to/text_file.mkd>>
page = text.to_html
# => "<h1 id='entry_test'>Entry <em>test</em></h1>\n
# =>  \n<p>Entry <em>test</em>. This content uses
# =>  <a href='http://daringfireball.net/projects/markdown/'>Markdown</a>
# =>  syntax.</p>"

For use files as posts in a blog, use Post class.

post = Postage::Post.file("path/to/2009-11-20.post-file-for-a-blog.tagged.tag.mkd")

Requirements¶ ↑

Postage work with following Gems:

That is, you choose your favorite filter for both formats.

Install¶ ↑

Install via RubyGems.

gem install postage

Information¶ ↑

For more information about the project, please visit the following Web sites:

About the lightweight markup languages, please, visit the following Web sites:

Copyright © 2009 Hallison Batista

Distributed under the MIT license. See the COPYING file for more info.