From ab6ff95570f5bd22b9a78bfedfb1bb652e42ec76 Mon Sep 17 00:00:00 2001
From: Tim Kreuzer <t.kreuzer@fz-juelich.de>
Date: Mon, 22 Apr 2024 21:17:00 +0200
Subject: [PATCH] add docs

---
 .readthedocs.yaml     |  10 ++++
 docs/conf.py          | 104 ++++++++++++++++++++++++++++++++++++++++++
 docs/requirements.txt |  13 ++++++
 3 files changed, 127 insertions(+)
 create mode 100644 .readthedocs.yaml
 create mode 100644 docs/conf.py
 create mode 100644 docs/requirements.txt

diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..8065b87
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,10 @@
+version: "2"
+
+build:
+  os: "ubuntu-22.04"
+  tools:
+    python: "3.10"
+
+python:
+  install:
+    - requirements: docs/requirements.txt
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..b65c05e
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,104 @@
+import os
+import sys
+from os.path import dirname
+
+# For conversion from markdown to html
+# set paths
+docs = dirname(dirname(__file__))
+root = dirname(docs)
+sys.path.insert(0, root)
+sys.path.insert(0, os.path.join(docs, "sphinxext"))
+
+# -- General configuration ------------------------------------------------
+extensions = [
+    "sphinx.ext.autodoc",
+    "sphinx.ext.intersphinx",
+    "sphinx.ext.napoleon",
+    "autodoc_traits",
+    "myst_parser",
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ["_templates"]
+
+# Set the default role so we can use `foo` instead of ``foo``
+default_role = "literal"
+
+# source_suffix = ['.rst', '.md']
+source_suffix = [".md"]
+
+# The root toctree document.
+root_doc = master_doc = "index"
+
+# General information about the project.
+project = "UNICORESpawner"
+copyright = "2023, Forschungszentrum Juelich GmbH"
+author = "Tim Kreuzer"
+
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+import pkg_resources
+
+# The full version, including alpha/beta/rc tags.
+release = pkg_resources.get_distribution("jupyterhub-unicorespawner").version
+# The short X.Y version.
+version = ".".join(release.split(".")[:2])
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ["build", "Thumbs.db", ".DS_Store"]
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = "sphinx"
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- MyST configuration ------------------------------------------------------
+# ref: https://myst-parser.readthedocs.io/en/latest/configuration.html
+#
+myst_enable_extensions = [
+    # available extensions: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
+    "colon_fence",
+]
+
+
+# -- 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_book_theme"
+html_title = "ForwardBaseSpawner"
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#
+html_theme_options = {
+    "repository_url": "https://github.com/kreuzert/jupyterhub-unicorespawner",
+    "use_issues_button": True,
+    "use_repository_button": True,
+    "use_edit_page_button": True,
+}
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ["_static"]
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {"https://docs.python.org/": None}
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..68abc54
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,13 @@
+--editable .
+
+autodoc-traits
+sphinx-jsonschema
+sphinx-copybutton
+sphinx-book-theme
+sphinxext-opengraph
+myst-parser>=0.17.0
+sphinxext-rediraffe
+pytablewriter>=0.56
+breathe==4.35.0
+sphinx==7.2.6
+sphinx-rtd-theme==1.3.0
-- 
GitLab