Use sphinx for documentation

This commit is contained in:
Moritz Lipp 2014-04-08 19:56:31 +02:00
parent df25afd5ed
commit 8bd390d396
14 changed files with 144 additions and 8 deletions

5
.gitignore vendored
View File

@ -13,9 +13,12 @@ zathura.pc
gcov/
*.swp
version.h
doc/
./doc/_build
*.tmp
zathura.1
zathurarc.5
.version-checks/
dbus-interface-definitions.c
.ycm_extra_conf.py
.ropeproject
compile_commands.json

View File

@ -99,7 +99,6 @@ clean:
${PROJECT}-debug \
.depend \
${PROJECT}.pc \
doc \
version.h \
version.h.tmp \
dbus-interface-definitions.c \
@ -111,6 +110,7 @@ ifneq "$(wildcard ${RSTTOMAN})" ""
endif
$(QUIET)$(MAKE) -C tests clean
$(QUIET)$(MAKE) -C po clean
$(QUIET)$(MAKE) -C doc clean
${PROJECT}-debug: ${DOBJECTS}
$(ECHO) CC -o $@
@ -156,7 +156,7 @@ dist: clean build-manpages
$(QUIET)rm -rf ${PROJECT}-${VERSION}
doc:
$(QUIET)doxygen Doxyfile
$(QUIET)make -C doc
gcov: clean
$(QUIET)CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage" LDFLAGS="${LDFLAGS} -fprofile-arcs" ${MAKE} $(PROJECT)

3
README
View File

@ -31,6 +31,9 @@ WITH_MAGIC=0.
If you pass these flags as a command line argument to make, you have to ensure
to pass the same flags when executing the install target.
If you want to build zathuras documentation, please install all python
dependencies from the ./doc/requirements.txt file.
Installation
------------
To build and install zathura:

View File

@ -2,7 +2,7 @@
# General information
PROJECT_NAME = zathura
OUTPUT_DIRECTORY = ./doc/
OUTPUT_DIRECTORY = ./_build/doxygen/
OUTPUT_LANGUAGE = English
TAB_SIZE = 2
EXTRACT_ALL = YES
@ -16,15 +16,15 @@ WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
# Input files
INPUT =
EXCLUDE = ./tests
INPUT = ../
EXCLUDE = ./tests ./doc
FILE_PATTERNS = *.h *.c
RECURSIVE = YES
# Output files
GENERATE_HTML = YES
GENERATE_HTML = NO
GENERATE_LATEX = NO
GENERATE_RTF = NO
GENERATE_XML = NO
GENERATE_XML = YES
SOURCE_BROWSER = YES

28
doc/Makefile Normal file
View File

@ -0,0 +1,28 @@
# See LICENSE file for license and copyright information
#
include ../config.mk
include ../common.mk
include config.mk
ifeq ($(shell which $(SPHINX_BIN) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINX_BIN)' command was not found.)
endif
all: init html man
init:
$(QUIET)mkdir -p $(SPHINX_BUILDDIR)/
clean:
$(QUIET)rm -rf $(SPHINX_BUILDDIR)/
html: doxygen
$(QUIET)$(SPHINX_BIN) -b html $(SPHINX_OPTS) $(SPHINX_BUILDDIR)/html
man: doxygen
$(QUIET)$(SPHINX_BIN) -b man $(SPHINX_OPTS) $(SPHINX_BUILDDIR)/man
doxygen:
$(QUIET)$(DOXYGEN_BIN) Doxyfile
.PHONY: clean html man

2
doc/api/index.rst Normal file
View File

@ -0,0 +1,2 @@
API and Development
===================

53
doc/conf.py Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# See LICENSE file for license and copyright information
import sphinx_rtd_theme
# -- General configuration ------------------------------------------------
extensions = ['sphinx.ext.todo', 'breathe']
source_suffix = '.rst'
master_doc = 'index'
templates_path = ['_templates']
exclude_patterns = ['_build']
pygments_style = 'sphinx'
# -- Project configuration ------------------------------------------------
project = 'zathura'
copyright = '2014, pwmt.org'
version = '0.2.7'
release = '0.2.7'
# -- Options for HTML output ----------------------------------------------
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_static_path = ['_static']
htmlhelp_basename = 'zathuradoc'
# -- Options for manual page output ---------------------------------------
man_pages = [
('index', 'zathura', 'zathura Documentation', ['pwmt.org'], 1)
]
# -- Options for breathe ---------------------------------------
breathe_projects = { "zathura": "_build/doxygen/xml" }
breathe_default_project = "zathura"
breathe_build_directory = "_build"
breathe_projects_source = {
"zathura": "../"
}
breathe_domain_by_extension = {
"h" : "c",
"c" : "c"
}

7
doc/config.mk Normal file
View File

@ -0,0 +1,7 @@
# See LICENSE file for license and copyright information
SPHINX_BIN = sphinx-build
SPHINX_BUILDDIR = _build
SPHINX_OPTS = -d $(SPHINX_BUILDDIR)/doctrees .
DOXYGEN_BIN = doxygen

View File

@ -0,0 +1,2 @@
Configuration
=============

2
doc/faq.rst Normal file
View File

@ -0,0 +1,2 @@
FAQ
===

25
doc/index.rst Normal file
View File

@ -0,0 +1,25 @@
.. zathura documentation master file, created by
sphinx-quickstart on Tue Apr 8 18:33:05 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to zathura's documentation!
===================================
.. toctree::
:maxdepth: 2
:numbered:
installation/index
usage/index
configuration/index
api/index
faq
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -0,0 +1,2 @@
Installation
============

7
doc/requirements.txt Normal file
View File

@ -0,0 +1,7 @@
Jinja2==2.7.2
MarkupSafe==0.19
Pygments==1.6
Sphinx==1.2.2
breathe==1.2.0
docutils==0.11
sphinx-rtd-theme==0.1.6

2
doc/usage/index.rst Normal file
View File

@ -0,0 +1,2 @@
Usage
=====