Julia's documentation is written in reStructuredText, a good reference for which is the Documenting Python chapter of the Python Developer's Guide.
The documentation is built using Sphinx and LaTeX. On ubuntu, you'll need the following packages installed:
latex-cjk-all
texlive
texlive-lang-cjk
texlive-latex-extra
On OS X, you can install MacTex using the GUI installer
Build the documentation by running
$ make html
$ make latexpdf
conf.py Sphinx configuration
stdlib/ Julia standard library documentation
UNDOCUMENTED.rst Undocumented functions (to be filled in and copied to
the correct location in stdlib/)
The extensions to Sphinx and the theme are in the https://github.com/JuliaLang/JuliaDoc repository, and can also be used to style package documentation.