Skip to content

Commit 538affa

Browse files
author
William Grant
committed
Add ReadTheDocs config to docs
Config code will regenerate the docs from the docstrings every rebuild. Also excludes tests from the generated html. Docs will be available at typed-python.readthedocs.io.
1 parent 11e5e28 commit 538affa

File tree

5 files changed

+48
-21
lines changed

5 files changed

+48
-21
lines changed

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-20.04"
5+
tools:
6+
python: "3.10"
7+
jobs:
8+
pre_build:
9+
- sphinx-apidoc -fo docs/api typed_python typed_python/*test* typed_python/*/*test*
10+
11+
12+
python:
13+
install:
14+
- requirements: docs/doc_requirements.txt

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ hedge fund in New York. If you're interested in working with us, drop us a line
2323

2424
## Getting started
2525

26-
You can read the [introductory tutorial](docs/introduction.md) for using `typed_python` or
27-
check out the documentation [typed_python](docs/typed_python.md).
26+
You can read the [introductory tutorial](https://github.com/APrioriInvestments/typed_python/docs/introduction.md) for using `typed_python` or
27+
check out the documentation [here](https://typed-python.readthedocs.io/en/latest/).
2828

2929
## Where did this come from?
3030

docs/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Minimal makefile for Sphinx documentation
2-
3-
2+
SHELL = /bin/bash
3+
# SHELL = /bin/zsh
4+
.SHELLFLAGS = -O globstar -c # enable globstar operator
45

56
# You can set these variables from the command line, and also
67
# from the environment for the first two.
78
SPHINXOPTS ?=
89
SPHINXBUILD ?= sphinx-build
910
SOURCEDIR = .
1011
BUILDDIR = _build
11-
APIBUILDDIR = api
12+
APIBUILDDIR = api
1213
MODULEDIR = ../typed_python
13-
1414
# Put it first so that "make" without argument is like "make help".
1515
help:
1616
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1717

1818
.PHONY: help clean apidocs Makefile
1919

2020
apidocs:
21-
@sphinx-apidoc -fo "$(APIBUILDDIR)" "$(MODULEDIR)"
21+
@sphinx-apidoc -fo "$(APIBUILDDIR)" "$(MODULEDIR)" $(MODULEDIR)/**/*test*
2222

2323
clean:
2424
-rm -rf "$(BUILDDIR)"/*

docs/conf.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,33 @@
88
import os
99
import sys
1010

11-
project = 'typed_python'
12-
copyright = '2022, Braxton McKee'
13-
author = 'Braxton McKee'
14-
release = '0.2.6'
11+
project = "typed_python"
12+
copyright = "2022, Braxton McKee"
13+
author = "Braxton McKee"
14+
release = "0.2.6"
1515

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

19-
extensions = ['myst_parser',
20-
'sphinx.ext.autodoc',
21-
'sphinx.ext.napoleon',
22-
'sphinx.ext.viewcode'
23-
]
19+
extensions = [
20+
"myst_parser",
21+
"sphinx.ext.autodoc",
22+
"sphinx.ext.napoleon",
23+
"sphinx.ext.viewcode",
24+
]
2425

25-
templates_path = ['_templates']
26-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
26+
source_suffix = {
27+
".rst": "restructuredtext",
28+
".md": "markdown",
29+
}
30+
31+
templates_path = ["_templates"]
32+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
2733

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

31-
html_theme = 'sphinx_book_theme'
32-
html_static_path = ['_static']
37+
html_theme = "sphinx_book_theme"
38+
html_static_path = ["_static"]
3339

34-
sys.path.insert(0, os.path.abspath('..'))
40+
sys.path.insert(0, os.path.abspath(".."))

docs/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ typed_python
77
========================================
88
Strong typing and an LLVM-based JIT compiler for Python.
99

10+
.. include:: ../README.md
11+
:parser: myst_parser.sphinx_
12+
13+
14+
Contents
15+
========================================
16+
1017
.. toctree::
1118
:maxdepth: 1
1219
:caption: For Users

0 commit comments

Comments
 (0)