{section: Read the Docs Overview} In 2019 we migrated the HTCondor Manual from our old LaTeX format into the Sphinx documentation generator using the reStructuredText format. We will also be hosting it on Read the Docs. The manual can be found here: http://htcondor.readthedocs.io {section: Prerequisites} 1: Install Python. Any version is fine. *::https://www.python.org/downloads 1: Install Sphinx. The recommended way to install Sphinx is via pip: {code} sudo pip install sphinx sphinx_rtd_theme {endcode} On RHEL and CentOS *we do not support* installing Sphinx from yum or RPM. The available package is an old version which does not support all our extensions. For other Linux distributions, Windows and macOS, you can find instructions here: *::https://www.sphinx-doc.org/en/master/usage/installation.html 1: Install the HTCondor Python bindings. This could be via =pip= (make sure you get the right version, e.g. =pip install htcondor==8.8.1=), or by editing your =PYTHONPATH= environment variable to point at the =.so= files inside your HTCondor install. Note: on RTD itself, the docs are built using the =htcondor= version specified in =docs/requirements.txt=. 1: [Optional] Install python-docutils. This is only needed if you want to generate man pages for the manual: {code} sudo yum install python-docutils {endcode} 1: [Optional] Install https://pypi.org/project/sphinx-autobuild/. This is useful if you're making lots of quick edits to the manual and expect to build it many times. {code} pip install sphinx-autobuild {endcode} See below for instructions on using =sphinx-autobuild=. {section: Building} {subsection: Building and previewing the manual locally} *:: The manual pages exist in our git repository under the =/docs= folder *:: Each top-level section of the manual has a corresponding subdirectory with the same name. For example, all the content for "Overview" is under =/docs/overview=, the content for "User's Manual" is under =/docs/users-manual=, and so on. *:: Each page of the manual has a corresponding file with the same name and a .rst extension. For example, the content for the "Overview > Exceptional Features" page is in =/docs/overview/exceptional-features.rst= *:: To make a local build of the manual, go to your =/docs= folder and run: {code} make html {endcode} *:: To preview your build, open a web browser and go to the following URL: =file:////docs/_build/html/index.html= *:: To clean your local build, go to your =/docs= folder and run: {code} make clean {endcode} {subsection: Using sphinx-autobuild to build and preview} Instead of the instructions in the previous section, go to =/docs= and run {code} sphinx-autobuild . _build/html {endcode} You will see a log of the Sphinx build running, and eventually will be provided a link to a =localhost= webserver hosting the docs. Leave this program running: =sphinx-autobuild= will watch the docs source tree for changes and rebuild when it detects changes (you will still need to manually reload the page inside your web browser). {subsection: Different versions of the manual} *:: Read the Docs allows us to host multiple versions of the manual. We'll have two separate versions: "latest" (equivalent to Development Release) and "stable" (equivalent to Stable Release). *:: To make edits to the latest version, make your changes on the *master* branch. *:: To make edits to the stable version, make your changes to the *V8_8-branch* (or the appropriate *V8_8_X-branch* if making your changes after code freeze) {section: Editing} The manual now uses the reStructuredText (rST) format, which is similar to Markdown markup but considerably more powerful. A helpful reference to reStructuredText is available here: http://docutils.sourceforge.net/docs/user/rst/quickref.html In addition, the new manual also uses the Sphinx documentation generator. Sphinx does many useful things such as: *:: Converts reStructuredText files into HTML websites, PDF, EPUB and man pages. *:: Extends rST to provide more complex inline widgets such as tables of contents, syntax-colored code blocks, internal links and references, *:: Automatic indices, search and language-specific module indices *:: Provides a powerful API for writing custom extensions A full Sphinx reference is available here: http://www.sphinx-doc.org/en/master/contents.html This section provides some markup style guidelines, as well as information about how we use both built-in and custom tools. {subsection: Section Titles} Section titles are very fluid in rST and there are many different ways to make them. To keep things as consistent as possible, please use the following: {code} Page titles get underlined with the = symbol ============================================ Section titles get underlined with the - symbol ----------------------------------------------- Subsection titles get underlined with the ' symbol '''''''''''''''''''''''''''''''''''''''''''''''''' {endcode} {subsection: Indentation} The rST format is very sensitive to indentation. Paragraphs and other blocks of text are expected to be left-aligned. Indenting a block by any amount of whitespace (compared to the preceding block) causes it to get indented. {code} This is a top-level block of text. It will appear aligned to the left-most side of the page. This paragraph is indented by one space. Even though it's only a single space, it will render as a full first-level indent. This paragraph is indented by one more space than the one above it. As a result it will render as a second-level indent. This time I've indented a block by two more spaces the one above it. It doesn't matter that this is inconsistent with the single-space indents above. This block will render as a third-level indent. Back to the top level! This block is indented by 12 spaces. However, as with the previous examples, the amount of whitespace doesn't matter. Because it's the first indented block compared to the preceding block, it will only render as a first-level indent. {endcode} {subsection: Linking to gittrac tickets} Use the following syntax to automatically link to a gittrac ticket, where #### is the number of the ticket: {code} :ticket:`####` {endcode} {subsection: Adding index entries} To add a basic index entry, use the following syntax: {code} :index:`Name of index entry` {endcode} If you want your index entry to appear under a parent entry, the syntax is a little more complicated: {code} :index:`Name of index entry ` {endcode} {section: Publishing} {subsection: Publishing the manual onto Read the Docs} *:: Currently Mark or Josh has to login to Read the Docs to manually push any changes. *:: Before we go live in May 2019, we'll set up a webhook in our git repository. This will cause any changes to get pushed automatically. {subsection: Generating man pages} *:: The files in =/docs/man-pages= will be the official source for our man pages going forward. *:: You can use the =rst2man= utility (included in the =python-docutils= package mentioned above) to convert these .rst files into man pages, for example: {code} rst2man /docs/man-pages/condor_submit.rst /usr/share/man/man1/condor_submit.1 {endcode}