Create, show and list the middleman blog articles.
It's used by my middleman editor RailsTheMan to manage articles in the browser.
gem install writetheman
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}
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
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.
MIT, have fun