Skip to content

Commit ea39b9c

Browse files
authored
Use Sphinx and Read the Docs for documentation (#876)
1 parent 53c5057 commit ea39b9c

File tree

5 files changed

+129
-0
lines changed

5 files changed

+129
-0
lines changed

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_venv
2+
_build

docs/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
VENVDIR = _venv
8+
BINDIR = $(VENVDIR)/bin
9+
SPHINXBUILD = $(BINDIR)/sphinx-build
10+
SOURCEDIR = .
11+
BUILDDIR = _build
12+
13+
# Put it first so that "make" without argument is like "make help".
14+
help: $(SPHINXBUILD)
15+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
16+
17+
$(SPHINXBUILD): $(VENVDIR)
18+
$(VENVDIR)/bin/pip install -r requirements.txt
19+
20+
$(VENVDIR):
21+
python3 -m venv $(VENVDIR)
22+
23+
.PHONY: help Makefile
24+
25+
# Catch-all target: route all unknown targets to Sphinx using the new
26+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
27+
%: Makefile
28+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
import sphinx_rtd_theme
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'sqlc'
21+
copyright = '2021, Kyle Conroy'
22+
author = 'Kyle Conroy'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '1.6.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinx_rtd_theme',
35+
]
36+
37+
# Add any paths that contain templates here, relative to this directory.
38+
templates_path = ['_templates']
39+
40+
# List of patterns, relative to source directory, that match files and
41+
# directories to ignore when looking for source files.
42+
# This pattern also affects html_static_path and html_extra_path.
43+
exclude_patterns = ['_build', '_venv', 'Thumbs.db', '.DS_Store']
44+
45+
# -- Options for HTML output -------------------------------------------------
46+
47+
# The theme to use for HTML and HTML Help pages. See the documentation for
48+
# a list of builtin themes.
49+
#
50+
html_theme = 'sphinx_rtd_theme'
51+
52+
# Add any paths that contain custom static files (such as style sheets) here,
53+
# relative to this directory. They are copied after the builtin static files,
54+
# so a file named "default.css" will overwrite the builtin "default.css".
55+
html_static_path = ['_static']

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. sqlc documentation master file, created by
2+
sphinx-quickstart on Mon Feb 1 23:18:36 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to sqlc's documentation!
7+
================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

docs/requirements.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
alabaster==0.7.12
2+
Babel==2.9.0
3+
certifi==2020.12.5
4+
chardet==4.0.0
5+
docutils==0.16
6+
idna==2.10
7+
imagesize==1.2.0
8+
Jinja2==2.11.3
9+
MarkupSafe==1.1.1
10+
packaging==20.9
11+
Pygments==2.7.4
12+
pyparsing==2.4.7
13+
pytz==2021.1
14+
requests==2.25.1
15+
snowballstemmer==2.1.0
16+
Sphinx==3.4.3
17+
sphinx-rtd-theme==0.5.1
18+
sphinxcontrib-applehelp==1.0.2
19+
sphinxcontrib-devhelp==1.0.2
20+
sphinxcontrib-htmlhelp==1.0.3
21+
sphinxcontrib-jsmath==1.0.1
22+
sphinxcontrib-qthelp==1.0.3
23+
sphinxcontrib-serializinghtml==1.1.4
24+
urllib3==1.26.3

0 commit comments

Comments
 (0)