|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | + |
| 4 | +import sys |
| 5 | +import os |
| 6 | +import re |
| 7 | + |
| 8 | +sys.path.append(os.path.abspath('.')) |
| 9 | +sys.path.append(os.path.abspath('..')) |
| 10 | +sys.path.append(os.path.abspath('./demo/')) |
| 11 | + |
| 12 | +from sphinx.locale import _ |
| 13 | + |
| 14 | + |
| 15 | +project = "domdf_python_tools" |
| 16 | +from domdf_python_tools import __author__, __version__, __copyright__ |
| 17 | + |
| 18 | + |
| 19 | +slug = re.sub(r'\W+', '-', project.lower()) |
| 20 | +version = __version__ |
| 21 | +release = __version__ |
| 22 | +author = __author__ |
| 23 | +copyright = __copyright__ |
| 24 | +language = 'en' |
| 25 | + |
| 26 | +extensions = [ |
| 27 | + 'sphinx.ext.intersphinx', |
| 28 | + 'sphinx.ext.autodoc', |
| 29 | + 'sphinx.ext.mathjax', |
| 30 | + 'sphinx.ext.viewcode', |
| 31 | + 'sphinxcontrib.httpdomain', |
| 32 | +] |
| 33 | + |
| 34 | +templates_path = ['_templates'] |
| 35 | +source_suffix = '.rst' |
| 36 | +exclude_patterns = [] |
| 37 | + |
| 38 | +master_doc = 'index' |
| 39 | +suppress_warnings = ['image.nonlocal_uri'] |
| 40 | +pygments_style = 'default' |
| 41 | + |
| 42 | +intersphinx_mapping = { # Is this where those mystery links are specified? |
| 43 | + 'rtd': ('https://docs.readthedocs.io/en/latest/', None), |
| 44 | + 'sphinx': ('http://www.sphinx-doc.org/en/stable/', None), |
| 45 | +} |
| 46 | + |
| 47 | +html_theme = 'sphinx_rtd_theme' |
| 48 | +html_theme_options = { |
| 49 | + 'logo_only': False, # True will show just the logo |
| 50 | +} |
| 51 | +html_theme_path = ["../.."] |
| 52 | +#html_logo = "logo/pyms.png" |
| 53 | +html_show_sourcelink = False # True will show link to source |
| 54 | + |
| 55 | +html_context = { |
| 56 | + # Github Settings |
| 57 | + "display_github": True, # Integrate GitHub |
| 58 | + "github_user": "domdfcoding", # Username |
| 59 | + "github_repo": "domdf_python_tools", # Repo name |
| 60 | + "github_version": "master", # Version |
| 61 | + "conf_py_path": "/", # Path in the checkout to the docs root |
| 62 | +} |
| 63 | + |
| 64 | +htmlhelp_basename = slug |
| 65 | + |
| 66 | +latex_documents = [ |
| 67 | + ('index', '{0}.tex'.format(slug), project, author, 'manual'), |
| 68 | +] |
| 69 | + |
| 70 | +man_pages = [ |
| 71 | + ('index', slug, project, [author], 1) |
| 72 | +] |
| 73 | + |
| 74 | +texinfo_documents = [ |
| 75 | + ('index', slug, project, author, slug, project, 'Miscellaneous'), |
| 76 | +] |
| 77 | + |
| 78 | + |
| 79 | +# Extensions to theme docs |
| 80 | +def setup(app): |
| 81 | + from sphinx.domains.python import PyField |
| 82 | + from sphinx.util.docfields import Field |
| 83 | + |
| 84 | + app.add_object_type( |
| 85 | + 'confval', |
| 86 | + 'confval', |
| 87 | + objname='configuration value', |
| 88 | + indextemplate='pair: %s; configuration value', |
| 89 | + doc_field_types=[ |
| 90 | + PyField( |
| 91 | + 'type', |
| 92 | + label=_('Type'), |
| 93 | + has_arg=False, |
| 94 | + names=('type',), |
| 95 | + bodyrolename='class' |
| 96 | + ), |
| 97 | + Field( |
| 98 | + 'default', |
| 99 | + label=_('Default'), |
| 100 | + has_arg=False, |
| 101 | + names=('default',), |
| 102 | + ), |
| 103 | + ] |
| 104 | + ) |
0 commit comments