JavaScript code documentation



Here is an attempt to use a tool called Code Illuminated for browsing and
displaying GNOME Shell's JavaScript code along with its documentation:
http://student.science.uva.nl/~sqdh/gs-mockup/doc/index.html
(The documentation I added there probably isn't very informative, but it was
just meant to have something to show.)

The source code for the documented file is at:
http://student.science.uva.nl/~sqdh/gs-mockup/doc/ui/panel.js

Code Illuminated is created by Atul Varma for Mozilla Labs. It's described at:
http://www.toolness.com/wp/?p=441
http://code.google.com/p/code-illuminated/
Examples of its usage in other projects are at:
http://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/index.html
https://bespin.mozilla.com/docs/

The basic idea is that the script files contain blocks of documentation
formatted using a wiki language or HTML. These are rendered along with the code
to HTML by a JS script that runs in the Web browser. This makes it very easy to
view them locally.

As it is made using only HTML, CSS and JS, it's easy for example to change the
fonts, modify the layout, add syntax highlighting or link to external
API documentation.

My proposal is to have an index.html file like linked above at js/index.html
and document all the Shell's JavaScript code using this syntax.

Thanks to Owen for his first comments at IRC.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]