Conversation
This is a preliminary step for creating a versioned website. We will not version the entire website (the _documentation_ section of the website does not need versioning), only the normative section. This means we need to clearly separate the normative section from the non-normative section. The "live" version of the spec will live under spec/. This commit moves all the files constituting the normative section under that directory.
Add redirects so that any link pointing to the old location of any of the spec page can still work, redirecting to the new location of the development version of the spec. This requires adding the `redirects` plugin to `mkdocs`. For the pages generated by LinkML for every classes and slots (which also used to be at the root level, and have now been moved to spec/), I don't really fancy adding an explicit redirect for every single of them, so instead, we simply build those pages _twice_: a first time in which we install the generated pages under spec/, and a second time in which the install the pages at the old location.
To be able to generate the doc for a previous release X.Y, we rely on a Git submodule in the directory `releases/vX.Y` pointing to a branch or tag corresponding to that release. Then we add a gendoc-vX.Y target, that will (1) copy all the files releases/vX.Y/src/docs/spec to docs/spec/vX.Y, and (2) generate all the LinkML-derived documentation from the schema found in the submodule (releases/vX.Y/src/sssom_schema/schema/sssom_schema.yaml) into docs/spec/vX.Y.
When running PyTest, we must explicitly tell it to ignore the releases/ directory (containing checked out submodules corresponding to past released versions).
|
Reviewers: if you want to test what the “versioned“ website would look like with this PR: git fetch origin
git checkout origin/publish-all-spec-versions
git submodule init
git submodule update
make gendoc-full serveThen navigate to |
matentzn
left a comment
There was a problem hiding this comment.
For me locally images didnt render:
My main problem is that its now very easy to go to the "wrong docs" (it does not matter what we mean by wrong here).
- the search indexes all sites equally without discrimination - and therefore becomes useless.
- There is no visual distinction on the pages of one version to which version it pertains (like on, say, w3org specs etc)
Why not use https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/?
| docs = [ | ||
| "mkdocs-material==9.0.0", | ||
| "mkdocs-mermaid2-plugin==1.1.1", | ||
| "mkdocs-redirects" |
There was a problem hiding this comment.
Maybe pin this as well just to be in the habit?
There was a problem hiding this comment.
I’d need a better reason that just “to be in the habit”.
I am against pinning in general unless it is justified.
There was a problem hiding this comment.
My opinion on this is super weak and could be overruled by a mild breeze: pinning development dependencies (like docs) seems to help keeping things running smoothly; i am totally against any kind of client facing runtime dependency pinning of course. Anywyas, up to you.
That’s a valid point, but I don’t see how versioning the entire website (as would be the case with https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/, compared to versioning only the normative section) would change anything to that?
This would create completely different websites for everything (not only the normative section, but all the non-normative documentation and other pages – e.g. credits, funding, etc. – as well). That seems completely overkill to me. |
I would not say its overkill. 80% of the users will use the dev site (which is default), and they can search it normally. the 20% will switch to the 1.0 version only if they care to look up stuff on the spec - they wont care about the outdated stuff. An the "overkill" here has multiple dimensions, why not use something out of the box rather than build it custom? Not convinced. |
Of course I will not admit that this has nothing to with the fact that I didn’t know about mkdocs-material versioning feature. :p |
Fine. :) Might as well close this PR then, because any solution based on https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/ would be so different that there is no point in using that PR as a basis. |
Resolves [#530]
docs/have been added/updated if necessarymake testhas been run locallytests have been added/updated (if applicable)CHANGELOG.md has been updated.This PR implements what has been proposed in #530: A website that shows, not just the current development version of the specification, but all previously released versions (currently only 1.0, since that’s the only release we have so far) as well.
This is done by:
(A) Moving all the normative pages of the website into
src/docs/spec(instead of leaving them insrc/docs). Strictly speaking this is not entirely necessary, but this allows to make a clear distinction between what part of the website is the actual spec, and what part is non-normative documentation. This is turn makes it easier to show different versions of the normative part on the same website.(B) For every past release X.Y (so, for now, only
1.0), we check out a Git submodule underreleases/vX.Y, pointing to a tag or branch corresponding to the X.Y release. Then we add a new Make targetgendoc-vX.Ythat (1) copies all files fromreleases/vX.Y/src/docs/spec/(that is, all the normative files from the X.Y version) into$(DOCDIR)/spec/v1.0and (2) generates the LinkML-derived documentation fromreleases/vX.Y/src/sssom_schema/schema/sssom_schema.yaml(the version of the schema as it was in the X.Y release) and puts them in$(DOCDIR)/src/v1.0.The
gendocMake target will produce a website containing only the development version of the spec. To build a website containing all versions, use the newgendoc-fulltarget.The end result is that, at any time:
https://mapping-commons.github.io/sssom/spec/will point to the current development version of the spec;https://mapping-commons.github.io/sssom/spec/vX.Ywill point to version X.Y.Because cool URIs don’t change, and since until now all the pages from the spec were directly under
https://mapping-commons.github.io/sssom/, the PR also adds all the necessary redirects to ensure that any URI pointing to an old location remains valid.