Skip to content

Commit

Permalink
Update project docs config
Browse files Browse the repository at this point in the history
Signed-off-by: guillemdb <guillem@fragile.tech>
  • Loading branch information
Guillemdb committed Sep 12, 2022
1 parent c2700fc commit 6fe5eb7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 34 deletions.
17 changes: 10 additions & 7 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
NOTEBOOKS_SRC_DIR = ../notebooks
NOTEBOOKS_BUILD_DIR = ./source/notebooks


# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -23,15 +26,15 @@ help:
server:
python3 -m http.server --directory build/html/

.PHONY: assets
assets:
rm -rf build
rm -rf ./source/assets
mkdir source/assets
cp -r ../mloq/assets source
# rm -rf source/notebooks
# cp -r ../notebooks ./source/notebooks

.PHONY: test
test:
make assets
if [ -e "${NOTEBOOKS_SRC_DIR}" ] && [ -e "${NOTEBOOKS_BUILD_DIR}" ]; then \
echo "${NOTEBOOKS_BUILD_DIR} Updating notebook folder."; \
rm -rf "${NOTEBOOKS_BUILD_DIR}"; \
cp -r "${NOTEBOOKS_SRC_DIR}" "${NOTEBOOKS_BUILD_DIR}"; \
fi
make html
make server
13 changes: 8 additions & 5 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
sphinx==4.3.0
linkify-it-py==1.0.2
myst-parser==0.15.2
sphinx==4.5.0
linkify-it-py==2.0.0
myst-parser==0.18.0
myst-nb==0.16.0
ruyaml==0.19.2
sphinx-autoapi==1.8.4
sphinx-rtd-theme==1.0.0
sphinx-autoapi==1.9.0
sphinxcontrib-mermaid==0.7.1
sphinx_book_theme==0.3.3
jupyter-cache==0.5.0
49 changes: 27 additions & 22 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,16 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
from pathlib import Path
import sys

from ruamel.yaml import load as yaml_load, Loader


sys.path.insert(0, os.path.abspath("../../"))
sys.setrecursionlimit(1500)


def read_template() -> dict:
"""Load the project configuration from the target path."""
template_path = Path(__file__).parent / "_static" / "mloq.yml"
with open(template_path, "r") as config:
params = yaml_load(config.read(), Loader)
return params


# -- Project information -----------------------------------------------------

project = "MLOQ"
copyright = "2021, Fragile Technologies"
author = "Guillem Duran, Vadim Markovtsev"
project = "mloq"
copyright = "2020, FragileTech"
author = "FragileTech"

# The short X.Y version
from mloq.version import __version__
Expand All @@ -52,7 +39,7 @@ def read_template() -> dict:
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
#"sphinx.ext.autodoc",
"autoapi.extension",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
Expand All @@ -63,9 +50,10 @@ def read_template() -> dict:
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autodoc.typehints",
"myst_parser",
# "sphinx.ext.githubpages",
# "m2r",
"sphinx_book_theme",
"myst_nb",
"sphinxcontrib.mermaid",
"sphinx.ext.githubpages",
]
suppress_warnings = ["image.nonlocal_uri"]
autodoc_typehints = "description"
Expand Down Expand Up @@ -107,7 +95,25 @@ def read_template() -> dict:
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_title = ""
html_theme = "sphinx_book_theme"
# html_logo = "_static/logo-wide.svg"
# html_favicon = "_static/logo-square.svg"
html_theme_options = {
"github_url": "https://github.com/FragileTech/ml-ops-quickstart",
"repository_url": "https://github.com/FragileTech/ml-ops-quickstart",
"repository_branch": "gh-pages",
"home_page_in_toc": True,
"path_to_docs": "docs",
"show_navbar_depth": 1,
"use_edit_page_button": True,
"use_repository_button": True,
"use_download_button": True,
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
"notebook_interface": "classic",
},
}

# 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,
Expand All @@ -116,7 +122,6 @@ def read_template() -> dict:

# myst_parser options
myst_heading_anchors = 2
myst_substitutions = read_template()
myst_enable_extensions = [
"amsmath",
"colon_fence",
Expand Down

0 comments on commit 6fe5eb7

Please sign in to comment.