Skip to content

Commit

Permalink
feat: Add /docs used to deploy documentation to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Oct 23, 2024
1 parent 8df3ea3 commit 98c0dad
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,7 @@ tramp
.\#*

# Sphinx documentation
doc/_build/
doc/auto_examples/
sphinx/build/
sphinx/auto_examples/
sphinx/generated/
sphinx/sg_execution_times.rst
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
exclude: |
(?x)
(fixtures/)|
(^sphinx/)|
(^docs/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down Expand Up @@ -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/
Empty file added docs/.nojekyll
Empty file.
3 changes: 3 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<head>
<meta http-equiv="refresh" content="0;latest/index.html">
</head>
10 changes: 10 additions & 0 deletions skore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions sphinx/Makefile
Original file line number Diff line number Diff line change
@@ -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)
62 changes: 62 additions & 0 deletions sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -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"
),
}

0 comments on commit 98c0dad

Please sign in to comment.