Skip to content

Sphinx autodoc - #24

Merged
jalvesz merged 22 commits into
fortran-lang:mainfrom
jalvesz:sphinx
Nov 1, 2026
Merged

jalvesz merged 22 commits into
fortran-lang:mainfrom
jalvesz:sphinx

Conversation

@jalvesz

@jalvesz jalvesz commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

This PR introduces support for autodoc generation using Sphinx and sphinx-fortran-domain.

Currently the draft site is published here for inspection https://jalvesz.github.io/fplotlib/

Once merged we should have one reference page and one for inspection of incoming tutorials in the gallery before merge.

@jalvesz jalvesz linked an issue Sep 15, 2026 that may be closed by this pull request
@jalvesz
jalvesz marked this pull request as ready for review October 3, 2026 15:49
@jalvesz
jalvesz requested a review from certik October 3, 2026 15:49
@jalvesz

jalvesz commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

The last commit preapres CI for fortran-lang and moves the sphinx fplotlib gallery extension to its own folder with its own CI to be published as an independent PyPi extension.

Settings that need to changed before this works:

  • Pages source: on both fortran-lang/fplotlib and current fork, set Settings > Pages > Source to "GitHub Actions".
  • Fork deploy branch: on current fork, allow sphinx to deploy in the github-pages environment rules. By default only the default branch can deploy.
  • PyPI trusted publisher: add a pending publisher on pypi.org. Use owner fortran-lang, repository fplotlib, workflow sphinx-fplotlib-gallery.yml and environment pypi.
  • TestPyPI trusted publisher: add the same on test.pypi.org with environment testpypi.
  • GitHub environments: create pypi and testpypi in the upstream repository. Adding required reviewers to pypi is a sensible safeguard.

Until the first release is on PyPI, pip install -r docs/requirements.txt on its own will fail. Install the local package in the same command, as the workflow does:

pip install ./sphinx-fplotlib-gallery -r docs/requirements.txt

@jalvesz
jalvesz merged commit 7c9b50d into fortran-lang:main Nov 1, 2026
10 checks passed

Some examples also use the `Fortran standard library
<https://stdlib.fortran-lang.org>`_, the way a Python one would use numpy. For
those, add ``stdlib = "*"`` to the ``[dependencies]`` of your ``fpm.toml``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would convert all these .rst files to Markdown, so that we use just one language for the docs, not two.

@certik

certik commented Nov 1, 2026

Copy link
Copy Markdown
Member

Otherwise it looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the docs polished with a gallery

2 participants