From ffdfbc48ab3f2462309b1fd0a81f8230a57674ac Mon Sep 17 00:00:00 2001 From: Oliver Matthews Date: Wed, 22 Nov 2023 20:04:24 +0000 Subject: [PATCH] doc: add basic generated docs --- Forthcoming_features.md | 2 +- docs/Makefile | 19 +++++++++++++++++ docs/changelog.md | 2 ++ docs/conduct.md | 2 ++ docs/conf.py | 36 +++++++++++++++++++++++++++++++++ docs/contributing.md | 2 ++ docs/example.ipynb | 45 +++++++++++++++++++++++++++++++++++++++++ docs/index.md | 13 ++++++++++++ docs/make.bat | 36 +++++++++++++++++++++++++++++++++ docs/requirements.txt | 3 +++ 10 files changed, 159 insertions(+), 1 deletion(-) create mode 100755 docs/Makefile create mode 100755 docs/changelog.md create mode 100755 docs/conduct.md create mode 100755 docs/conf.py create mode 100755 docs/contributing.md create mode 100644 docs/example.ipynb create mode 100755 docs/index.md create mode 100755 docs/make.bat create mode 100644 docs/requirements.txt diff --git a/Forthcoming_features.md b/Forthcoming_features.md index 855981b..1b80808 100644 --- a/Forthcoming_features.md +++ b/Forthcoming_features.md @@ -1,4 +1,4 @@ -# Requested and forthcoming features +m# Requested and forthcoming features Basically a To-DoENUT list (geddit?) diff --git a/docs/Makefile b/docs/Makefile new file mode 100755 index 0000000..e29a268 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,19 @@ +# Minimal makefile for Sphinx documentation + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = python -msphinx +SPHINXPROJ = doenut +SOURCEDIR = . +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) \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100755 index 0000000..8261b35 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,2 @@ +```{include} ../CHANGELOG.md +``` \ No newline at end of file diff --git a/docs/conduct.md b/docs/conduct.md new file mode 100755 index 0000000..0568705 --- /dev/null +++ b/docs/conduct.md @@ -0,0 +1,2 @@ +```{include} ../CONDUCT.md +``` \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100755 index 0000000..44f6a28 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,36 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- + +project = u"doenut" +copyright = u"2023, Ella Gale" +author = u"Ella Gale" + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "myst_nb", + "autoapi.extension", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", +] +autoapi_dirs = ["../src"] + +# 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", "Thumbs.db", ".DS_Store"] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100755 index 0000000..435d357 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,2 @@ +```{include} ../CONTRIBUTING.md +``` \ No newline at end of file diff --git a/docs/example.ipynb b/docs/example.ipynb new file mode 100644 index 0000000..1f09f62 --- /dev/null +++ b/docs/example.ipynb @@ -0,0 +1,45 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Example usage\n", + "\n", + "To use `doenut` in a project:" + ], + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": null, + "source": [ + "import doenut\n", + "\n", + "print(doenut.__version__)" + ], + "outputs": [], + "metadata": {} + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100755 index 0000000..6fcdc0e --- /dev/null +++ b/docs/index.md @@ -0,0 +1,13 @@ +```{include} ../README.md +``` + +```{toctree} +:maxdepth: 1 +:hidden: + +example.ipynb +changelog.md +contributing.md +conduct.md +autoapi/index +``` \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100755 index 0000000..f24f5f4 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=python -msphinx +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=doenut + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The Sphinx module was not found. Make sure you have Sphinx installed, + echo.then set the SPHINXBUILD environment variable to point to the full + echo.path of the 'sphinx-build' executable. Alternatively you may add the + echo.Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..7b5bd2a --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +myst-nb +sphinx-autoapi +sphinx-rtd-theme \ No newline at end of file