-
Notifications
You must be signed in to change notification settings - Fork 49
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
Versioned documentation #100
Comments
|
Can publish from maintenance branches without breaking new thingsThis can be done by tweaking GhPagesKeys.synchLocal - https://github.com/sbt/website/blob/c1b34210ac22f8fedc929612835e41c20f291bea/project/Docs.scala#L162-L178 |
EOL versions can easily point to a maintained versionFor sbt, there's a one-liner js file that lists available documentation sites (https://github.com/sbt/sbt.github.com/blob/master/assets/versions.js): var availableDocumentationVersions = ['1.x', '0.13', '0.12.4', '0.7.7'] and |
Thanks for chiming in Eugene :) Politely pinging @jenshalm; if you have a chance, I would appreciate your insight on how we might implement some of these ideas with Laika. Thanks! |
EOL versions are not indexed by GoogleThis might be related to release cadence. For sbt, we have a documentation for "1.x", so we keep appending new features we add in the minor version 1.1.x, 1.2.x, etc onto the same site, and disallow indexing of old documentations or version-specific Scaladoc API - https://github.com/sbt/sbt.github.com/blob/master/robots.txt |
@armanbilge As you know, many of the listed versioning features come out of the box with Laika, maybe apart from linking between versions which is not straightforward (would only work in a non-validated fashion, as the version indexing only scans and saves the files that exist per version, not the targets within that file). So unless you have more concrete questions, I can only think of a few high-level recommendations at the moment:
|
@jenshalm thanks for your advice, and all the work you did on http4s :) I guess mostly I'm confused about the
Btw, I did create a Laika integration in sbt-typelevel for unversioned sites, and a few Typelevel projects have already adopted it. Would you mind having a look in case I did it wrong?
http://typelevel.org/sbt-typelevel/ |
@armanbilge Happy to have a look at the plugin over the weekend. Regarding your questions:
|
@jenshalm thank you very much, that explanation was very helpful and I think I understand how it works now :) Going through Ross's wishlist it seems straightforward to support:
|
It would be nice to have a turnkey solution for projects that wish to support versioned documentation.
Requirements
Table stakes
Nice to have
Extra credit
/stable/*
redirects to the latest stable version, like Read The Docs. This was possible on Netlify, which is an administrative headache. This is impossible on gh-pages.Prior art
http4s
The
/docs
directory on live branches publishes to a subdirectory of the gh-pages branch. The/website
directory is published off main and contains the project information that pertains to all branches.Because each branch publishes independently, there is no way to update the theme across the board, nor a way to automatically update the version selector on old branches when release statuses change. Care must be taken to not touch anything outside that subdirectory.
cats-effect
I don't know how it works. Submodules and stuff. Generates crufty PRs, but the end user experience is best-in-Typelevel.
Monix
Has also been doing it for years in an artisanal fashion.
Other Scala projects that do a nice job and are worth studying
Other tooling
Laika has multiple version support, and sbt-typelevel already integrates Laika
Other ideas
All of these are based on the idea that the site generator runs once, instead of independent sites per version and for the common area. This raises a basic tradeoff:
Publish mdocs per branch, separate job generates the site
Requires careful git exclusions. Is the most economical with CI time.
mdoc all the branches and generate the site in one job
Awfully slow for large projects.
Parallelize building all branches, upload artifacts, generate in separate job
It's a heavy build, but it avoids git exclusions
The text was updated successfully, but these errors were encountered: