Closed favna closed 6 months ago
What you need to do here is keep the .md
extension and add this to docusaurus.config
markdown: {
format: 'detect'
},
This will ask Docusaurus to parse as CommonMark (not mdx) and will fix the error.
https://docusaurus.io/docs/markdown-features#mdx-vs-commonmark
Another tip (if you haven't worked it out) is to add this to your sidebar config. This will link the nav category item to the readme:
{
type: 'category',
link: {
type: 'doc',
id: 'Documentation/api-framework/index'
},
label: '@sapphire/framework',
items: require('./docs/Documentation/api-framework/typedoc-sidebar.cjs')
},
Thanks, that solution worked great!
What package is the bug related to?
docusaurus-plugin-typedoc
Describe the issue
When this plugin encounters a README that uses HTML for layout such as padding styling here: https://github.com/sapphiredev/framework/blob/35b7e1674db4d3430b841494b9066b2f581f4f62/README.md?plain=1#L23 this does not get converted to JSX compliant CSS and put 1:1 in the
index.mdx
file. Subsequently this causes build errors when runningdocusaurus build
(not when runningdocusaurus start
oddly enough). This is probably only a problem for the README file being picked up, because it is fairly safe to assume people wouldn't put div tags inside their TSDoc (I don't think that even works)The error is:
TypeDoc configuration
Expected behavior
The style tags get detected and converted to JSX compliant style so the site can build and render correctly.