Installing Custom Directives¶
Docutils¶
For installation to use with the standards docutils tools, follow the directions available available at the docutils site.
Sphinx¶
Installation for use with Sphinx is as simple as ensuring the directive is available on the PYTHONPATH and registering it within the Sphinx project’s conf.py. For example:
# extract from conf.py for this Sphinx project
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
sys.path.append(os.path.abspath("../.."))
from csvftable import CSVFTable
from docutils.parsers.rst import directives
directives.register_directive('csvftable', CSVFTable)