Documentation files to be linked under the docs/sphinx directory of
http://github.com/openmicroscopy/openmicroscopy.
.. image:: https://travis-ci.org/openmicroscopy/ome-documentation.png
:target: http://travis-ci.org/openmicroscopy/ome-documentation
Getting Started With Sphinx
Sphinx depends on the sphinx-build Python script. As such, it can be
installed on any system with a working Python installation and PIP. On
Windows, make sure that the Scripts directory under the Python
installation directory (e.g. C:\Python26\Scripts) is configured in your
PATH. On OS X/Linux, sphinx-build has to be accessible from the command
line.
The Sphinx documentation system can be obtained by issuing::
pip install Sphinx
The OME documentation is organized into multiple folders:
omero folder,formats folder,common folder.The structure of each documentation folder follows the Sphinx system
guidelines. A quick overview:
images,downloads,_build,_static,conf.py,make and make.bat are held in Makefile.A reference of reStructuredText (reST) is available athttp://thomas-cokelaer.info <http://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html>_.
It is recommended to familiarise oneself with the syntax outlined there.
A tutorial covering Sphinx, which enhances working with reST documents, can be
found at http://sphinx.pocoo.org <http://sphinx.pocoo.org/tutorial.html>_.
To build a set of documentation, first move to the documentation folder. To
build the OMERO documentation::
cd omero/
or to build the OME Model and Formats documentation::
cd formats/
To clean the build directory of any previous builds, use::
make clean
To build the documentation locally in the form of HTML pages, use::
make html
To check the links (internal and external) of the documentation, use::
make linkcheck
To list all targets of the sphinx builder, use::
make
The output should look something like::
Please use `make <target>' where <target> is one of
html to make standalone HTML files
dirhtml to make HTML files named index.html in directories
singlehtml to make a single large HTML file
pickle to make pickle files
json to make JSON files
htmlhelp to make HTML files and a HTML help project
qthelp to make HTML files and a qthelp project
devhelp to make HTML files and a Devhelp project
epub to make an epub
latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
latexpdf to make LaTeX files and run them through pdflatex
text to make text files
man to make manual pages
texinfo to make Texinfo files
info to make Texinfo files and run them through makeinfo
gettext to make PO message catalogs
changes to make an overview of all changed/added/deprecated items
linkcheck to check all external links for integrity
doctest to run all doctests embedded in the documentation (if
enabled)
The top-level directory Makefile also defines targets for building the OMERO
and the OME Model and Formats sets of documentation at once. Note that the
following commands currently work under UNIX-like platforms only.
To clean the build directories of any previous builds, use::
make clean
To build the sets of documentation locally in the form of HTML pages, use::
make html
To build the sets of documentation locally in the form of a PDF file, use::
make latexpdf
Additional options for sphinx-build can be passed using the SPHINXOPTS
variable. The -W option turns all warnings into errors::
SPHINXOPTS=-W make clean html
The release number of each set of documentation is UNKNOWN by default. To
modify this value:
for the OMERO documentation, set the environment variable OMERO_RELEASE,
e.g.::
cd omero && OMERO_RELEASE=4.4.6 make clean html
for the OME Model and Formats documentation, set the environment variableFORMATS_RELEASE, e.g.::
cd formats && FORMATS_RELEASE=2012-06 make clean html
Conventions Used
Part of the conventions used here is based on work byBenoît Bryon <https://github.com/benoitbryon/documentation-style-guide-sphinx>_.
reST source file names should carry the txt suffix and use lowercase
alphanumeric characters and the - (minus) symbol.
Most reST directives don't need indentation, unless contents or options have
to be supplied. For consistency, please use 4 space indentation whenever
needed. Do not use indentation for the start of directives (start them at the
edge of the new line). Any content under a reST directive has to be indented
the same way as the options.
Example::
.. toctree::
:maxdepth: 2
Some content here...
reST source files should use 78 lines for wrapping text. Please consult the
manual of your favourite text editor to see how to switch on text wrapping.
Two new lines should be put before top-lined, top-level section names, i.e.
before H1 and H2. One new line in any other case.
Example::
###############
Part title (H1)
###############
Introduction text.
(blank)
(blank)
******************
Chapter title (H2)
******************
Every reST source file should begin with an H2 (level two) title. H1 titles
are reserved for the index files (index.txt).
The following symbols should be used to create headings:
# with top line for parts* with top line for chapters= for sections- for subsections^ for subsubsections" for paragraphsExample::
###############
Part Title (H1)
###############
H1 only in indexes.
******************
Chapter Title (H2)
******************
Sample file content.
********************
Another chapter (H2)
********************
Section title (H3)
==================
Subsection title (H4)
---------------------
Subsubsection title (H5)
^^^^^^^^^^^^^^^^^^^^^^^^
Paragraph title (H6)
""""""""""""""""""""
And some text.
Every page can be uniquely referenced using the sphinx doc directive. Like
other directives, you can use the absolute file path, i.e. relative to the
top-level directory::doc: `/path/name-of-the-page``` or :doc: `link to my page </path/name-of-the-page>```.
Only when a good reason exists, a document can also start with a label::
.. _page-label:
Title Of The Page
=================
Use of labels to refer to whole files is discouraged. References to labels
above tables and images are encouraged. The :ref: Sphinx role is advised
over standard reST links, as it works across files and reference names are
automatically generated (e.g. from caption of an image).
reST allows for two types of image embedding: using the image andfigure directive. It is recommended to use the latter, as legends and
captions can be added easier.
All images referenced in a reST document shall be placed in an images
folder in the top-level directory of the documentation.
Please do not use relative (../../../images/foo.jpg) paths to refer to
images. Sphinx does a good job at creating paths, so one can use/images/foo.jpg
Please do not use tables for collections of links and figures, and leave them
solely for use as actual tables. While it can be used in HTML to shoehorn
content into boxes, it doesn't work too well for other output, e.g. latex.
Big tables (typically wider than 50 characters) should be managed as external
files using the comma-separated values (CSV) format. These tables can then be
included in the documentation with the csv-table directive. If tables are
saved using the tab-separated values (TSV) format use the delim option to
set the table delimiter to tab e.g.::
.. csv-table::
:widths: 20 80
:header-rows: 1
:file: searchfieldnames.tsv
:delim: tab
To control the column width in the LaTeX output, precede the table directive
with tabularcolumns, e.g.::
.. tabularcolumns:: |p{3.5cm}|p{12cm}|
reST allows for using substitutions in cases where a piece of markup is used
more than once, e.g.::
Please visit Python.org_
...
.. _Python.org: http://python.org
If a hyperlink appears only once, please use anonymous, "one-off" hyperlinks
(two underscores)::
`RFC 2396 <http://www.rfc-editor.org/rfc/rfc2396.txt>`__ and `RFC
2732 <http://www.rfc-editor.org/rfc/rfc2732.txt>`__ together
define the syntax of URIs.
Finally, please avoid using here as the hyperlink name, as in::
(...) go `here <http://www.google.com>`_.
Please try to follow the rules outlined inInline Markup <http://sphinx-doc.org/markup/inline.html>_. This allows for
improving the semantics of the document elements.
.. note::.. glossary::. Each definition can be referenced anywhere in:term: role and an entry will be added for.. seealso:::envvar: role.:omerocmd: `admin start``` This role will render as omero admin start`` and add an entry for:option: and :guilabel:Some substitutions have been implemented using rst_epilog in conf.py.
They can be used in all pages of the documentation.
The table below lists targets for common hyperlinks.
=========================== ==============================================
Target name Link
=========================== ==============================================
Python http://python.org
Matplotlib http://matplotlib.org/
Python Imaging Library http://www.pythonware.com/products/pil/
Hibernate http://www.hibernate.org
ZeroC http://www.zeroc.com
Ice http://www.zeroc.com
Jenkins http://jenkins-ci.org
roadmap https://trac.openmicroscopy.org.uk/ome/roadmap
Open Microscopy Environment http://www.openmicroscopy.org/site
Glencoe Software, Inc. http://www.glencoesoftware.com/
=========================== ==============================================
The table below lists substitutions for common abbreviations. These
substitutions use the :abbr: Sphinx role meaning they are shown as
tool-tip in HTML and output only once in LaTeX.
======= ============= ======================
Name Abbreviation Explanation
======= ============= ======================
|SSH| SSH Secure Shell
|VM| VM Virtual Machine
|OS| OS Operating System
|SSL| SSL Secure Socket Layer
|HDD| HDD Hard Disk Drive
|CLI| CLI Command Line Interface
======= ============= ======================
The table below lists substitutions that can be used to create references to
sections of the OMERO documentation.
================== ===========================
Name Path
================== ===========================
|OmeroPy| developers/Python
|OmeroCpp| developers/Cpp
|OmeroJava| developers/Java
|OmeroMatlab| developers/Matlab
|OmeroApi| developers/Modules/Api
|OmeroWeb| developers/Web
|OmeroClients| developers/GettingStarted
|OmeroGrid| sysadmins/grid
|OmeroSessions| developers/Server/Sessions
|OmeroModel| developers/Model
|ExtendingOmero| developers/ExtendingOmero
|BlitzGateway| developers/Python
================== ===========================
For the most up-to-date list, please consult conf.py (sectionrst_epilog).
Some URLs are widely used across the OME documentation. Using the Sphinxextlinks extension, a dictionary of aliases to base URLs has been defined
for the following:
:ticket: `3442```, displayed as #3442``For the most up-to-date list, please consult conf.py (sectionextlinks).
Links to the OMERO source code hosted on Github can be created using thesource alias for single files, e.g. :source: `etc/omero.properties``` or the sourcediralias for directories, e.g.:sourcedir: `etc```.
By default, these links will point at the code under the develop branch or
https://github.com/openmicroscopy/openmicroscopy. To specify a specific fork
and/or branch, set the SOURCE_USER and SOURCE_BRANCH environment variables,
e.g.::
SOURCE_USER=sbesson SOURCE_BRANCH=my_branch make clean html
Links to the continuous integration server can be created using thejenkins alias for the main server, e.g. :jenkins: `Jenkins server <>```, the jenkinsjobalias for a given job, e.g.:jenkinsjob: OMERO-4.4``` or the ``jenkinsview`` alias for a given view, e.g. ``:jenkinsview: 4.4. Two aliases have been defined for the main OMERO job: ``omerojob`` and ``javadoc`` for the generated Javadoc, e.g. ``:javadoc:`main page <>.
By default, the OMERO job is set to OMERO-trunk. To specify a different
job, set the JENKINS_JOB environment variables, e.g.::
JENKINS_JOB=OMERO-4.4 make clean html
Links to the OME mailing lists can be created using the mailinglist alias,
e.g. :mailinglist:`ome-users/```. To point at specific discussion threads, two aliases have been defined ome-usersandome-devel, e.g. :ome-users:`ome-users thread <2009-June/001839.html>```.
When a specific type of content (e.g. code snippet) repeats itself among many
pages, it is advised to store it in a seperate file without the default.txt extension. This file can then be later included using theliteralinclude directive.
Writing Conventions