Skip to content

docs: switch documentation hosting from RTD to GitHub Pages#1411

Merged
vprusso merged 24 commits intovprusso:masterfrom
manasa-manoj-nbr:docs/gh-pages-switch
Feb 26, 2026
Merged

docs: switch documentation hosting from RTD to GitHub Pages#1411
vprusso merged 24 commits intovprusso:masterfrom
manasa-manoj-nbr:docs/gh-pages-switch

Conversation

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor

@manasa-manoj-nbr manasa-manoj-nbr commented Feb 5, 2026

Description

This PR migrates the toqito documentation from ReadTheDocs to GitHub Pages. 1398

Changes

  • Adds a single new GitHub Actions workflow (.github/workflows/docs.yml) to build and deploy the documentation
  • Builds docs using the project-standard uv environment and the existing docs dependency group
  • Deploys the generated HTML output to the gh-pages branch using GitHub Pages

Context

This sets up a GitHub Pages documentation pipeline similar to the one used in:
https://github.com/unitaryfoundation/metriq-gym

The existing ReadTheDocs configuration is intentionally left unchanged so the new deployment can be reviewed independently before any removal decisions are made.

Notes

Documentation has been verified to build successfully in CI and renders correctly when served from GitHub Pages.
Preview: https://manasa-manoj-nbr.github.io/toqito/index.html

- Build Sphinx documentation using uv-managed environment
- Deploy generated HTML to the gh-pages branch
- Add GitHub Pages workflow alongside existing RTD setup

docs: allow GH Pages workflow to run on feature branch

docs: run build via uv env
Copilot AI review requested due to automatic review settings February 5, 2026 20:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the toqito documentation hosting from ReadTheDocs to GitHub Pages by introducing a new GitHub Actions workflow. The migration aims to improve documentation appearance and functionality while maintaining the existing ReadTheDocs setup for independent review.

Changes:

  • Adds .github/workflows/docs.yml to build Sphinx documentation and deploy to GitHub Pages
  • Configures automated deployment on pushes to master branch and docs changes
  • Uses the project's standard uv tool with the docs dependency group for building documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docs.yml
Comment thread .github/workflows/docs.yml Outdated
Comment thread .github/workflows/docs.yml Outdated
Comment on lines +6 to +7
- master
- docs/gh-pages-switch
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation. There is extra whitespace before 'master' that is not present in other workflow files. The hyphen should be followed by a single space, not multiple spaces. This should be '- master' changed to '- master' for consistency with YAML formatting conventions.

Suggested change
- master
- docs/gh-pages-switch
- master
- docs/gh-pages-switch

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/docs.yml Outdated
Comment thread .github/workflows/docs.yml Outdated

steps:
- name: Checkout repository
uses: actions/checkout@v4
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The action version should be updated to match the convention used in other workflows. All other workflows in this repository use actions/checkout@v6, but this workflow uses v4. Update to v6 for consistency.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/docs.yml Outdated
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The action version should be updated to match the convention used in other workflows. All other workflows in this repository use actions/setup-python@v6, but this workflow uses v5. Update to v6 for consistency.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/docs.yml Outdated
Comment on lines +29 to +30
- name: Install uv
run: pip install uv
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The uv installation method should be updated to match the convention used in other workflows. All other workflows in this repository use astral-sh/setup-uv@v5 instead of pip install uv. This is more reliable and follows the recommended practice for GitHub Actions. Replace this step with the action used in other workflows.

Copilot uses AI. Check for mistakes.
@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 5, 2026

@manasa-manoj-nbr it looks like you likely used AI to gen the docs build. This is fine, but it tends to use outdated versions of things (which it did here). Also your PR still has all of the RTD stuff present (which we discussed that we wanted to remove). Additionally, do you have any screenshots or test build links to showcase that this workflow actually generated the docs?

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

On ReadTheDocs: I did that intentionally as an intermediate step so the GitHub Pages deployment could be reviewed and validated first. Based on your comment, I can remove the RTD configuration in this PR or follow up immediately with a cleanup commit.

For verification: the workflow does successfully build and deploy the docs. A live preview generated from this branch is available here: https://manasa-manoj-nbr.github.io/toqito/index.html

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 5, 2026

On ReadTheDocs: I did that intentionally as an intermediate step so the GitHub Pages deployment could be reviewed and validated first. Based on your comment, I can remove the RTD configuration in this PR or follow up immediately with a cleanup commit.

For verification: the workflow does successfully build and deploy the docs. A live preview generated from this branch is available here: https://manasa-manoj-nbr.github.io/toqito/index.html

Got it, thanks for clarifying!

Maybe this is a long shot, but what are the chances you could make the docs using GH-pages look like this?
https://unitaryfoundation.github.io/metriq-gym/

The theme/look there (which I would love to include here as well) is using mkdocs

Thoughts, @manasa-manoj-nbr ?

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

The RTD configuration file has been removed. Documentation links are left unchanged for now and can be updated after this PR is merged and the GitHub Pages deployment becomes the source of truth.

Sorry for relying on AI assistance during parts of this work. This is my first PR to this repository, and I’ve made sure to validate and adapt the final changes manually using the project documentation and existing workflows.

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

manasa-manoj-nbr commented Feb 5, 2026

On ReadTheDocs: I did that intentionally as an intermediate step so the GitHub Pages deployment could be reviewed and validated first. Based on your comment, I can remove the RTD configuration in this PR or follow up immediately with a cleanup commit.
For verification: the workflow does successfully build and deploy the docs. A live preview generated from this branch is available here: https://manasa-manoj-nbr.github.io/toqito/index.html

Got it, thanks for clarifying!

Maybe this is a long shot, but what are the chances you could make the docs using GH-pages look like this? https://unitaryfoundation.github.io/metriq-gym/

The theme/look there (which I would love to include here as well) is using mkdocs

Thoughts, @manasa-manoj-nbr ?

The current documentation is built entirely around Sphinx, while the look you’re referring to is based on MkDocs, so it wouldn’t be a simple theme swap.

I’d be happy to explore the MkDocs-style approach further in a separate discussion or follow-up issue. Can I look into it ? @vprusso

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 6, 2026

On ReadTheDocs: I did that intentionally as an intermediate step so the GitHub Pages deployment could be reviewed and validated first. Based on your comment, I can remove the RTD configuration in this PR or follow up immediately with a cleanup commit.
For verification: the workflow does successfully build and deploy the docs. A live preview generated from this branch is available here: https://manasa-manoj-nbr.github.io/toqito/index.html

Got it, thanks for clarifying!
Maybe this is a long shot, but what are the chances you could make the docs using GH-pages look like this? https://unitaryfoundation.github.io/metriq-gym/
The theme/look there (which I would love to include here as well) is using mkdocs
Thoughts, @manasa-manoj-nbr ?

The current documentation is built entirely around Sphinx, while the look you’re referring to is based on MkDocs, so it wouldn’t be a simple theme swap.

I’d be happy to explore the MkDocs-style approach further in a separate discussion or follow-up issue. Can I look into it ? @vprusso

That would be ideal, and if you do, I'd suggest doing this in one go on this PR. Does that seem reasonable to you? Thanks for the input, @manasa-manoj-nbr !

@manasa-manoj-nbr manasa-manoj-nbr marked this pull request as draft February 6, 2026 09:29
@@ -0,0 +1,112 @@
# Getting started
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there is already a contributing guide page. is there a reason to add this separately?

Copy link
Copy Markdown
Collaborator

@purva-thakre purva-thakre Feb 6, 2026

Choose a reason for hiding this comment

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

I do not understand why you need to convert each page of the docs here...

Can one not use Sphinx with github pages? The entire documentation is built around Sphinx. That's a lot of work to switch to mkdocs and I do not think either me or Vincent have the capacity to review each 'converted' page.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I do not understand why you need to convert each page of the docs here...

Can one not use Sphinx with github pages?

One uses markdown, the other RST. I think we do need to convert the pages.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, that seems unnecessary extra work.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

How is that unnecessary? It's a requirement for using GH-pages

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’ve been exploring the MkDocs ecosystem and found that many of the features we relied on in Sphinx have good equivalents via plugins and markdown extensions.
I’ve already enabled pymdownx.arithmatex for math rendering, and formulas are rendering correctly with MathJax
image
I’m primarily referencing the official MkDocs Material documentation as well as the metriq-gym setup .

If the concern is on .py example files : MkDocs doesn’t natively support executable gallery-style Python files like Sphinx Gallery. I’ve seen a few plugin-based approaches for handling this but I haven’t tried them yet. I’ll experiment with the available options and follow up with results and a recommended approach once I have something concrete.

Copy link
Copy Markdown
Collaborator

@purva-thakre purva-thakre Feb 6, 2026

Choose a reason for hiding this comment

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

I’ve been exploring the MkDocs ecosystem and found that many of the features we relied on in Sphinx have good equivalents via plugins and markdown extensions.
I’ve already enabled pymdownx.arithmatex for math rendering, and formulas are rendering correctly with MathJax

Yes, I am aware there is an ability to use mathjax in md similar to rst. That is not what I am referring to. There are more things beyond executable docstring examples and live tutorials that have been enabled by the sphinx ecosystem.

I’ll experiment with the available options and follow up with results and a recommended approach once I have something concrete.

Sorry, I do not have the capacity to review these changes. Good luck.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification.

Just to align on next steps: I currently have a working PR that deploys the existing Sphinx documentation to GitHub Pages. The idea of switching to MkDocs came up during discussion, but I want to be careful not to move forward without explicit agreement.
Before I continue further, could you please let me know what you’d prefer?

Should I stop here and keep this PR focused only on the Sphinx to GitHub Pages deployment, or
Would you like me to proceed with a full MkDocs migration?

I’m happy to follow whichever direction makes the most sense for the project, just wanted to check before investing more time. Thanks!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd opt for an all-or-nothing. The point of switching to GH-pages is to use mkdocs, so I'd opt to have this done in one PR

Copy link
Copy Markdown
Contributor Author

@manasa-manoj-nbr manasa-manoj-nbr Feb 6, 2026

Choose a reason for hiding this comment

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

Ok. Then I'll continue to work on it. Thanks

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

I have completed the basic conversions(.rst to .md) and starting to look ahead at converting the remaining Sphinx-specific pieces, especially:

  • the example .py files currently rendered via Sphinx Gallery
  • the API reference that is generated directly from the Python package structure

From what I’ve found so far, MkDocs doesn’t seem to have a direct equivalent to Sphinx Gallery (i.e., executing and rendering .py example scripts as tutorials). One possible workaround I came across is mkdocs-jupyter, which renders notebooks (or converts .py to .ipynb), but adopting this would likely require restructuring the examples and possibly how the API reference is organized.

Does this sound reasonable, or is there an alternative approach or existing reference you’d suggest for handling this in the MkDocs ecosystem? @vprusso

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 8, 2026

From what I’ve found so far, MkDocs doesn’t seem to have a direct equivalent to Sphinx Gallery (i.e., executing and rendering .py example scripts as tutorials).

A quick Google search seemed to bring this up. Thoughts?
https://smarie.github.io/mkdocs-gallery/

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

From what I’ve found so far, MkDocs doesn’t seem to have a direct equivalent to Sphinx Gallery (i.e., executing and rendering .py example scripts as tutorials).

A quick Google search seemed to bring this up. Thoughts? https://smarie.github.io/mkdocs-gallery/

Oh Cool. I guess this could work. I'll try and let you know

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

manasa-manoj-nbr commented Feb 11, 2026

From what I’ve found so far, MkDocs doesn’t seem to have a direct equivalent to Sphinx Gallery (i.e., executing and rendering .py example scripts as tutorials).

A quick Google search seemed to bring this up. Thoughts? https://smarie.github.io/mkdocs-gallery/

Hi! I’ve completed most of the MkDocs migration (gallery, structure, navigation — just minor ordering left), and the API section is now linking correctly to the toqito functions.

I had one clarification regarding the API reference. By this, I mean the rendered documentation that comes directly from the module docstrings (e.g., functions like pauli_channel where the full docstring — math blocks, examples, jupyter-execute, references, etc. — appears in the docs).

Since these docstrings currently contain Sphinx-specific directives (.. math::, .. jupyter-execute::,), should I go ahead and fully convert them to a MkDocs-compatible format? Or would you prefer to keep them mostly as-is and ensure basic rendering works?

Just wanted to confirm before modifying those sections. @vprusso

image

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

This LGTM, @manasa-manoj-nbr --- great work!

I'm good on this unless @purva-thakre has anything to add.

Thank you @vprusso ! Working through this gave me a much deeper understanding of toqito, and I really enjoyed getting more familiar with the codebase along the way. I’m excited to contribute more to this project!
Looking forward to your review @purva-thakre

@purva-thakre
Copy link
Copy Markdown
Collaborator

Sorry, I still don't have the capacity to review this deeply.

@vprusso vprusso merged commit f4e7f6d into vprusso:master Feb 26, 2026
18 checks passed
@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 26, 2026

Merged. Nice work, @manasa-manoj-nbr !

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

Merged. Nice work, @manasa-manoj-nbr !

Thank You !

@purva-thakre
Copy link
Copy Markdown
Collaborator

Sorry, just took a quick look at the build. There are way too many DeprecationWarnings and Warning. It is very annoying to deal with errors like with this when you are working on adding a new page to the docs. Can these be fixed? Or an issue be opened for someone else to work on these?

https://github.com/vprusso/toqito/actions/runs/22471380440/job/65088918422

The footcitations/citations appear to be broken as well based on the build log.

image

The contributing guide is now out-of-date.

Does mkdocs not allow a user to navigate between different versions of the docs? This was straightforward with RTD.

The image in the readme (consequently the image for the landing page of the docs) is broken. IDK if it is an issue with this PR.

Why is there an output cell for some pages in the docs and not for others?

image image

Is it possible for the type annotations to not show up in a single line?
image

Maybe I am missing something here but why do the docstring examples appear before the parameter description?
image

@purva-thakre
Copy link
Copy Markdown
Collaborator

the citations in the docstrings could be broken too.

image

@purva-thakre
Copy link
Copy Markdown
Collaborator

There are some issues with how the references show up from bibtex.

image

@purva-thakre
Copy link
Copy Markdown
Collaborator

How does this work when I am adding a new page to the docs? Can I view the build via a PR?

@purva-thakre
Copy link
Copy Markdown
Collaborator

The examples gallery is still using rst format. One would want to switch to md, no? given that ability to use md was one the initial stated goal of this major change?

@purva-thakre
Copy link
Copy Markdown
Collaborator

purva-thakre commented Feb 27, 2026

cross referencing appears to be broken.

image image

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

Why is there an output cell for some pages in the docs and not for others?

image image

This is because the first one is from examples that is rendered by mkdocs-gallery and the second one is docstrings so it is run from markdown-exec/
So the difference in appearance isn’t accidental it’s due to the two separate execution/rendering tools being used.

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

The examples gallery is still using rst format. One would want to switch to md, no? given that ability to use md was one the initial stated goal of this major change?

I believe I had changed everything to .md , Can you give an example where it's still using .rst

@purva-thakre
Copy link
Copy Markdown
Collaborator

purva-thakre commented Feb 27, 2026

The examples gallery is still using rst format. One would want to switch to md, no? given that ability to use md was one the initial stated goal of this major change?

I believe I had changed everything to .md , Can you give an example where it's still using .rst

"""The Pusey-Barrett-Rudolph (PBR) Theorem
?

There are also rst files that exist but should be deleted?

@purva-thakre
Copy link
Copy Markdown
Collaborator

So the difference in appearance isn’t accidental it’s due to the two separate execution/rendering tools being used.

Is there no way to add an output cell for the docstring examples? They just show up weirdly formatted otherwise...

As stated earlier, I cannot review this deeply. Sorry. Took a quick look, made some suggestions. That is all I can do.

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

manasa-manoj-nbr commented Feb 27, 2026

The examples gallery is still using rst format. One would want to switch to md, no? given that ability to use md was one the initial stated goal of this major change?

I believe I had changed everything to .md , Can you give an example where it's still using .rst

I created a separate mkdocs/ folder for the new documentation setup and rendering. I didn’t delete the existing docs/ folder yet because I wanted to ensure everything works properly first. Once everything is stable and confirmed, I planned to clean that up as well.

@manasa-manoj-nbr
Copy link
Copy Markdown
Contributor Author

So the difference in appearance isn’t accidental it’s due to the two separate execution/rendering tools being used.

Is there no way to add an output cell for the docstring examples? They just show up weirdly formatted otherwise...

As stated earlier, I cannot review this deeply. Sorry. Took a quick look, made some suggestions. That is all I can do.

Thank you for the suggestions —I really appreciate it. I’ll go through them carefully and work on addressing the points you raised.

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented Feb 27, 2026

I believe this MR should resolve the failures:
#1435

Assuming it passes the pipeline, I'll go ahead and merge it in shortly.

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.

4 participants