-
Notifications
You must be signed in to change notification settings - Fork 269
feat: add support to info, and tag, and schema custom tamplates #1122
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
feat: add support to info, and tag, and schema custom tamplates #1122
Conversation
0c49a9b
to
ba48227
Compare
Visit the preview URL for this PR (updated for commit 6384916): https://docusaurus-openapi-36b86--pr1122-kpluffsy.web.app (expires Wed, 14 May 2025 14:28:01 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
Thanks @fernandoseguim... For some reason, the |
@sserrata thanks for your feedback. It worked well in my tests, but please give me a day to double-check on my side. |
@sserrata the Introduction page (doc/page) is indeed being affected by the template that references api.mustache. I removed a condition in this commit to fix this. I tested it locally and didn’t notice any side effects in other places. I was expecting the same behavior to apply to the category page (/category/petstore-api), but that doesn't seem to be the case. I couldn’t locate where infoTemplate is actually being used here. My intention is to customize (or hide) the dynamically generated cards. Maybe I’m looking in the wrong place. Do you have any suggestions? |
Hi @fernandoseguim, on second inspection, I think we introduced a regression with this PR, concerning info pages... With the previous behavior, we only applied the
I'm still investigating but my initial thought is to:
This should allow us to keep your changes while maintaining backward compatibility. |
Description
Added support for custom templates for different content types in the Docusaurus OpenAPI Docs plugin. The changes include:
Creation of custom Mustache templates for:
api.mustache
)info.mustache
)schema.mustache
)tag.mustache
)Updated Docusaurus configuration to support custom templates
Added necessary types and interfaces to support template functionality
Motivation and Context
Currently, the plugin only supports custom templates for generating markdown files for API endpoints. This limitation makes it difficult for users to customize other aspects of the documentation, such as info pages, schemas, and tags. By extending template support to these additional content types, users can now have full control over the documentation generation process and maintain consistency across all documentation sections.
How Has This Been Tested?
The changes were tested through:
Types of changes
Checklist
The changes are non-breaking and add a new feature that provides greater flexibility in customizing the generated documentation.