I've been using zod2md to generate API reference docs for a Docusaurus site and ran into two issues that I'd love to either see fixed or contribute to. Happy to open separate PRs if that's preferred.
linking issue
When a Zod schema in the entry file references a schema imported from another file, zod2md does not follow the import and link to the referenced schema. Instead, the type is anonymous inline objects.
formatting issue
The Markdown generated by zod2md is not safe for use in Docusaurus, which processes .md files through its MDX pipeline. TypeScript generic syntax inside <code> spans — such as Array<string> and Record<'de' | 'en', string>, causes a hard build error because MDX parses < as the start of a JSX tag.
Error
Error: MDX compilation failed
Cause: Unexpected character `'` (U+0027) before name, expected a character
that can start a name, such as a letter, `$`, or `_`
source: micromark-extension-mdx-jsx
Thanks for the great tool. The core functionality works really well. I'm happy to contribute fixes for either or both of these if you can point me in the right direction!
I've been using
zod2mdto generate API reference docs for a Docusaurus site and ran into two issues that I'd love to either see fixed or contribute to. Happy to open separate PRs if that's preferred.linking issue
When a Zod schema in the entry file references a schema imported from another file,
zod2mddoes not follow the import and link to the referenced schema. Instead, the type is anonymous inline objects.formatting issue
The Markdown generated by
zod2mdis not safe for use in Docusaurus, which processes.mdfiles through its MDX pipeline. TypeScript generic syntax inside<code>spans — such asArray<string>andRecord<'de' | 'en', string>, causes a hard build error because MDX parses<as the start of a JSX tag.Error
Thanks for the great tool. The core functionality works really well. I'm happy to contribute fixes for either or both of these if you can point me in the right direction!