Skip to content

Conversation

@edmondchuc
Copy link
Contributor

Summary of changes

This PR backports PR #3143 from main to v7.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • If the change adds new features or changes the RDFLib public API:
    • Created an issue to discuss the change and get in-principle agreement.
    • Considered adding an example in ./examples.
  • If the change has a potential impact on users of this project:
    • Added or updated tests that fail without the change.
    • Updated relevant documentation to avoid inaccuracies.
    • Considered adding additional documentation.
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

nicholascar and others added 5 commits October 29, 2025 14:10
* Start migrating the documentation from .rst sphynx to .md material for mkdocs. Add mkdocs.yml with proper configuration, enable automated generation of the doc API from the docstring, and start converting a few pages (index, getting started, developers) for demo.

* Add automated (opt-in) tests of all python codeblocks in the markdown docs using pytest-markdown-docs. Needed to comment 1 small test that seemingly should fail (AttributeError: DefinedNamespace like object has no attribute '_NS', indeed the DefinedNamespace class expect a _NS, so it makes sense it fails) but for some reason it was not properly failing when ran with regular pytest, but it fails with pytest-markdown-docs

* convert all documentations pages to markdown, convert all docstrings to markdown with google style, updated config for mkdocs (readthedocs, tox, task)
fixed #3128

* delete files, dependencies and mentions related to sphinx

* uncomment test previously commented for experimenting with markdown codeblock testing

* update poetry lock

* blacked again

* ignore mypy errors

---------

Co-authored-by: Vincent Emonet <vincent.emonet@gmail.com>
@edmondchuc
Copy link
Contributor Author

One thing to note: since we need to support python 3.9, we cannot install the latest major versions of the various mkdocs plugins. This results in some pages not generating all of the content from the python modules/scripts.

For example, see the examples page in this PR:

image

Compared to the examples page in main branch:

image

I think it has something to do with the docs/gen_ref_pages.py script or the python version or the mkdocs plugins. If I set the minimum python version to 3.9 and use the same plugin versions as main, it works. I will have to investigate this some more.

@edmondchuc
Copy link
Contributor Author

I've noticed readthedocs uses python 3.13 to perform the doc builds. For some reason, I thought we were running the doc builds on the lowest supported python version. I've now fixed the above issue by updating the mkdocs dependencies to the latest with a python version constraint of >=3.11, which is the python version we use to test the doc builds in the "validate" github actions.

@edmondchuc
Copy link
Contributor Author

To clarify the comment above, we now only run doc build test on python 3.11 in the validate workflow matrix. There's no point running the docs build on different python versions when readthedocs only uses the latest stable python version anyway. I've arbitrarily chosen 3.11 but readthedocs currently uses 3.13 for all builds.

@nicholascar nicholascar self-requested a review October 29, 2025 12:07
@nicholascar nicholascar merged commit 9b14b8f into 7.x Oct 29, 2025
20 checks passed
@nicholascar nicholascar deleted the v7/docs/mkdocs branch October 29, 2025 12:08
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.

3 participants