diff --git a/.gitignore b/.gitignore index 4fdda19..3288eef 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index 9f3c0ba..3600061 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/README b/README index 04bf619..fbdb441 100644 --- a/README +++ b/README @@ -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: diff --git a/Doxyfile b/doc/Doxyfile similarity index 80% rename from Doxyfile rename to doc/Doxyfile index f52ac20..632180a 100644 --- a/Doxyfile +++ b/doc/Doxyfile @@ -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 diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..731e659 --- /dev/null +++ b/doc/Makefile @@ -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 diff --git a/doc/api/index.rst b/doc/api/index.rst new file mode 100644 index 0000000..8feb527 --- /dev/null +++ b/doc/api/index.rst @@ -0,0 +1,2 @@ +API and Development +=================== diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000..763487d --- /dev/null +++ b/doc/conf.py @@ -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" +} diff --git a/doc/config.mk b/doc/config.mk new file mode 100644 index 0000000..553c28c --- /dev/null +++ b/doc/config.mk @@ -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 diff --git a/doc/configuration/index.rst b/doc/configuration/index.rst new file mode 100644 index 0000000..6e79ebd --- /dev/null +++ b/doc/configuration/index.rst @@ -0,0 +1,2 @@ +Configuration +============= diff --git a/doc/faq.rst b/doc/faq.rst new file mode 100644 index 0000000..cde88d8 --- /dev/null +++ b/doc/faq.rst @@ -0,0 +1,2 @@ +FAQ +=== diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000..025df07 --- /dev/null +++ b/doc/index.rst @@ -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` + diff --git a/doc/installation/index.rst b/doc/installation/index.rst new file mode 100644 index 0000000..11e4437 --- /dev/null +++ b/doc/installation/index.rst @@ -0,0 +1,2 @@ +Installation +============ diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..f70a534 --- /dev/null +++ b/doc/requirements.txt @@ -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 diff --git a/doc/usage/index.rst b/doc/usage/index.rst new file mode 100644 index 0000000..d4b9a15 --- /dev/null +++ b/doc/usage/index.rst @@ -0,0 +1,2 @@ +Usage +=====