From 080a5831ea0683a38e4d470d3d04dcf1e70eaf00 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 18 Mar 2020 09:01:21 +0100 Subject: [PATCH] Bootstrap Sphinx documentation Run sphinx-quickstart and include sphinx dependencies. Signed-off-by: Christian Heimes --- .gitignore | 3 ++ BUILD.txt | 2 +- doc/Makefile | 20 ++++++++++++ doc/conf.py | 77 ++++++++++++++++++++++++++++++++++++++++++++ doc/index.rst | 20 ++++++++++++ doc/requirements.txt | 2 ++ freeipa.spec.in | 5 +++ 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 doc/Makefile create mode 100644 doc/conf.py create mode 100644 doc/index.rst create mode 100644 doc/requirements.txt diff --git a/.gitignore b/.gitignore index b2f80e055..5dc366819 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,9 @@ freeipa2-dev-doc /daemons/ipa-version.h /daemons/test-driver +/doc/_build +!/doc/Makefile + /po/test.po /po/test_locale/xh_ZA/LC_MESSAGES/ipa.mo diff --git a/BUILD.txt b/BUILD.txt index 3e72bcd30..29d1d175f 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -7,7 +7,7 @@ For more information, see http://www.freeipa.org/page/Build The quickest way to get the dependencies needed for building is: -# dnf builddep -b -D "with_wheels 1" -D "with_lint 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False +# dnf builddep -b -D "with_wheels 1" -D "with_lint 1" -D "with_doc 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False TIP: For building with latest dependencies for freeipa master enable copr repo: diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 000000000..d4bb2cbb9 --- /dev/null +++ b/doc/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 = . +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/doc/conf.py b/doc/conf.py new file mode 100644 index 000000000..32a71b957 --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,77 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- 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 +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'FreeIPA' +copyright = '2020, FreeIPA Contributors' +author = 'FreeIPA Contributors' + +# The short X.Y version +version = '4.9-dev' + +# The full version, including alpha/beta/rc tags +release = '4.9-dev' + + +# -- 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 = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# 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 = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- 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 = 'alabaster' + +# 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'] + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +# intersphinx_mapping = {'https://docs.python.org/': None} diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 000000000..0d46ea883 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,20 @@ +.. FreeIPA documentation master file, created by + sphinx-quickstart on Wed Mar 18 08:53:57 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to FreeIPA's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..4d3e30fa4 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,2 @@ +recommonmark + diff --git a/freeipa.spec.in b/freeipa.spec.in index 7d716a139..f04e8ef53 100755 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -230,6 +230,11 @@ BuildRequires: python3-wheel # with_wheels %endif +%if 0%{?with_doc} +BuildRequires: python3-sphinx +BuildRequires: python3-recommonmark +%endif + # # Build dependencies for lint and fastcheck #