You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
eng
libcxx
libcxxabi
libunwind
lld
COFF
Common
ELF
MinGW
cmake
docs
_static
_templates
llvm-theme
AtomLLD.rst
CMakeLists.txt
Driver.rst
NewLLD.rst
README.txt
Readers.rst
ReleaseNotes.rst
WebAssembly.rst
conf.py
design.rst
development.rst
getting_started.rst
hello.png
index.rst
make.bat
open_projects.rst
sphinx_intro.rst
windows_support.rst
include
lib
test
tools
unittests
utils
wasm
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
LICENSE.TXT
README.md
lldb
llvm
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
128 lines
4.1 KiB
ReStructuredText
128 lines
4.1 KiB
ReStructuredText
![]() |
.. _sphinx_intro:
|
||
|
|
||
|
Sphinx Introduction for LLVM Developers
|
||
|
=======================================
|
||
|
|
||
|
This document is intended as a short and simple introduction to the Sphinx
|
||
|
documentation generation system for LLVM developers.
|
||
|
|
||
|
Quickstart
|
||
|
----------
|
||
|
|
||
|
To get started writing documentation, you will need to:
|
||
|
|
||
|
1. Have the Sphinx tools :ref:`installed <installing_sphinx>`.
|
||
|
|
||
|
2. Understand how to :ref:`build the documentation
|
||
|
<building_the_documentation>`.
|
||
|
|
||
|
3. Start :ref:`writing documentation <writing_documentation>`!
|
||
|
|
||
|
.. _installing_sphinx:
|
||
|
|
||
|
Installing Sphinx
|
||
|
~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
You should be able to install Sphinx using the standard Python package
|
||
|
installation tool ``easy_install``, as follows::
|
||
|
|
||
|
$ sudo easy_install sphinx
|
||
|
Searching for sphinx
|
||
|
Reading http://pypi.python.org/simple/sphinx/
|
||
|
Reading http://sphinx.pocoo.org/
|
||
|
Best match: Sphinx 1.1.3
|
||
|
... more lines here ..
|
||
|
|
||
|
If you do not have root access (or otherwise want to avoid installing Sphinx in
|
||
|
system directories) see the section on :ref:`installing_sphinx_in_a_venv` .
|
||
|
|
||
|
If you do not have the ``easy_install`` tool on your system, you should be able
|
||
|
to install it using:
|
||
|
|
||
|
Linux
|
||
|
Use your distribution's standard package management tool to install it,
|
||
|
i.e., ``apt-get install easy_install`` or ``yum install easy_install``.
|
||
|
|
||
|
Mac OS X
|
||
|
All modern Mac OS X systems come with ``easy_install`` as part of the base
|
||
|
system.
|
||
|
|
||
|
Windows
|
||
|
See the `setuptools <http://pypi.python.org/pypi/setuptools>`_ package web
|
||
|
page for instructions.
|
||
|
|
||
|
|
||
|
.. _building_the_documentation:
|
||
|
|
||
|
Building the documentation
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
In order to build the documentation need to add ``-DLLVM_ENABLE_SPHINX=ON`` to
|
||
|
your ``cmake`` command. Once you do this you can build the docs using
|
||
|
``docs-lld-html`` build (``ninja`` or ``make``) target.
|
||
|
|
||
|
That build target will invoke ``sphinx-build`` with the appropriate options for
|
||
|
the project, and generate the HTML documentation in a ``tools/lld/docs/html``
|
||
|
subdirectory.
|
||
|
|
||
|
.. _writing_documentation:
|
||
|
|
||
|
Writing documentation
|
||
|
~~~~~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
The documentation itself is written in the reStructuredText (ReST) format, and
|
||
|
Sphinx defines additional tags to support features like cross-referencing.
|
||
|
|
||
|
The ReST format itself is organized around documents mostly being readable
|
||
|
plaintext documents. You should generally be able to write new documentation
|
||
|
easily just by following the style of the existing documentation.
|
||
|
|
||
|
If you want to understand the formatting of the documents more, the best place
|
||
|
to start is Sphinx's own `ReST Primer <http://sphinx.pocoo.org/rest.html>`_.
|
||
|
|
||
|
|
||
|
Learning More
|
||
|
-------------
|
||
|
|
||
|
If you want to learn more about the Sphinx system, the best place to start is
|
||
|
the Sphinx documentation itself, available `here
|
||
|
<http://sphinx.pocoo.org/contents.html>`_.
|
||
|
|
||
|
|
||
|
.. _installing_sphinx_in_a_venv:
|
||
|
|
||
|
Installing Sphinx in a Virtual Environment
|
||
|
------------------------------------------
|
||
|
|
||
|
Most Python developers prefer to work with tools inside a *virtualenv* (virtual
|
||
|
environment) instance, which functions as an application sandbox. This avoids
|
||
|
polluting your system installation with different packages used by various
|
||
|
projects (and ensures that dependencies for different packages don't conflict
|
||
|
with one another). Of course, you need to first have the virtualenv software
|
||
|
itself which generally would be installed at the system level::
|
||
|
|
||
|
$ sudo easy_install virtualenv
|
||
|
|
||
|
but after that you no longer need to install additional packages in the system
|
||
|
directories.
|
||
|
|
||
|
Once you have the *virtualenv* tool itself installed, you can create a
|
||
|
virtualenv for Sphinx using::
|
||
|
|
||
|
$ virtualenv ~/my-sphinx-install
|
||
|
New python executable in /Users/dummy/my-sphinx-install/bin/python
|
||
|
Installing setuptools............done.
|
||
|
Installing pip...............done.
|
||
|
|
||
|
$ ~/my-sphinx-install/bin/easy_install sphinx
|
||
|
... install messages here ...
|
||
|
|
||
|
and from now on you can "activate" the *virtualenv* using::
|
||
|
|
||
|
$ source ~/my-sphinx-install/bin/activate
|
||
|
|
||
|
which will change your PATH to ensure the sphinx-build tool from inside the
|
||
|
virtual environment will be used. See the `virtualenv website
|
||
|
<http://www.virtualenv.org/en/latest/index.html>`_ for more information on using
|
||
|
virtual environments.
|