decentralized-identity / spec-up

Create beautiful, feature-rich technical specifications in markdown
https://identity.foundation/spec-up/
Apache License 2.0
34 stars 28 forks source link

Publishing different versions of a spec at the same time? #67

Closed swcurran closed 1 month ago

swcurran commented 1 month ago

Is there a way to publish from the same repo multiple versions of a spec, with a drop down to choose the right version?

I've done this with mkdocs (example: https://aca-py.org -- see the dropdown in the header). Versioning is built into mkdocs material and uses a capability called Mike that (AFAIK) that takes a set of generated pages and pushes them into gh-pages so that they never have to be touched again. You can see what Mike produces by looking at the content for the ACA-Py site's gh-pages using a GHAction. The GHA generates the static content in the docs folder for a given branch, then tells Mike the version, and Mike creates and pushes that static content as a named folder in gh-pages. The mkdocs part is the dropdown selector that is placed in all versions and driven by the Mike-generated versions.json file.

I think the pieces are there to do this for Spec-Up as well, but I don't have the chops to do that.

The alternate I see is to duplicate the repo and publish the spec-up pages from a fixed branch in the new repo. I can, and probably will do that, but would love it if someone wanted to take a look at Mike...

andorsk commented 1 month ago

Same repo, multiple specs yes. Check out. https://identity.foundation/presentation-exchange/ https://github.com/decentralized-identity/presentation-exchange/blob/main/specs.json Not sure if we can get a dropdown without a patch though.

swcurran commented 1 month ago

Way cool — that is likely sufficient. I’ll experiment with that. I never noticed that the specs.json was an array — but the plural in the file name should have given me a clue...

For now, I forked our repo, branched at the version I wanted and played with the specs.json and header.md files in the branch.

What I need to do is get a snapshot of the MD files at a version copy them into a sub-directory, and they remain in the main branch. Good stuff.

Thanks — I’ll close this. Might want to put this into the documentation. No promises, but perhaps I’ll do a PR.