@vellum-docs/language-server@0.3.0
Patch Changes
-
ad1aa14: Add
cellfilter +TypeString.onelinefor cell-safe renderingEvery adopter was hand-rolling the same 5-filter escape chain when dropping types or summaries into markdown table cells:
{{ m.type.text | replace("\n"," ") | replace(" ","") | replace("|","\\|") | replace("<","<") | replace(">",">") }}
Two additions collapse that:
TypeString.oneline?: string- populated at extraction time with the whitespace-collapsed form oftext. Omitted when equal totext(single-line case). Fixes the\n+ indentation problem at source, before any template filter runs.cellfilter (profile-routed) - accepts aTypeString, plain string, or null. Collapses whitespace as defence-in-depth, routes through the profile's newcell(value, ctx)method, which wraps in a code span and escapes|. Works for anything cell-bound, not just types.Before:
| `{{ m.name }}` | `{{ m.type.text | replace("\n"," ") | replace(" ","") | replace("|","\\|") | replace("<","<") | replace(">",">") }}` | {{ m.doc.summary }} |
After:
| `{{ m.name }}` | {{ m.type | cell | safe }} | {{ m.doc.summary | cell | safe }} |
Schema additions (additive)
TypeString.oneline?: stringRendererProfile.cell(value: string, ctx: RenderContext): string
Existing extractors keep working - when
onelineis absent the filter falls back to.text. Existing profiles get the new method implemented inMarkdownProfileandMintlifyProfile; third-party profiles must add acellimplementation.Out of scope
jsx-propandfencedcontexts from the original request. Neither has recurring template pain today; defer until they do. -
6503a35: Philosophy audit fixes - strict-by-default, dead schema cleanup
An audit against the newly-written PHILOSOPHY.md surfaced four gaps. This changeset closes them.
Strict template rendering is now on by default. Principle 11 ("fail loudly at build time") was being violated by
throwOnUndefined: false- a template with a typo ({{ fn.doc.summaryy }}instead offn.doc.summary) silently rendered as empty string, and the docs shipped with a blank section. TheNunjucksEnginenow defaults to strict rendering: any output of an undefined value throws, which bubbles to a non-zero build exit.Opt-out paths, for the rare cases where silent fallback is wanted during migration:
- Config:
new NunjucksEngine({ strict: false }). - CLI:
vellum build --no-strict.
This is a behavior change. Templates that relied on silent-empty for undefined values will now fail. Typical patterns that are still safe:
{% if sym.members %},{{ sym.doc.summary }}(empty string is defined),{% for m in sym.members or [] %}. The patterns that will now break are the ones you wanted to know about anyway.Schema cleanup. Three dead schema fields removed - they were defined but never populated by any extractor, violating principle 7 ("80% case defines the schema"):
Symbol.signatureResolved?: string- removed.Member.kindvalues'index'and'call'- removed from the union. Can be added back with implementation when a TS call/index-signature extractor lands or a language that needs them ships.
Docs drift fixes. ARCHITECTURE.md referenced a
{{ str | tsdoc }}filter that never existed; replaced with{{ sym | summary }}(which does). Principle 2 in PHILOSOPHY.md now explicitly distinguishes "pattern-aware" (OK) from "language-idiosyncratic" (not OK), soSymbol.discriminator?is consistent with the stated rule. - Config:
-
Updated dependencies [2a9986c]
-
Updated dependencies [ad1aa14]
-
Updated dependencies [6503a35]
- @vellum-docs/core@0.3.0