Support for loading custom Markdown files
This PR adds the following features:
- support for loading arbitrary markdown files from the file system tree
- support for
_spec_.{yaml,yml,json}files, which do not generate a new category - support for sorting categories and items in the sidebar using
_category_or front matter in custom mdx files
Solves:
- https://github.com/cloud-annotations/docusaurus-openapi/issues/135
- https://github.com/cloud-annotations/docusaurus-openapi/issues/136
- https://github.com/cloud-annotations/docusaurus-openapi/issues/137 (using
_spec_, but we can change this)
Example
File tree (notice examples/custom-overview.md, examples/petstore/_spec_.yaml, examples/petstore/my-intro.md):
Results:
@bourdakos1 I would love your review on this.
There are a lot of changes in the diff, but most of the stuff (the one in packages/docusaurus-plugin-openapi/src/docs/) has been taken and "tree-shaked" from the original plugin-content-docs plugin (they don't export those functions, unfortunately).
Deploy Preview for docusaurus-openapi ready!
| Name | Link |
|---|---|
| Latest commit | 4c1ab36c4e2f128f3f45f5e54896265087813207 |
| Latest deploy log | https://app.netlify.com/sites/docusaurus-openapi/deploys/62e8e536d04ee8000800ada0 |
| Deploy Preview | https://deploy-preview-193--docusaurus-openapi.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Is this ready for review?
@bourdakos1 It is ready, I am just making some minor linting fixes
It will probably take me a few days to review this, but Iām excited for the update š
fixed a bug where the slug property wasn't properly recognized
The "My Custom Petstore" / "My Intro" page doesn't load for me
My bad, I forgot to push stuff. Could you try it again?
Great feature! Do you have plans to release a new version of the package on npm? I'm interested using this feature too :)
Thank you!