Skip to content

Proper documentation versioning #337

Description

@M-Lampert

Currently, we have paused the stable release of our documentation since we don't have a stable release yet. Before we publish our first stable release, we should change that. This includes the following changes:

Blocks versioning

  • docs-dev.yml:35 — drop mike set-default --push --allow-empty dev. This runs on every push to main and undoes docs-stable.yml:28, so the first merge after publishing release docs sends the root of www.pathpy.net back to the dev docs. The default should be owned by the stable workflow alone.
  • mkdocs.yml:82default: devstable. mkdocs-material flags a page outdated unless the current version's aliases match extra.version.default, so with dev every visitor to the release docs gets the "You're not viewing the latest version" banner from main.html:19-24. Use [stable, dev] if we want no banner on either.

Fixes

  • docs-stable.yml:28 — add --allow-empty. set_default only rewrites index.html; re-dispatching stable docs produces an empty commit and mike errors out. docs-dev.yml already passes it for this reason.
  • docs-stable.yml:3-4 — nothing triggers stable docs from a release, and with no ref input the job documents whatever ref it's dispatched from. Add a tag/release: trigger, or at least a ref input so it can't be run against the wrong commit.
  • mkdocs.yml:12edit_uri: edit/main/docs/ is baked into every build and feeds the Colab link at main.html:11, so the frozen 1.0.0rc1 docs will link to notebooks on main that have since moved on. Needs to be ref-dependent at build time.
  • docs-dev.yml:33mike delete --push $(mike list | grep dev | ...) resolves correctly once stable exists, but fails rather than no-ops when the substitution is empty (e.g. a rebuilt gh-pages). Worth guarding.

Remove Documentation comments

New Feature:
In addition to the warning that an outdated version is viewed, we could also add a warning if the dev version is viewed, since that might contain content that is not released yet. It could be added in docs/overrides/main.html as follows:

{% block announce %}
  {%- if config.extra.docs_version.endswith("-dev") -%}
    You're reading the development docs — features documented here may not be in a
    released version yet.
    <a href="{{ '../' ~ base_url }}/stable/"><strong>Go to the latest release.</strong></a>
  {%- endif -%}
{% endblock %}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions