ClothMark
With ClothMark you can easily convert your files formatted with Markdown, Textile or BBCode to HTML files.
ClothMark uses three awesome gems:
Installation
gem sources -a http://gems.github.com
sudo gem install ravicious-clothmark
Usage
Basic usage:
$ clothmark [input file]
It converts an input file to HTML using Markdown preprocessor. But you probably want to specify an output file or used preprocessor. Of course you can do this. Look here:
$ clothmark [input file] [-o output file] [-m markup language]
Quick example:
$ clothmark bb_code.txt -m bbcode -o forum_post.html
It converts the input file (bb_code.txt) to the HTML file (forum_post.html) using BBCode preprocessor.
Wanna see help? No problem.
$ clothmark -h
Usage: clothmark [options]
-h, --help Display this screen
-i, --input FILE Specify input file (if it aren't specified, then first argument will be used)
-o, --output FILE Specify output file
-ah, --additional-html Specify, do additional HTML and CSS will be used (default - false)
-m, --markup LANG Specify markup language (markdown, textile or bbcode, default is markdown)
As you see, there are four arguments:
-
-i or –input which specifies input file. If it isn’t typed, then first argument will be used as an input file. This argument is required.
-
-o or –output which specifies output file. You don’t have to specify it, because ClothMark generates filename for output file automatically.
-
-m or –markup which specifies markup language. If you don’t specify it, then Markdown will be used as a choosed language.
-
-ah or –additional-html which specifies, do additional HTML and CSS will be used. Default is set to false, but you can set it to true, just type this argument.
All files will be created in the folder that contains a input file, e.g:
$ clothmark posts/forum_post2 -m bbcode
In this case, the forum_post2.html file will be created in the posts folder.
Note on Patches/Pull Requests
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it (RSpec). This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2009 Rafal Cieslak. See LICENSE for details.