From 0288739f1d40ec9b9370da3d029bce9829fdf162 Mon Sep 17 00:00:00 2001 From: Johan Larsson Date: Wed, 13 Dec 2023 17:03:16 +0100 Subject: [PATCH] docs: use myst parser --- Makefile | 2 +- docs/source/api.md | 16 ++++++++++++++++ docs/source/api.rst | 3 +-- docs/source/changelog.md | 3 +++ docs/source/changelog.rst | 4 ---- docs/source/conf.py | 21 ++++----------------- docs/source/index.md | 12 ++++++++++++ docs/source/index.rst | 16 ---------------- docs/source/modules.rst | 7 +++++++ docs/source/sortedl1.rst | 20 ++++++++------------ 10 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 docs/source/api.md create mode 100644 docs/source/changelog.md delete mode 100644 docs/source/changelog.rst create mode 100644 docs/source/index.md delete mode 100644 docs/source/index.rst create mode 100644 docs/source/modules.rst diff --git a/Makefile b/Makefile index 34e340c..89cdc83 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ docs: .PHONY: autodoc autodoc: - sphinx-autobuild docs/source docs/build + sphinx-autobuild docs/source docs/build --watch sortedl1 .PHONY: update-libslope update-libslope: diff --git a/docs/source/api.md b/docs/source/api.md new file mode 100644 index 0000000..d4dfbe2 --- /dev/null +++ b/docs/source/api.md @@ -0,0 +1,16 @@ +# API Documentation + +```{eval-rst} +.. currentmodule:: sortedl1 +``` + +## Estimators + +```{eval-rst} +.. currentmodule:: sortedl1 + +.. autosummary:: + :toctree: generated/ + + Slope +``` diff --git a/docs/source/api.rst b/docs/source/api.rst index b9cf72e..ae5f8c6 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -14,5 +14,4 @@ Estimators .. autosummary:: :toctree: generated/ - Slope - + Slope diff --git a/docs/source/changelog.md b/docs/source/changelog.md new file mode 100644 index 0000000..4d6e28c --- /dev/null +++ b/docs/source/changelog.md @@ -0,0 +1,3 @@ +```{include} ../../CHANGELOG.md + +``` diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst deleted file mode 100644 index 7bcd169..0000000 --- a/docs/source/changelog.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. _changelog: - -.. include:: ../../CHANGELOG.md - :parser: myst_parser.sphinx_ diff --git a/docs/source/conf.py b/docs/source/conf.py index f2ece87..ea19c3b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,8 +18,8 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ - "sphinx.ext.autodoc", "sphinx.ext.autosummary", + "sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.napoleon", @@ -43,22 +43,6 @@ html_static_path = ["_static"] html_logo = "_static/slope-horizontal.svg" -# -- Options for napoleon extension ------------------------------------------ -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_init_with_doc = False -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True -napoleon_preprocess_types = False -napoleon_type_aliases = None -napoleon_attr_annotations = True - # - Intersphinx intersphinx_mapping = { # 'numpy': ('https://docs.scipy.org/doc/numpy/', None), @@ -66,3 +50,6 @@ # 'matplotlib': ('https://matplotlib.org/', None), "sklearn": ("http://scikit-learn.org/stable", None), } + +# Myst +myst_enable_extensions = ["colon_fence", "deflist", "fieldlist"] diff --git a/docs/source/index.md b/docs/source/index.md new file mode 100644 index 0000000..8433dc6 --- /dev/null +++ b/docs/source/index.md @@ -0,0 +1,12 @@ +# sortedl1 + +Some **bla**! + +```{toctree} +:maxdepth: 2 +:hidden: +:caption: Contents + +api +changelog +``` diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 8b4395d..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. - sortedl1 documentation master file, created by - sphinx-quickstart on Tue Nov 28 20:48:55 2023. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -###################################### - Welcome to sortedl1's documentation! -###################################### - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - api - changelog diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 0000000..3fc73fe --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,7 @@ +sortedl1 +======== + +.. toctree:: + :maxdepth: 4 + + sortedl1 diff --git a/docs/source/sortedl1.rst b/docs/source/sortedl1.rst index 7187333..39e838f 100644 --- a/docs/source/sortedl1.rst +++ b/docs/source/sortedl1.rst @@ -1,23 +1,19 @@ -################## - sortedl1 package -################## +sortedl1 package +================ -************ - Submodules -************ +Submodules +---------- -**************************** - sortedl1.estimators module -**************************** +sortedl1.estimators module +-------------------------- .. automodule:: sortedl1.estimators :members: :undoc-members: :show-inheritance: -***************** - Module contents -***************** +Module contents +--------------- .. automodule:: sortedl1 :members: