[Sputnik-list] petrodoc

Yuri Takhteyev yuri at sims.berkeley.edu
Sun Feb 24 09:07:42 GMT+2 2008


I've been playing with the idea of using a single source to generating
documentation, rockspecs, etc.  Here is the latest version of this,
which I am calling "Petrodoc":

    http://sputnik-wiki.googlecode.com/svn/trunk/rocks/petrodoc/src/petrodoc.lua

I started by converting "colors" to it, which is one of the simplest
rocks, obviously.  The idea is that there is a single lua file like
this one:

    http://sputnik-wiki.googlecode.com/svn/trunk/rocks/colors/petrodoc

This file + the source tree are used to generate at once:

1. A LICENSE.txt file
2. An index.html with LuaDoc embedded into it
3. A zip file of the release, including the license file and the index.html
4. An RSS file so that we could have a feed of new releases
5. A rockspec

To use it you run petrodoc.lua and give it as the first parameter your
rock directory, and (optionally) the number of the rockspec revision
(it will default to "0"):

yuri at chai:.../trunk$ rm -rf rocks/colors/tmp/*
yuri at chai:.../trunk$ ~/sputnik/bin/lua5.1
rocks/petrodoc/src/petrodoc.lua rocks/colors
  adding: colors-8.02.23/src/ (stored 0%)
  adding: colors-8.02.23/src/colors.lua (deflated 82%)
  adding: colors-8.02.23/docs/ (stored 0%)
  adding: colors-8.02.23/docs/howto.md (deflated 93%)
  adding: colors-8.02.23/docs/index.html (deflated 90%)
  adding: colors-8.02.23/docs/colors.png (deflated 2%)
  adding: colors-8.02.23/LICENSE.txt (deflated 46%)
yuri at chai:.../trunk$ ls rocks/colors/tmp/
colors-8.02.23             colors-8.02.23.zip  releases.rss
colors-8.02.23-0.rockspec  index.html

I then scp index.html and releases.rss to my web directory,
colors-8.02.23.zip to the releases directory and
colors-8.02.23-0.rockspec to my rocks repository.   (I need to update
the manifest too.)

Colors has just been updated using this method, so you can see the
html output at http://sputnik.freewisdom.org/colors/.  The rock seems
to be working.

If you want to try it, I put Jason's LuaDoc rock in the Sputnik repository.

What do you all think?  I am thinking of switching to this method from
what is described in http://sputnik.freewisdom.org/en/Source

  - yuri



More information about the Sputnik-list mailing list