Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate doc building with workflow #314

Open
flying-sheep opened this issue Sep 11, 2024 · 3 comments
Open

Investigate doc building with workflow #314

flying-sheep opened this issue Sep 11, 2024 · 3 comments

Comments

@flying-sheep
Copy link
Member

flying-sheep commented Sep 11, 2024

If RTD was a GitHub app, it would be super simple, but the way it is, maybe setting up sphinx-action + GitHub pages is easier? We could check.

Of course RTD has other advantages, such as /latest/ vs /stable/ and so on, which shouldn’t be ignored

@grst
Copy link
Collaborator

grst commented Sep 11, 2024

Last time I used such an approach, there were two downsides:

  • it's hard to keep multiple versions
  • github actions dont run on PRs from forks

But maybe there are solutions for this by now

@flying-sheep
Copy link
Member Author

flying-sheep commented Sep 11, 2024

Yeah, I was inspired by the workflow that came with the Markdown presentation tool Marp, because of its simple PR preview support. It works like this:

  1. configure GH pages the old way (deploy by pushing to gh-pages branch)
  2. build docs
  3. In PRs, rossjrw/pr-preview-action updates a directory in the gh-pages branch called pr-previews
  4. On the main branch, things are just deployed to the root of the gh-pages branch, ignoring the pr-previews directory

Future changes regarding forks:

Due to the security issues of the first approach, waiting for the second one is probably best.

@grst
Copy link
Collaborator

grst commented Sep 21, 2024

The native github preview mechanism sounds promising. Do you also have a solution for keeping different versions (and linking to them from the documentation)?
Afaik readthedocs somehow injects the version picker into the docs website after it is already built, which allows to pick newer versions from older docs.

I used to have something like that in scirpy before I moved to RTD, using some javascript hacks, but it wasn't the most elegant solution: https://github.com/scverse/scirpy/blob/6ccaa6673d3d043e1e7988e5c92c037ad2ffc713/docs/versions.rst?plain=1#L13-L21

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

No branches or pull requests

2 participants