Comments (13)
Thanks for the issue @lorenzolewis! Yes, absolutely something we’d like to support. This is a bigger feature and may take some time as we understand all the implications fully, but would love to use this issue to collect feedback and suggestions from anyone who has experience and ideas.
from starlight.
The Docusaurus approach certainly seems like the most simple from an implementation perspective, but I'm keen to hear the pain points there people have experienced!
There is lots of duplication and manual effort if you have documentation for something that changes fast (something like v3.1.1 -> v3.9.0 itself would lead to a huge repo).
The effort of managing directories and JSON sidebar configurations is much harder than just creating a git tag which can easily be automated in the CI.
from starlight.
I think that there is already a thread in discord, if you wanna join us. https://discord.com/channels/830184174198718474/1117052663520034866
from starlight.
Another project that implements this: https://docs.antora.org/antora/latest/content-source-versioning-methods/
from starlight.
A branch-based system would make Git a hard requirement for using Starlight which isn't the case currently, so that makes me a tiny bit hesitant. (Enabling our "last updated" feature does already rely on Git, but that's a much smaller scope than versioning.)
The Docusaurus approach certainly seems like the most simple from an implementation perspective, but I'm keen to hear the pain points there people have experienced!
from starlight.
I’m not even sure how or if Astro could successfully synthesize versions from different branches — you’d need some process that does something like repeatedly checking out and building version branches during the build step
On the Forgejo website we check out each branch of our docs repo as a submodule in a different directory. That way Astro can run on all the content at once.
from starlight.
Another project that implements this: https://docs.antora.org/antora/latest/content-source-versioning-methods/
I really like the approach they've gone with of using branches for the versioned docs content. That's what we've done with https://codeberg.org/forgejo/docs/, for which we'd really like to use Starlight once support for versioned docs is available.
from starlight.
The way I would like use versioning is a bit different compared to the normal workflow.
We have documentation that is generated from the source code, this means that a PR is merged, the documentation goes straight online.
We managed to mask the problem somehow, although it would be great if we could have some kind of "promotion" process. But versioning also works: next
and latest
will be the versions I could use .
from starlight.
Another project that implements this: https://docs.antora.org/antora/latest/content-source-versioning-methods/
I really like the approach they've gone with of using branches for the versioned docs content. That's what we've done with https://codeberg.org/forgejo/docs/, for which we'd really like to use Starlight once support for versioned docs is available.
ReadTheDocs also does this for multiple VCS.
I agree that branches for versioning are the best approach to take here. Folders can get tricky and start to require a lot of manual work, as is pointed out in the Docusaurus community. I think we should collaborate to chart this out and explore the many use cases and objectives so we can start, or help in building this.
from starlight.
I mean, the easiest way I think would be to just use the docs with v1 and v2 scheme. However, that would mean significant complexity for Starlight to recognize that.
The docusaurus approach on the other hand I like very much, but I often ran into issues like git conflicts and such. This was obviously due to my mistakes, but still, worth simplifying :)
from starlight.
True
from starlight.
If tracking a git tag, it becomes hard to update docs for a past version right? You essentially “freeze” docs but can’t go back and improve them. That wouldn‘t be the case with version branches, because you could continue to commit to an old version’s branch.
Even then, I’m not even sure how or if Astro could successfully synthesize versions from different branches — you’d need some process that does something like repeatedly checking out and building version branches during the build step like this:
git checkout main
npx astro build --outDir=./dist
git checkout v1
npx astro build --outDir=./dist/v1 --base=v1
git checkout v2
npx astro build --outDir=./dist/v2 --base=v2
I’d have to test but could imagine this causing issues with some CI providers too where not all branches may be cloned.
Maybe someone is up for testing this approach? I think in theory a bash script like the above may even work to some extent if suboptimal and with our new component overrides support adding some UI to the nav bar for switching versions could work.
N.B. the --outDir
argument doesn’t actually exist currently, so this would also need wiring up using an environment variable like:
// astro.config.mjs
defineConfig({
outDir: process.env.OUTDIR || 'dist',
})
OUTDIR=./dist/v1 npx astro build
from starlight.
A fully in memory way to read files from other branch/tag could be possible with isomorphic-git and BrowserFS (by using InMemory
, OverlayFS
and/or MountableFileSystem
).
In theory we can fetch and checkout another branch fully in memory. While I haven't tested this idea, I don't see a reason why it can't be achieved.
isomorphic-git have an interactive demo right in the browser: https://isomorphic-git.org/docs/en/quickstart
from starlight.
Related Issues (20)
- Can't deploy on Cloudflare HOT 1
- Left sidebar scroll bar problem HOT 2
- config options are not followed in pagefind search
- CSS not displaying on pages other than homepage HOT 4
- Hot Updates Reporting Errors Causing Project Crashes HOT 1
- Throws on reading `import.meta.env.BASE_URL` in Deno environment HOT 10
- Pagefind not working with PNPM and Firebase Hosting HOT 4
- do something about empty autogenerated sidebar groups HOT 1
- Astro devToolBar audit create a warning on code block HOT 4
- font not rendered correctly on firefox
- Language Select incorrectly appends locale when switching index pages HOT 5
- Mobile header cannot accumulate long documentation name and it covers search button HOT 1
- Table of Contents Glitch HOT 3
- Both dark and light Starlight appears when JS disabled HOT 1
- Letters get auto-generated in front of Frontmatter when have closing HTML tag in Markdown. HOT 4
- Embed Microsoft Video Not Working on Safari HOT 3
- Search not working in Cloudflare workers HOT 4
- Failing to import night-owl-dark.jsonc?raw HOT 10
- Select options are not centrally aligned HOT 2
- UI text not translated when creating a multilingual site with only one locale HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starlight.