couchapp git and yuidoc

Up to now the generation of documentation out of javaScript sources don’t seem to have a standard tool.

I’ve tried yuidoc and have to say that I’m not complete convinced. The pros and cons of yuidoc are a story for itself.

However I’ve worked out a (conceptual) way which combines my daily tools couchdb couchapp and git for having the latest documentation (generated by yuidoc) online and moreover offline.

Install yuidoc

There are official repos on opensuse.com providing the python stuff. With this the installation goes like described in the INSTALL file after extracting the zip:

 1. Check to see if setuptools is installed.
     Execute this command:
         which easy_install

     If it returns something, it's installed skip to step #3.


 2. Install Setup Tools:
     Extract the archive in ext and install the package
     sudo python setup.py install (no sudo needed for cygwin or windows)

     setuptools
         cd ext
         tar xfvz setuptools-0.6c9.tar.gz
         cd setuptools-0.6c9
         sudo python setup.py install

 3. Install the dependencies

     easy_install pygments
     easy_install Cheetah
     easy_install simplejson


 4. Make a copy of yuidoc/bin/example.sh and modify the paths to suit your
 needs.

If you speak a lang with strange letters (öäü) you should replace line 57 in yuidoc_highlight.py with:

out.writelines(highlighted.encode('utf-8'))

Config

The example.sh from point 4 is the script you have to modify and execute. This is nice, since you can simply use the script as post commit hook

cp  yuidoc/bin/example.sh  ~/..project../.git/post-commit

You can set some variables in that script e.g.:

version=`git log --pretty=format:"%ad-%an-%H" --date=short -n 1`

to display some version information on the page.

Use a couchapp!

I have to document a couchapp I wrote. Here, my first attempt was: make a folder below _attachments and let the html arise in there failed. Rewriting the

 yuidoc/template/main.tmpl

to adapt the server pathes is simply to much work. Therefore this idea:

  • Generate a couchapp project-doc and strip it down to the bones:

    /dir> ls project-doc/
         ./
         ../
         _attachments/
         .couchappignore
         couchapp.json
         .couchapprc*
         _id
    
  • set the variables in the shell/hook-script to

     parser_in="./_attachments/js-src-to-doc"
     parser_out=$doc_home/_attachments
     generator_out=$doc_home/_attachments
    

while

     doc_home=path/to/project-doc
  • couchapp push
  • visit http://localhost:5984/db_name/_design/project-doc/index.html

Also the deployment can be activated via the shell/hook-script. Add

cd path/to/project-doc && couchapp push

at the last line. If everything works fine you got a fresh source code documentation on every commit.

When You Write Your Essays in Programming Languages

able2extract:

When You Write Your Essays in Programming Languages

37 notes

Simply Statistics: Contributions to the R source

simplystatistics:

One of the nice things about tracking the R subversion repository using git instead of subversion is you can do

git shortlog -s -n

which gives you

19855 ripley 
6302 maechler 
5299 hornik 
2263 pd 
1153 murdoch 
813 iacus 
716 luke 
661 jmc 
614 leisch 
472 ihaka
403 murrell 
286 urbaneks 
284 rgentlem
269  apache
253  bates
249  tlumley
164  duncan
92  r
43  root
 40  paul
 40  falcon
 39  lyndon
 34  thomas
 33  deepayan
 26  martyn
 18  plummer
 15  (no author)
 14  guido
  3  ligges
  1  mike

2 notes

nodejs, javascript indentation for emacs

4 notes

EveryJS.com

The right tool for the job.

sort by:

  • name
  • size

filter by:

  • DOM
  • Animation
  • MVC
  • Mobil

4 notes

NodeSummit

Node Summit is a two-day conference at the Mission Bay Conference Center in San Francisco - January 24-25, 2012

0 notes

Why Functional: One Reason

ingoschramm:

Why functional is better? So many reasons, one comes here: Programming languages are not made for computers, they are for humans to formulate generic solutions computers can solve faster in the details. The imperative style formulates the steps the computer has to follow, the functional style formulates the generic solution as such. Imperative style wants you to act like a machine, functional style allows you to think like a human.

Amen

(Source: 2garryn)

2 notes

Delete Backwards To BOL in Emacs | Irreal

vishers:

Oh, I have gots to remember this.

BOL means beginning of line (such as BOWLING means beginning of white line in general)

1 note

dear lazy web

beside maxima which of this lang

4cs, abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, gdb, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, mapbasic, matlab, mirc, mmix, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, perl6, php, php-brief, pic16, pike, pixelbender, plsql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, qbasic, rails, rebol, reg, robots, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, z80

has a

:

as assignment operator?

38 notes

glob2rx()

generates regExp from nobrainer * expressions

> glob2rx("foo*.bar.*baz")
[1] "^foo.*\\.bar\\..*baz$"
37 notes