0.0
No commit activity in last 3 years
No release in over 3 years
Create, show and list articles for the middleman blog
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0
 Project Readme

Writetheman

Create, show and list the middleman blog articles.

It's used by my middleman editor RailsTheMan to manage articles in the browser.

Installation

gem install writetheman

Usage

Init

Config the path of your local middleman :

article = Writetheman::Article::Base.new(yourpath)
blog = Writetheman::Blog.new(yourpath)

Init the article :

article.title = title
article.date = date
article.body = body
article.header = header # string
OR article.header_params = {'tags'=>tags}

Operations

Create a new article :

article.create

Update an article :

article.update(oldfilename)

Read an article file

article.load_from_file(filename)
OR article.load_from_title(title, date)

After loading it you have access to the article attributes

puts(article.title)
puts(article.tags)
puts(article.str_date)
puts(article.body)

List articles :

articles = blog.list_articles

To improve

I writed it to use with a html text editor (see my rails admin).
But more often, the html generated by editors is ugly.
I tried to deal with it, but I'm not happy with this code. Also it should be better separated, or moved in another gem.

License

MIT, have fun