diff --git a/.config/dictionary.txt b/.config/dictionary.txt index 42c71e5..c29c41f 100644 --- a/.config/dictionary.txt +++ b/.config/dictionary.txt @@ -11,6 +11,7 @@ argvalues astimezone autorefs basesystem +BUILDDIR caplog cliconf # Ansible network cli abstraction plugin codeclimate @@ -100,6 +101,7 @@ premanent pullable pymdown pymdownx +quickstart redhatinsights Regset representer @@ -122,6 +124,9 @@ SIGTERM SKEL smartquotes somevalue +SOURCEDIR +SPHINXBUILD +SPHINXOPTS statemachine stripspaces subaction @@ -141,6 +146,7 @@ testns testorg testpaths tmplt +toctree topbar topdown Towncrier # Changelog generator diff --git a/.config/requirements-doc.txt b/.config/requirements-doc.txt new file mode 100644 index 0000000..6f43f93 --- /dev/null +++ b/.config/requirements-doc.txt @@ -0,0 +1,3 @@ +sphinx +myst-parser +sphinx-ansible-theme diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..1623a37 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,23 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +python: + install: + - method: pip + path: . + + - requirements: .config/requirements-doc.txt diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/source/__init__.py b/docs/source/__init__.py new file mode 100644 index 0000000..6e03199 --- /dev/null +++ b/docs/source/__init__.py @@ -0,0 +1 @@ +# noqa: D104 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..5a64126 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,51 @@ +# Configuration file for the Sphinx documentation builder. # noqa: D100 +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# 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. +# +# import os # noqa: ERA001 +# import sys # noqa: ERA001 +# sys.path.insert(0, os.path.abspath('.')) # noqa: ERA001 + + +# -- Project information ----------------------------------------------------- + +PROJECT = "Ansible Creator" +COPYRIGHT = "2023, Ansible" +AUTHOR = "Ansible" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ["myst_parser", "sphinx.ext.duration", "sphinx_ansible_theme"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- 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 = "sphinx_ansible_theme" # pylint: disable=invalid-name + +# 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". +html_static_path = ["_static"] diff --git a/docs/source/index.md b/docs/source/index.md new file mode 100644 index 0000000..af8f856 --- /dev/null +++ b/docs/source/index.md @@ -0,0 +1,13 @@ +% Ansible Creator documentation master file, created by +% sphinx-quickstart on Fri Nov 17 12:47:50 2023. +% You can adapt this file completely to your liking, but it should at least +% contain the root `toctree` directive. + +```{include} ../../README.md +:relative-images: +``` + +```{toctree} +:caption: 'Contents:' +:maxdepth: 2 +``` diff --git a/pyproject.toml b/pyproject.toml index 08f6606..fe4bb84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,6 +106,7 @@ convention = "pep257" [tool.setuptools.dynamic] dependencies = {file = "requirements.txt"} +optional-dependencies.doc = {file = [".config/requirements-doc.txt"]} optional-dependencies.test = {file = [".config/requirements-test.txt"]} [tool.setuptools_scm]