Add optional markdownGenerators
config option
#567
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an optional
markdownGenerators
config option to thedocusaurus-plugin-openapi-docs
plugin, allowing the user to optionally provide their owncreateApiPageMD
,createInfoPageMD
, orcreateTagPageMD
functions. If not provided, the plugin defaults to the existing functions of the same name.Motivation and Context
This change allows for a high level of customization for layout and styling. While the
template
config option exists, it doesn't allow for large layout changes since themarkdown
available for the template is already generated by thecreateApiPageMD
,createInfoPageMD
, andcreateTagPageMD
functions.How Has This Been Tested?
I installed a fresh Docusaurus site with this update, passing in the different config options for
markdownGenerators
that return strings with different content or layouts than the defaults. Excluding any of these options successfully falls back to the original behavior.Types of changes
Checklist