Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
License - MIT
# License - MIT

Copyright (c) 2017-2024 Mr. Walls

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PHONY: must_be_root cleanup

build:
$(QUIET)$(ECHO) "No need to build. Try make -f Makefile install"
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile text 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile html 2>/dev/null || true

init:
$(QUIET)$(ECHO) "$@: Done."
Expand Down Expand Up @@ -136,7 +136,7 @@ cleanup:

clean: cleanup
$(QUIET)rm -f test-results/junit.xml 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile clean 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile clean || true
$(QUIET)$(ECHO) "$@: Done."

must_be_root:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ make test-tox ; # runs the tox tests
make clean ; # cleans up for next test
```

# Documentation

For more details read the project [documentation](./docs/index).

# Next steps:

Like automation? Then integrate away, this template can take it!
Expand Down
56 changes: 35 additions & 21 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -c ../docs/ -v
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
SRCDIR = .
# change this to the directory you store python code in
PROJECT_DOC_SRC_DIR = "pythonrepo"

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help init clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -38,41 +41,52 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

init:
@ln -sf ../"$(PROJECT_DOC_SRC_DIR)" $(SRCDIR)/"$(PROJECT_DOC_SRC_DIR)"
@ln -sf ../tests $(SRCDIR)/tests 2>/dev/null || true
@ln -sf ../README.md $(SRCDIR)/README.md
@ln -sf ../LICENSE.md $(SRCDIR)/LICENSE.md

clean:
@-rm -rf $(BUILDDIR)/* 2>/dev/null || true
@-rm -rfRd $(SRCDIR)/apidocs/* 2>/dev/null || true
@-unlink $(SRCDIR)/README.md 2>/dev/null || true
@-unlink $(SRCDIR)/tests 2>/dev/null || true
@-unlink $(SRCDIR)/LICENSE.md 2>/dev/null || true
@-unlink $(SRCDIR)/"$(PROJECT_DOC_SRC_DIR)" 2>/dev/null || true

html:
html: init
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
dirhtml: init
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
singlehtml: init
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
pickle: init
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
json: init
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
htmlhelp: init
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
qthelp: init
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
Expand All @@ -81,7 +95,7 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sample.qhc"

devhelp:
devhelp: init
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
Expand All @@ -90,12 +104,12 @@ devhelp:
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sample"
@echo "# devhelp"

epub:
epub: init
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
latex: init
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
Expand All @@ -108,35 +122,35 @@ latexpdf:
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
text: init
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
man: init
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
texinfo: init
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
info: init
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
gettext: init
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
changes: init
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
Expand All @@ -147,7 +161,7 @@ linkcheck:
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
doctest: init
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
96 changes: 79 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,55 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

# import sys
# import os
import sys
import os
import argparse

# 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.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(1, os.path.abspath('./pythonrepo'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
needs_sphinx = '5.3'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# for md us 'autodoc2' (pip install sphinx-autodoc2)
# for rst use 'sphinx.ext.autodoc'
extensions = [
'sphinx.ext.napoleon', 'autodoc2', 'sphinx.ext.autosummary',
'sphinx.ext.githubpages',
'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.todo',
'sphinx.ext.linkcode', 'sphinx.ext.viewcode', 'myst_parser'
]

# for md auto-docs
autodoc2_packages = [
"pythonrepo",
"tests",
]

autodoc2_render_plugin = "myst"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.md'
source_suffix = {
'.md': 'markdown',
'.txt': 'markdown',
'.rst': 'restructuredtext',
}

# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The encoding of source files. Official sphinx docs reccomend utf-8-sig.
source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = 'toc'

# General information about the project.
project = u'python_template'
Expand All @@ -49,9 +70,9 @@
# built documents.
#
# The short X.Y version.
version = 'v1.1'
version = 'v2.0'
# The full version, including alpha/beta/rc tags.
release = 'v1.1.4'
release = 'v2.0.0-alpha'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -62,37 +83,44 @@
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
today_fmt = '%Y.%B.%d'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', 'tests']
exclude_patterns = ['_build', '.github', '.circleci', '.DS_Store', '**/.git', 'dist', 'tests']

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
add_module_names = True

# sigs should not have backslashes
strip_signature_backslash = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = False
show_authors = True

# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = 'py'
pygments_style = 'default'

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# Create table of contents entries for domain objects (e.g. functions, classes, attributes, etc.).
toc_object_entries = True

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'sphinxawesome_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -107,7 +135,7 @@
# html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
html_short_title = 'Project Docs'

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand All @@ -118,6 +146,8 @@
# pixels large.
# html_favicon = None

html_permalinks_icon = '<span>#</span>'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down Expand Up @@ -168,6 +198,29 @@
htmlhelp_basename = 'python_repo_doc'


# -- Options for MyST markdown parser -------------------------------------------
# see https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#syntax-directives

# be more like GFM with style
myst_enable_extensions = set(['tasklist', 'strikethrough', 'fieldlist'])

# for GFM diagrams and interoperability with other Markdown renderers
myst_fence_as_directive = set(('mermaid', 'suggestion', 'note'))

# Focus only on github markdown
myst_gfm_only = False


#heading_anchors = 1

# -- Options for napoleon ext --------------------------------------------------

# include __init__ when it has docstrings
napoleon_include_init_with_doc = True

# try to be smarter
napoleon_preprocess_types = True

# -- Options for LaTeX output --------------------------------------------------

latex_elements = {}
Expand Down Expand Up @@ -257,3 +310,12 @@

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'

# -- Link resolver -------------------------------------------------------------
def linkcode_resolve(domain, info):
if domain != 'py':
return None
if not info['module']:
return None
filename = info['module'].replace('.', '/')
return "https://github.com/reactive-firewall/python-repo/blob/stable/%s.py" % filename
Loading
Loading