Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow custom markdown templates for all generated docs #999

Closed
Labels
enhancementNew feature or request
@AnnaWinnick

Description

Is your feature request related to a problem?

I have been trying to create schema pages for my api within an autogenerated sidebar, but I have run into several situations where I feel like I am fighting this plugin to make the changes I would like.

Describe the solution you'd like

Along with solving this issue, enabling custom markdown templates for all api docs would be useful in allowing user customization and control.

I propose adding an additional templates section in the config (similar to markdown generators).

plugins: [
 [
 'docusaurus-plugin-openapi-docs',
 {
 id: 'openapi',
 docsPluginId: 'classic',
 config: {
 api-name: {
 specPath: "api.yaml",
 outputDir: "docs/generated",
 markdownGenerators: { 
 createApiPageMD: apiMarkdownGenerator,
 createSchemaPageMD: schemaMarkdownGenerator,
 }, 
 templates: {
 apiMDTemplate: apiMarkdownTemplate,
 schemaMDTemplate: schemaMarkdownTemplate,
 }
 showSchemas: true,
 } ,
 },
 },
 ]
 ],

Describe alternatives you've considered

Currently I have a patch package in place to edit the markdown templates in
docusaurus-plugin-openapi-docs/lib/index.js. I considered proposing a change only to allow schema page template edits, however it seems like there is opportunity for more generalization here while looking at this code portion.

Another way to solve this problem may be to include front matter in the markdown generator, however this seems like a greater lift.

Happy to help with a PR.

Additional context

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

        AltStyle によって変換されたページ (->オリジナル) /