Skip to content

Commit

Permalink
Support deeply nested namespaces (Effect-TS#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
vecerek committed Nov 5, 2024
1 parent b77f746 commit 96403f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/witty-dryers-agree.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 1 addition & 2 deletions src/Markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 96403f6

Please sign in to comment.