Skip to content

Multiple files and escaping #24

Description

@aymen3009

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions