diff --git a/.gitignore b/.gitignore index db856d4..6b1d9d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist-newstyle/ +docs/build/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..ee23016 --- /dev/null +++ b/docs/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 = src +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/docs/src/commentary/stg.rst b/docs/src/commentary/stg.rst new file mode 100644 index 0000000..a5c7b81 --- /dev/null +++ b/docs/src/commentary/stg.rst @@ -0,0 +1,16 @@ +The *Spineless Tagless G-Machine* +================================= + +WIP. Here's a typeset state transition rule describing the action of +dereferencing indirections when passed as function arguments. + +.. math:: + \transrule + {a : s & d & h + \begin{bmatrix} + a : \mathtt{NAp} \; a_1 \; a_2 \\ + a_2 : \mathtt{NInd} \; a_3 + \end{bmatrix} & f} + {a : s & d & h[a : \mathtt{NAp} \; a_1 \; a_3] & f} + :label: rule1 + diff --git a/docs/src/conf.py b/docs/src/conf.py new file mode 100644 index 0000000..9e9b12f --- /dev/null +++ b/docs/src/conf.py @@ -0,0 +1,48 @@ +# 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 = 'rlp' +copyright = '2023, madeleine sydney ślaga' +author = 'madeleine sydney slaga' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['sphinx.ext.imgmath'] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] + +# -- Options for LaTeX image math -------------------------------------------- +imgmath_latex_preamble = r''' +\usepackage{amsmath} +\usepackage{tabularray} + +\newcommand{\transrule}[2] + {\begin{tblr}{|ccclc|} + \hline + & #1 \\ + \implies & #2 \\ + \hline + \end{tblr} } +''' +imgmath_image_format = 'svg' +imgmath_font_size = 14 + +# helps with inlining: +# https://www.sphinx-doc.org/en/master/usage/extensions/math.html#confval-imgmath_use_preview +imgmath_use_preview = True + diff --git a/docs/src/index.rst b/docs/src/index.rst new file mode 100644 index 0000000..a0ab572 --- /dev/null +++ b/docs/src/index.rst @@ -0,0 +1,13 @@ +Welcome to rlp's documentation! +=============================== + +Contents +-------- + +.. toctree:: + :maxdepth: 2 + :caption: Commentary + :glob: + + commentary/* +