Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional markdownGenerators config option #567

Merged
merged 2 commits into from
May 5, 2023
Merged

Add optional markdownGenerators config option #567

merged 2 commits into from
May 5, 2023

Conversation

jgarrow
Copy link

@jgarrow jgarrow commented May 4, 2023

Description

This PR adds an optional markdownGenerators config option to the docusaurus-plugin-openapi-docs plugin, allowing the user to optionally provide their own createApiPageMD, createInfoPageMD, or createTagPageMD 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 the markdown available for the template is already generated by the createApiPageMD, createInfoPageMD, and createTagPageMD 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

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@jgarrow jgarrow changed the title Add optional markdownGenerators config option Add optional markdownGenerators config option May 4, 2023
@jgarrow jgarrow temporarily deployed to default May 4, 2023 14:05 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented May 4, 2023

Visit the preview URL for this PR (updated for commit 6145daf):

https://docusaurus-openapi-36b86--pr567-gu6e56v7.web.app

(expires Sat, 03 Jun 2023 23:31:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@blindaa121 blindaa121 self-requested a review May 5, 2023 17:24
@blindaa121 blindaa121 added documentation Improvements or additions to documentation enhancement New feature or request labels May 5, 2023
Copy link
Collaborator

@blindaa121 blindaa121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening up this PR @jgarrow! I think this is a great option to provide users with more flexibility in customizing MD layouts. 🎉

@blindaa121 blindaa121 merged commit 746b809 into PaloAltoNetworks:main May 5, 2023
@welcome-to-palo-alto-networks
Copy link

🎉 Congrats on getting your first pull request merged! We here at Palo Alto Networks are so grateful! ❤️

@blindaa121 blindaa121 mentioned this pull request May 5, 2023
blindaa121 pushed a commit that referenced this pull request Nov 13, 2023
sserrata added a commit that referenced this pull request Nov 13, 2023
* prepare release v2.0.0

* update docs

* update compatibility matrix

* Update announcement banner

* Cherry-pick markdown generator changes #567 from v1

---------

Co-authored-by: Bryan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants