Skip to content

Support for Generated Navigation #398

Open
@pvande

Description

@pvande

As some background, I'm looking to make docs.page work with automatically generated API documentation. The tool that I'm using to generate my docs is aware of the hierarchy being modeled, and can express that as JSON, but generally shouldn't be responsible for writing or updating the docs.json file.

I'd ideally like to be able to manually maintain my own docs.json file — allowing for control over title, description, and some general navigation — and "embed" the generated navigation details myself.

Strawman proposal:

// docs.json
{
  "name": "Example Project",
  "sidebar": [
    {
      "pages": [
        {
          "title": "Welcome",
          "href": "/"
        },
        {
          "title": "Getting Started",
          "href": "/"
        },
        {
          "group": "API Docs",
          "load": "/docs/api-sidebar.json",
        }
      ]
    }
  ]
}
// docs/api-sidebar.json
{
  "pages": [
    {
      "title": "Foo",
      "href": "/api/foo"
    },
    {
      "title": "Bar",
      "href": "/api/bar"
    },
    {
      "title": "Baz",
      "href": "/api/baz"
    }
  ]
}

I can also see this being useful for variables and tabs as well, possibly elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions