cg
Description
cg is A Ruby based HTML "contents generator".
Required RubyGems
- rack
- rake
- jeweler
- tilt
- erubis
- rdiscount
Install
-
RubyGems.org
$ sudo gem install cg
-
GitHub
$ git clone http://github.com/Tomohiro/cg.git $ rake build $ sudo rake install
Usage
-
First Step
$ cg scratch cg.example.com
-
Convert
$ cd cg.example.com/markdown/ $ cg convert index.mkd
e.g.
$ cg convert cg.example.com/markdown/index.mkd => cg.example.com/index.html $ cg convert cg.example.com/markdown/foo+index.mkd => cg.example.com/foo/index.html $ cg convert cg.example.com/markdown/foo-bar+hello.mkd => cg.example.com/foo/bar/hello.html
-
All Rebuild
$ cd cg.example.com $ cg rebuild
-
All Rebuild and Packing
$ cd cg.example.com $ cg rebuild packing $ tar zxvf public.tar.gz -C /var/www/html/
-
Server
$ cg server
Access to http://localhost:9292
$ cg server -h host -p 8080
Access to http://host:8080
Want to run cg server as a daemon? use
nohup
.$ nohup cg server -h host -p 8080 > &
Tips
-
Template customize
$ vi templates/html.erb
-
After save hook for Vim
$ vi .vimrc
autocmd BufWritePost *.mkd :silent !cg convert % > /dev/null
- After save hook for Emacs
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. 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 (c) 2010 Tomohiro, TAIRA.
Licence
The MIT License. See LICENSE for details.