Skip to content

Improve documentation versioning #3318

Closed

Description

@vikram-dagger

What is the issue?

Currently, 0.2 and 0.1 docs live in the same branch with unique file names and can be distinguished only by virtue of the displayed_sidebar metadata field in each file and the sidebars.js file, which lists the documents for each version via a sidebar navigation list. This creates a challenge for both internal and external authors, as they cannot easily identify which version of Dagger a specific document is associated with. They need to look into and understand the above fields/file to answer this question.

This task is to improve the current versioning system and simplify the above in preparation for the addition of v0.3 docs. The solution should meet the following goals:

  • not break existing URLs
  • make it easy to add newer versions in future
  • enable authors to add new documents for a specific version easily / without detailed Docusaurus understanding
  • allow some documents to be shared between multiple versions eg. contribution guidelines, community details
  • have docs coexist in the same repository as the product

Activity

  1. added
    area/documentation
    on Oct 11, 2022
  2. added this to the 0.3.0-alpha.N milestone on Oct 11, 2022
  3. vikram-dagger commented on Oct 11, 2022

    @vikram-dagger
    ContributorAuthor

    I investigated the following approaches:

    1. Docusaurus built-in versioning system
    2. Docusaurus multi-document instance
    3. Git-based versioning system
    4. Refinement of existing system based on sidebars and immutable page URLs

    Details on each one below:

    1. Each version of the docs is rendered at a specific sub-path eg. /0.1, /0.2 etc. Each version contains a physical disk copy of all files related to that version (ie. files shared between two versions will be duplicated on disk). All available versions are built at build-time, although specific versions can be selectively disabled if needed.

    Issues:

    • URLs will break because a v0.2 doc which lives at /xyz today may move to /0.2/xyz when v0.3 is released.
    • There is no mechanism to share files between versions.
    • Build overhead as all versions are built, unless explicitly configured not to. This can however be alleviated by using static snapshots of old versions.
    1. Each version of the docs is a separate Docusaurus website.

    Issues:

    • Significant overhead to maintain a separate Docusaurus website for each version. Maintenance of configuration, theming etc will be difficult.
    • There is no mechanism to share files between versions.
    • Each website lives at a different URL, therefore current URLs will break.
    1. This approach uses a separate Git branch for each documentation version ie. each branch is an immutable representation of the docs for the corresponding product version. Main branch corresponds to production version of Dagger, all other branches are built and inserted into the Docusaurus site as static snapshots.

    Issues:

    • Creating static snapshots of other branches and inserting them into the main branch is a multi-step process. This process will need to be performed every time changes occur in other doc branches.
    • If the docs theme changes, older branches will continue to use the old theme, creating some degree of UX dissonance.
    • For ease of use, this approach ideally requires docs to live in a separate docs repository (this could possibly be worked around with specific repository views)
    1. This continues to use the current system with the following refinements:
    • Docs are separated into directories, one for each version. Common docs are stored in a common folder and included via each version sidebar.
    • Document ids in the sidebars.js file are updated to reflect the new version-based directory structure.
    • To ease creation of new content, over the longer term, the new.sh script can be updated to accept a version number as input. It will use this to create the stub document and sidebar entry in the correct locations and with the correct metadata. In the short-term, README instructions to perform this task manually will suffice.

    As discussed with @gerhard today, I propose to move forward with 4 for the following reasons:

    • Essentially the same system as current, therefore tested and proven to work.
    • Separating code into version directories will streamline the structure and make it easier to work with for authors.
    • URLs remain the same.
    • Common files can be shared between versions.
  4. added a commit that references this issue on Oct 11, 2022
    ff09458
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/documentation

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions