Project

cg

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
cg is A Ruby based contents generator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.9

Runtime

>= 2.6.5
>= 1.4.1
>= 1.1.0
>= 1.6.3.1
>= 0.9
 Project Readme

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

  1. First Step

     $ cg scratch cg.example.com
    
  2. 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
    
  3. All Rebuild

     $ cd cg.example.com
     $ cg rebuild
    
  4. All Rebuild and Packing

     $ cd cg.example.com
     $ 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 > &
    

Tips

  1. Template customize

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

     $ vi .vimrc
    
 autocmd BufWritePost *.mkd :silent !cg convert % > /dev/null
  1. 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.