From 9ed3a19a8e0a94f8f1dadfe403d32132a8089dd2 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 14 Jul 2017 10:44:57 +0100 Subject: [PATCH] Update docs config Add epub output, fix PDF output to include page-numbers in links (for printed output), reduce the (now ridiculous) length of the ToC by dropping it to one level, add numbering to chapters --- Makefile | 1 + docs/conf.py | 20 ++++++++++++++++---- docs/index.rst | 11 ++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index dae7b25..4d7961c 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,7 @@ install: $(SUBDIRS) doc: $(DOC_SOURCES) $(MAKE) -C docs clean $(MAKE) -C docs html + $(MAKE) -C docs epub $(MAKE) -C docs latexpdf source: $(DIST_TAR) $(DIST_ZIP) diff --git a/docs/conf.py b/docs/conf.py index 259796e..fbbe280 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -89,8 +89,8 @@ else: html_theme = 'default' #html_theme_options = {} #html_sidebars = {} +html_title = '%s %s Documentation' % (project, version) #html_theme_path = [] -#html_title = None #html_short_title = None #html_logo = None #html_favicon = None @@ -119,7 +119,7 @@ htmlhelp_basename = '%sdoc' % _setup.__project__ latex_elements = { 'papersize': 'a4paper', 'pointsize': '10pt', - #'preamble': '', + 'preamble': r'\def\thempfootnote{\arabic{mpfootnote}}', # workaround sphinx issue #2530 } latex_documents = [ @@ -129,16 +129,28 @@ latex_documents = [ '%s Documentation' % project, # title _setup.__author__, # author 'manual', # documentclass + True, # documents ref'd from toctree only ), ] #latex_logo = None #latex_use_parts = False -#latex_show_pagerefs = False -#latex_show_urls = False +latex_show_pagerefs = True +latex_show_urls = 'footnote' #latex_appendices = [] #latex_domain_indices = True +# -- Options for epub output ---------------------------------------------- + +epub_basename = _setup.__project__ +#epub_theme = 'epub' +#epub_title = html_title +epub_author = _setup.__author__ +epub_identifier = 'https://gpiozero.readthedocs.io/' +#epub_tocdepth = 3 +epub_show_urls = 'no' +#epub_use_index = True + # -- Options for manual page output --------------------------------------- man_pages = [] diff --git a/docs/index.rst b/docs/index.rst index ad2fa6e..f2deb81 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,8 @@ Table of Contents ================= .. toctree:: - :maxdepth: 2 + :maxdepth: 1 + :numbered: recipes notes @@ -28,3 +29,11 @@ Table of Contents development changelog license + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` +