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:
python-sphinx
texlive
texlive-latex-extra
Then run
$ make helpdb.jl
$ make html
$ make latexpdf
conf.py Sphinx configuration
helpdb.jl REPL help database
stdlib/ Julia standard library documentation
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.