protobuffet / docusaurus-protobuffet

Docusaurus toolset for Protobuf contract documentation.
https://protobuffet.com
ISC License
38 stars 7 forks source link

Support user configuration of routeBasePath and path #2

Closed AnthonyBobsin closed 3 years ago

AnthonyBobsin commented 3 years ago

Context

Issue #1 reported that "protodocs" is hardcoded to both the routeBasePath and the path variables passed to @docusaurus/plugin-content-docs.

Problem

The configuration of this base route and docs directory are valid use cases and should be supported.

Solution

routeBasePath

path

Usage

To configure a different directory for documentation to be generated (npx docusaurus generate-proto-docs), configure protobuffet.protoDocsPath. Note, this will automatically be used for the directory where docs are read from when initializing @docusaurus/plugin-content-docs.

To configure a different base route for links, configure docs.routeBasePath.

Example:

[
      'docusaurus-protobuffet',
      {
        protobuffet: {
          fileDescriptorsPath: './fixtures/proto_workspace.json',
          protoDocsPath: './protodocs',
          sidebarPath: './generatedSidebarsProtodocs.js',
        },
        docs: {
          sidebarPath: './sidebarsProtodocs.js',
          routeBasePath: 'protodocs-test',
        },
      }
 ]
AnthonyBobsin commented 3 years ago

FYI @ashleyvega, I've got a working solution for issue #1 here. I'll close the issue once versions are deployed and documentation updated.