diff --git a/.changeset/witty-dryers-agree.md b/.changeset/witty-dryers-agree.md new file mode 100644 index 0000000..e0c2568 --- /dev/null +++ b/.changeset/witty-dryers-agree.md @@ -0,0 +1,7 @@ +--- +"@effect/docgen": patch +--- + +Support deeply nested namespaces. + +Previously, the docgen would fail with a `[Markdown] Unsupported namespace nesting: 4` error. With this change all namespace headers at depth level 3 and above would be rendered using H4 elements. diff --git a/src/Markdown.ts b/src/Markdown.ts index f6a21d6..2d30848 100644 --- a/src/Markdown.ts +++ b/src/Markdown.ts @@ -201,10 +201,9 @@ const getHeaderByIndentation = (indentation: number) => { return MarkdownPrinter.h2 case 1: return MarkdownPrinter.h3 - case 2: + default: return MarkdownPrinter.h4 } - throw new Error(`[Markdown] Unsupported namespace nesting: ${indentation + 1}`) } /** @internal */