Documentation Guidelines - Version 2.4.20

Documentation Guidelines

The Akka documentation uses reStructuredText as its markup language and is built using Sphinx.

§Sphinx

For more details see The Sphinx Documentation

§reStructuredText

For more details see The reST Quickref

§Sections

Section headings are very flexible in reST. We use the following convention in the Akka documentation:

  • # (over and under) for module headings
  • = for sections
  • - for subsections
  • ^ for subsubsections
  • ~ for subsubsubsections

§Cross-referencing

Sections that may be cross-referenced across the documentation should be marked with a reference. To mark a section use .. _ref-name: before the section heading. The section can then be linked with :ref:`ref-name`. These are unique references across the entire documentation.

For example:

  1. .. _akka-module:
  2.  
  3. #############
  4. Akka Module
  5. #############
  6.  
  7. This is the module documentation.
  8.  
  9. .. _akka-section:
  10.  
  11. Akka Section
  12. ============
  13.  
  14. Akka Subsection
  15. ---------------
  16.  
  17. Here is a reference to "akka section": :ref:`akka-section` which will have the
  18. name "Akka Section".

§Build the documentation

First install Sphinx. See below.

§Building

For the html version of the docs:

  1. sbt sphinx:generateHtml
  2.  
  3. open <project-dir>/akka-docs/target/sphinx/html/index.html

For the pdf version of the docs:

  1. sbt sphinx:generatePdf
  2.  
  3. open <project-dir>/akka-docs/target/sphinx/latex/AkkaJava.pdf
  4. or
  5. open <project-dir>/akka-docs/target/sphinx/latex/AkkaScala.pdf

§Installing Sphinx on OS X

Install Homebrew

Install Python with Homebrew:

  1. brew install python

Homebrew will automatically add Python executable to your $PATH and pip is a part of the default Python installation with Homebrew.

More information in case of trouble: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python

Install sphinx:

  1. pip install sphinx

Install BasicTeX package from: http://www.tug.org/mactex/morepackages.html

Add texlive bin to $PATH:

  1. export TEXLIVE_PATH=/usr/local/texlive/2016basic/bin/universal-darwin
  2. export PATH=$TEXLIVE_PATH:$PATH

Add missing tex packages:

  1. sudo tlmgr update --self
  2. sudo tlmgr install titlesec
  3. sudo tlmgr install framed
  4. sudo tlmgr install threeparttable
  5. sudo tlmgr install wrapfig
  6. sudo tlmgr install helvetic
  7. sudo tlmgr install courier
  8. sudo tlmgr install multirow
  9. sudo tlmgr install capt-of
  10. sudo tlmgr install needspace
  11. sudo tlmgr install eqparbox
  12. sudo tlmgr install environ
  13. sudo tlmgr install trimspaces

If you get the error "unknown locale: UTF-8" when generating the documentation the solution is to define the following environment variables:

  1. export LANG=en_US.UTF-8
  2. export LC_ALL=en_US.UTF-8