Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deeply nested namespaces (#84) #85

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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