Skip to content

Commit f5fc9fb

Browse files
committed
1 parent e9e05ee commit f5fc9fb

9 files changed

Lines changed: 813 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Simple workflow for building docs
2+
name: Build docs
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: [main]
8+
9+
pull_request:
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
apply_fix: ['no', 'yes']
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v3
24+
25+
- name: Setup uv
26+
uses: astral-sh/setup-uv@v5
27+
with:
28+
enable-cache: true
29+
30+
- name: Build docs
31+
run: |
32+
cd docs
33+
APPLY_FIX=${{ matrix.apply_fix }} make html

‎.gitignore‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
12+
docs/source/apidocs/
13+
14+
docs/src/matplotlib_mwe_26099/

‎.python-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

‎docs/Makefile‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= uv run sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

‎docs/source/conf.py‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
8+
# -- Project information -----------------------------------------------------
9+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
10+
11+
project = "Matplotlib MWE 26099"
12+
copyright = "2025, Jérome Eertmans"
13+
author = "Jérome Eertmans"
14+
15+
# -- General configuration ---------------------------------------------------
16+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
17+
18+
extensions = [
19+
"autodoc2",
20+
"matplotlib.sphinxext.plot_directive",
21+
]
22+
23+
autodoc2_packages = [
24+
"../../src/matplotlib_mwe_26099",
25+
]
26+
27+
autodoc2_module_all_regexes = ["differt2d.logic"]
28+
29+
templates_path = ["_templates"]
30+
exclude_patterns = []
31+
32+
if os.environ.get("APPLY_FIX", "").lower().strip() == "yes":
33+
plot_rst_directory = "source/apidocs/matplotlib_mwe_26099/"
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = "alabaster"

‎docs/source/index.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Welcome to this MWE!
2+
====================
3+
4+
.. toctree::
5+
:titlesonly:
6+
7+
apidocs/index

‎pyproject.toml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "matplotlib-mwe-26099"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jérome Eertmans", email = "jeertmans@icloud.com" }
8+
]
9+
requires-python = ">=3.11"
10+
dependencies = []
11+
12+
[project.scripts]
13+
matplotlib-mwe-26099 = "matplotlib_mwe_26099:main"
14+
15+
[build-system]
16+
requires = ["hatchling"]
17+
build-backend = "hatchling.build"
18+
19+
[dependency-groups]
20+
dev = [
21+
"matplotlib",
22+
"sphinx>=8.1.3",
23+
"sphinx-autodoc2>=0.5.0",
24+
]
25+
26+
[tool.uv.sources]
27+
matplotlib = { git = "https://github.com/jeertmans/matplotlib.git", rev = "rst-directory" }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def main() -> None:
2+
"""
3+
Dummy function.
4+
5+
.. plot::
6+
7+
import matplotlib.pyplot as plt
8+
9+
x = [i - 5 for i in range(11)]
10+
y = [i**2 for i in x]
11+
plt.plot(x, y)
12+
plt.show()
13+
"""
14+
print("Hello from matplotlib-mwe-26099!")

‎uv.lock‎

Lines changed: 659 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)