Abstract
Here is what I think about good and usable documentation system:
-
It should be possible to write documentation on your workstation, in your favorite text editor, and it should not require access to internet.
-
All documentation should be shared between authorized people. This include both accessing documentation using web browser and url in our server and accessing it in the local files.
-
It’s nice to have ability to use simple markup language and hyperlinks in documentation to make documentation ease to read and navigate.
-
Ability to edit documentation on server using web browser (a-la Wiki) may be required in some projects, but in most cases it’s needless.
Solution
Documentation for project stored inside project root directory,
in .lib/doc/
directory (and it subdirs) in .txt
files.
Documentation distributed just like any other project’s files.
These .txt
files written using simple markup language:
AsciiDoc.
See AsciiDoc markup cheat sheet.
Documentation is accessible using /doc/ url on project’s website. Access to /doc/ can be protected using .htaccess.
.html version of .txt files in .lib/doc/ will be generated
automatically, and will be regenerated again if source .txt file was changed. |
Configuration
AsciiDoc Installation on Gentoo Linux
emerge asciidoc
Vim syntax highlight
-
Download asciidoc.vim and save it into
\~/.vim/syntax/
. -
Add something like this into
\~/.vimrc
:autocmd FileType mail,text,asciidoc,html setlocal spell spelllang=en,ru autocmd FileType asciidoc \ setlocal autoindent expandtab softtabstop=2 shiftwidth=2 \ formatoptions=tcqn \ formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\\|^\\s*<\\d\\+>\\s\\+\\\\|^\\s*[a-zA-Z.]\\.\\s\\+\\\\|^\\s*[ivxIVX]\\+\\.\\s\\+ \ comments=s1:/*,ex:*/,://,b:#,:%,:XCOMM,fb:-,fb:*,fb:+,fb:.,fb:>
Perl and sh code inside asciidoc files can be highlighted this way:
|
Viewing documentation in browser
Download latest asciidoc.cgi. You’ll find documentation about installation and configuration inside it.