diff --git a/.gitignore b/.gitignore index fdeb0af25..6d0c0dfab 100644 --- a/.gitignore +++ b/.gitignore @@ -178,5 +178,7 @@ tramp .\#* # Sphinx documentation -doc/_build/ -doc/auto_examples/ +sphinx/build/ +sphinx/auto_examples/ +sphinx/generated/ +sphinx/sg_execution_times.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06556c08d..f5ec64600 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,9 @@ +exclude: | + (?x) + (fixtures/)| + (^sphinx/)| + (^docs/) + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 @@ -52,5 +58,3 @@ repos: name: Use stylelint to lint CSS. entry: bash -c "cd skore-ui && npm run style-lint" files: ^skore-ui/ - -exclude: fixtures/ diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..489a9ada5 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,3 @@ + + + diff --git a/skore/pyproject.toml b/skore/pyproject.toml index f6d813d92..fdbf9694a 100644 --- a/skore/pyproject.toml +++ b/skore/pyproject.toml @@ -77,6 +77,16 @@ test = [ "scikit-learn", ] +sphinx = [ + "sphinx", + "pydata-sphinx-theme", + "sphinx-gallery", + "sphinx-design", + "matplotlib", + "scikit-learn", + "numpydoc", +] + [tool.pytest.ini_options] addopts = [ "--doctest-modules", diff --git a/sphinx/Makefile b/sphinx/Makefile new file mode 100644 index 000000000..ed8809902 --- /dev/null +++ b/sphinx/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 = . +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/sphinx/conf.py b/sphinx/conf.py new file mode 100644 index 000000000..50315ad51 --- /dev/null +++ b/sphinx/conf.py @@ -0,0 +1,62 @@ +# 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 = "skore" +copyright = "2024, Probabl team" +author = "Probabl team" +version = "0" +release = "0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "numpydoc", + "sphinx.ext.autosummary", + "sphinx.ext.githubpages", + "sphinx.ext.intersphinx", + "sphinx_design", + "sphinx_gallery.gen_gallery", +] +templates_path = ["_templates"] +exclude_patterns = ["build", "Thumbs.db", ".DS_Store"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "pydata_sphinx_theme" +html_static_path = ["_static"] + +html_css_files = [ + "css/custom.css", +] +html_js_files = [] + +# sphinx_gallery options +sphinx_gallery_conf = { + "examples_dirs": "../examples", # path to example scripts + "gallery_dirs": "auto_examples", # path to gallery generated output +} + +# intersphinx configuration +intersphinx_mapping = { + "sklearn": ("https://scikit-learn.org/stable/", None), +} + +numpydoc_show_class_members = False + +html_title = "skore" + +html_theme_options = { + "announcement": ( + "https://raw.githubusercontent.com/soda-inria/hazardous/main/doc/announcement.html" + ), +}