Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
docs(structure): Update to standard Sphinx #63
Browse files Browse the repository at this point in the history
Change the docs structure using sphinx-quickstart to make the docs
layout the same as ll my other projects.  KISS

closes #63
  • Loading branch information
imAsparky committed May 8, 2023
1 parent 272af7c commit cac0100
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 26 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion docs/changelog.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/conf.py

This file was deleted.

1 change: 0 additions & 1 deletion docs/contributing.rst

This file was deleted.

35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../../CHANGELOG.md
74 changes: 74 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "django-tag-fields"
copyright = '2023, "Alex Gaynor, Mark Sevelj and individual contributors."'
author = '"Alex Gaynor, Mark Sevelj and individual contributors."'

__version__ = "4.0.2"
# The full version, including alpha/beta/rc tags.
release = __version__


master_doc = "index"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.intersphinx",
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinx.ext.todo",
]

# 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 = ["_build", "build", "Thumbs.db", ".DS_Store"]

intersphinx_mapping = {
"django": (
"https://docs.djangoproject.com/en/stable",
"https://docs.djangoproject.com/en/stable/_objects/",
),
"python": ("https://docs.python.org/3", None),
}

pygments_style = "monokai"
pygments_dark_style = "monokai"


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = ["_static"]

# sphinx-copybutton is a lightweight code-block copy button
# config options are here https://sphinx-copybutton.readthedocs.io/en/latest/
# This config removes Python Repl + continuation, Bash line prefixes,
# ipython and qtconsole + continuation, jupyter-console + continuation and preceding line numbers
copybutton_prompt_text = (
r"^\d{1,4}|^.\d{1,4}|>>> |\s{2,6}|\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}:"
)

copybutton_prompt_is_regexp = True

# datalad download-url http://www.tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.pdf \
# --dataset . \
# -m "add beginners guide on bash" \
# -O books/bash_guide.pdf
# is correctly pasted with the following setting
copybutton_line_continuation_character = "\\"
3 changes: 3 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


.. include:: ../../CONTRIBUTING.rst
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions docs/faq.rst → docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ Frequently Asked Questions
-----------------------------

To start using tags, you can access the pre-built ``Tag`` model
in ``tag_fields.models``.

However, if you have a custom model derived
from ``ThroughTableBase``you will need to query that instead.
For the standard setup, use ``Tag.objects.all()`` to retrieve all the
in ``tag_fields.models``. However, if you have a custom model derived from ``ThroughTableBase``you will need to query that instead. For the standard setup, use ``Tag.objects.all()`` to retrieve all the
available tags.


Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions docs/index.rst → docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. django-tag-fields documentation master file, created by
sphinx-quickstart on Mon May 8 08:43:15 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to django-tag-fields's documentation!
=============================================

Expand All @@ -12,8 +17,10 @@ tagging to your project easy and fun.

``django-tag-fields`` works with Django 3.2+ and Python 3.6+.


.. toctree::
:maxdepth: 2
:caption: Contents:

getting_started
forms
Expand All @@ -26,6 +33,8 @@ tagging to your project easy and fun.
external_apps
changelog



Indices and tables
==================

Expand Down
File renamed without changes.

0 comments on commit cac0100

Please sign in to comment.