-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Generate documentation for third-party packages similar to https://docs.rs/ #726
Comments
Regarding the use of recurring workflows, GitHub automatically disables recurring workflows if no repository activity is detected for 60 days: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#disabling-and-enabling-workflows |
Today I spent some time looking into this. One question that comes up is do we actually need this? For example, in the Ruby community it's common to just self-host the documentation (e.g. using GitHub Pages). While RubyDoc exists, I recall (back then I still actively used Ruby) that it wasn't always consistent in offering documentation (e.g. versions might be skipped due to build failures). Even then, many projects don't link to it as their main source of documentation. One option is that instead we publish a GitHub Action used for generating documentation and uploading it to GitHub Pages. This removes the need for a background service periodically checking what to update, and also gives package authors greater control (e.g. documentation is generated immediately after a release, not a few days later). |
Deploying with GitHub Pages is definitely possible using a workflow like this. The downside is that GitHub Pages doesn't support deploying to a directory, nor does it support incremental builds. This means that if you want to document multiple versions, you have to re-generate and re-deploy the data for each version every time. This isn't realistic though, as you may need different Inko versions and build steps for different version of a package. Artifacts and caches aren't persistent either, so neither can be used to reliably store the build output to allow for incremental builds. Tracking generated data in a separate branch (similar to how GitHub Pages used to work) isn't a viable option either, as Git isn't really meant for that sort of thing, and it requires a more complicated CI setup. This is the same problem as using Cloudflare Pages, hence we deploy to Cloudflare R2 for the manual and standard library documentation. |
Using https://github.com/JamesIves/github-pages-deploy-action it seems we could make it easier to commit changes to a separate branch, then deploy the aggregated result. The downside is that having a fat |
Actually, the presence of a |
Per https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#troubleshooting-publishing-from-a-branch, it seems that having GitHub Actions push changes to a While this is all very much doable, it feels a bit clunky to say the least. |
To further add: when publishing documentation, we also need some sort of "latest" tag similar to what we do with the standard library and manual. In addition, publishing a backport release shouldn't update such a tag (or the website as a whole in case of the current GitHub Pages setup). |
I think for simple libraries like inko-markdown, just using GitHub Pages to only host the latest version of the documentation is good enough. Most users are likely to use the most recent version of a library and thus its documentation. If one needs the documentation for the exact version used by their project, they can always generate their project's documentation locally and use At some point we may provide a hub of sorts, or maybe provide a better integration (e.g. some tool that uploads to S3/R2/etc), but for now I think we should just document a simple setup in the manual. |
I refactored the page about generating documentation in 1773c9e. As part of this I included an example workflow one can use to deploy documentation to GitHub Pages. This should be good enough for the time being. |
Description
With #333 completed, we now have the means to generate documentation for a project.
To make it easier to find documentation for existing projects, we should set up something similar to https://docs.rs/ that generates documentation for a list of projects.
Ideally this tool uses the list of packages found here, such that users don't need to submit their package to two different repositories.
A few challenges/questions present themselves when building this:
I feel a push model would be better instead of pulling, but this requires a mechanism by which users can submit a request to generate the documentation for a certain package.
One way we could do this is by tying it into the package list of the website: when the website generator updates the package metadata, it also triggers a CI build to generate the documentation for that project. This way the documentation portal doesn't have to maintain any state. The downside is that we currently only update the package list once a week, which may not be fast enough in the future, though we could allow users to manually submit a request of some sort at some point.
TODO
Related work
No response
The text was updated successfully, but these errors were encountered: