Getting started
Before you can get started with documenting your code and generating a beautiful website for it, you first need to install cldoc. This is a fairly simple process, and the instructions below should allow you to install cldoc in a few minutes.
Before you start, make sure you have at least libclang 3.9
installed on your system. Most recent distributions ship packages of recent
enough libclang.
1. Installing using pip
cldoc is avaible at the Python Package Index.
This is by far the easiest way to install cldoc. Make sure you have pip
installed (install python-pip on ubuntu and fedora) Simply use
pip install --user cldoc (you might need to use the python-pip command instead
on fedora). The --user will install cldoc locally in ~/.local. If you want
to install it globally in your system, use sudo pip install cldoc instead.
2. Installing from source
First checkout the latest source from git. cldoc itself is written in python, so you will also need that installed (all systems normally already have it installed). cldoc works with either python 2.7 or python3 as of version 1.11.
Runtime dependencies when installing from source
The only additional runtime dependency besides libclang is the pyparsing
python library. You can get it from your distribution, or use
pip install pyparsing.
cldoc by default generates a dynamic site, but can also optionally generate a static site instead. To generate a static site, you need to install the cldoc-static npm module (npm install -g cldoc-static).
Build dependencies
- coffeescript compiler
- sass compiler
- inline-source
These build dependencies are used to generate the html webapp which renders
the documentation generated by cldoc. All dependencies can be installed via
npm (using npm install).
After the requirements are installed, first run python setup.py generate to
generate the webapp. After that simply run python setup.py install to
install cldoc. Note that if you have used npm to install coffeescript and
sass locally (i.e. in node_modules/), use:
python setup.py generate \
--coffee=node_modules/.bin/coffee \
--sass=node_modules/.bin/node-sass
or something similar depending on where they actually got installed. You only
need to do this if the coffee and node-sass executables are not in
your $PATH.
Installation completed
After following these steps you should have successfully installed cldoc! Continue to Documenting code or directly to Generating site.