···11+# .readthedocs.yml
22+# Read the Docs configuration file
33+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44+55+# Required
66+version: 2
77+88+python:
99+ install:
1010+ - requirements: docs/requirements.txt
1111+1212+build:
1313+ os: ubuntu-22.04
1414+ tools:
1515+ python: "3.11"
1616+1717+# Build documentation in the docs/ directory with Sphinx
1818+sphinx:
1919+ configuration: docs/conf.py
2020+2121+# Optionally build your docs in additional formats such as PDF and ePub
2222+formats: all
···11+# Minimal makefile for Sphinx documentation
22+#
33+44+# You can set these variables from the command line, and also
55+# from the environment for the first two.
66+SPHINXOPTS ?=
77+SPHINXBUILD ?= sphinx-build
88+SOURCEDIR = .
99+BUILDDIR = _build
1010+1111+# Put it first so that "make" without argument is like "make help".
1212+help:
1313+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414+1515+.PHONY: help Makefile
1616+1717+# Catch-all target: route all unknown targets to Sphinx using the new
1818+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919+%: Makefile
2020+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+72
docs/conf.py
···11+import os
22+from pathlib import Path
33+44+from single_source import get_version
55+66+# Configuration file for the Sphinx documentation builder.
77+#
88+# This file only contains a selection of the most common options. For a full
99+# list see the documentation:
1010+# https://www.sphinx-doc.org/en/master/usage/configuration.html
1111+1212+1313+# -- Path setup --------------------------------------------------------------
1414+1515+# If extensions (or modules to document with autodoc) are in another directory,
1616+# add these directories to sys.path here. If the directory is relative to the
1717+# documentation root, use os.path.abspath to make it absolute, like shown here.
1818+#
1919+# import os
2020+# import sys
2121+# sys.path.insert(0, os.path.abspath('.'))
2222+2323+2424+# -- Project information -----------------------------------------------------
2525+2626+project = "Django Simple Options"
2727+copyright = "2020, Marcos Gabarda"
2828+author = "Marcos Gabarda"
2929+3030+# The version info for the project you're documenting, acts as replacement for
3131+# |version| and |release|, also used in various other places throughout the
3232+# built documents.
3333+#
3434+# The short X.Y version.
3535+version = get_version(__name__, Path(__file__).parent.parent)
3636+# The full version, including alpha/beta/rc tags.
3737+release = version
3838+3939+# -- General configuration ---------------------------------------------------
4040+4141+# Add any Sphinx extension module names here, as strings. They can be
4242+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4343+# ones.
4444+extensions: list = []
4545+4646+# Add any paths that contain templates here, relative to this directory.
4747+templates_path = ["_templates"]
4848+4949+# list of patterns, relative to source directory, that match files and
5050+# directories to ignore when looking for source files.
5151+# This pattern also affects html_static_path and html_extra_path.
5252+exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
5353+5454+5555+# -- Options for HTML output -------------------------------------------------
5656+5757+# The theme to use for HTML and HTML Help pages. See the documentation for
5858+# a list of builtin themes.
5959+#
6060+# html_theme = 'alabaster'
6161+on_rtd = os.environ.get("READTHEDOCS", None) == "True"
6262+6363+if not on_rtd:
6464+ import sphinx_rtd_theme
6565+6666+ html_theme = "sphinx_rtd_theme"
6767+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
6868+6969+# Add any paths that contain custom static files (such as style sheets) here,
7070+# relative to this directory. They are copied after the builtin static files,
7171+# so a file named "default.css" will overwrite the builtin "default.css".
7272+html_static_path = ["_static"]
+36
docs/index.rst
···11+.. Django Belt documentation master file, created by
22+ sphinx-quickstart on Wed Feb 5 10:19:59 2020.
33+ You can adapt this file completely to your liking, but it should at least
44+ contain the root `toctree` directive.
55+66+=====================================
77+Django Simple Options's documentation
88+=====================================
99+1010+Simple app to add configuration options to a Django project.
1111+1212+Quick start
1313+-----------
1414+1515+**1** Install using pip::
1616+1717+ $ pip install django-simple-options
1818+1919+**2** Add "options" to your INSTALLED_APPS settings like this::
2020+2121+ INSTALLED_APPS += ('options',)
2222+2323+2424+Settings options
2525+----------------
2626+2727+Use ``SIMPLE_OPTIONS_CONFIGURATION_DEFAULT`` to set the default options::
2828+2929+ SIMPLE_OPTIONS_CONFIGURATION_DEFAULT = {
3030+ "sold_out": {
3131+ "value": 0,
3232+ "type": INT,
3333+ "public_name": "Sets tickets as sold out"
3434+ },
3535+ }
3636+
+35
docs/make.bat
···11+@ECHO OFF
22+33+pushd %~dp0
44+55+REM Command file for Sphinx documentation
66+77+if "%SPHINXBUILD%" == "" (
88+ set SPHINXBUILD=sphinx-build
99+)
1010+set SOURCEDIR=.
1111+set BUILDDIR=_build
1212+1313+if "%1" == "" goto help
1414+1515+%SPHINXBUILD% >NUL 2>NUL
1616+if errorlevel 9009 (
1717+ echo.
1818+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
1919+ echo.installed, then set the SPHINXBUILD environment variable to point
2020+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
2121+ echo.may add the Sphinx directory to PATH.
2222+ echo.
2323+ echo.If you don't have Sphinx installed, grab it from
2424+ echo.http://sphinx-doc.org/
2525+ exit /b 1
2626+)
2727+2828+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2929+goto end
3030+3131+:help
3232+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3333+3434+:end
3535+popd