cg is A Ruby based HTML "contents generator".

Required RubyGems

  • rack
  • rake
  • jeweler
  • tilt
  • erubis
  • rdiscount



    $ sudo gem install cg
  • GitHub

    $ git clone
    $ rake build
    $ sudo rake install


  1. First Step

    $ cg scratch
  2. Convert

    $ cd
    $ cg convert index.mkd


    $ cg convert
    $ cg convert
    $ cg convert
  3. All Rebuild

    $ cd
    $ cg rebuild
  4. All Rebuild and Packing

    $ cd
    $ cg rebuild packing
    $ tar zxvf public.tar.gz -C /var/www/html/
  5. 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 > &


  1. Template customize

    $ vi templates/html.erb
  2. After save hook for Vim

    $ vi .vimrc
     autocmd BufWritePost *.mkd :silent !cg convert % > /dev/null
  3. 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 (c) 2010 Tomohiro, TAIRA.


The MIT License. See LICENSE for details.