- Updates
TSDoc
node handling to emit a warning in place of an error when an embeddedHTML
tag is encountered. Also updates the logged notice to include the tag that was encountered. - Fixes a bug where the default transformation for the
API Model
page did not correctly account for theskipPackage
configuration, and would list packages that were not intended for inclusion in the generated docs suite.
- Updates HTML rendering APIs to operate on
HAST
domain trees fromdocumentToHtml
, and leverage existing rendering libraries (hast-util-to-html and hast-util-format) rather than maintaining bespoke rendering code.- Updates existing
HtmlRenderer.renderApiModel
andHtmlRenderer.renderDocument
APIs to leverage the new flow. - Also adds
HtmlRenderer.renderHtml
function for direct rendering ofHAST
format generated bydocumentToHtml
.
- Updates existing
- Fixed a bug where text formatting was not applied correctly in some cases in the
toHtml
transformation.
- Formatting of generated HTML strings changes with this update.
- Support for embedded HTML contents in TSDoc comments has been removed. The TSDoc parser has some half-baked support for preserving HTML tags in its output, despite the TSDoc spec making no claims about supporting embedded HTML. But it does so in a structure that is difficult to handle correctly, assuming that the output language can support arbitrary HTML contents, and that it is safe to output the contents raw and unsanitized. As a result, this library's support for such contents was similarly half-baked, and difficult to maintain. VSCode Intellisense, as a comparison, chooses to completely ignore HTML tags, and simply render the inner contents ignoring any HTML decorators. This library has adopted the same policy. If you depended on HTML content preservation, this change will break you.
- Promote
toHtml
transformation functions to@public
. Updates the API surface to be more flexible, allowing users to specify only a partial config, or the full transformation context if they have it.
- Added the following new utility function to
ApiItemUtilities
:ancestryHasModifierTag
: Checks if the provided API item or ancestor items are tagged with the specified modifier tag.
- Adds prototype functionality for "linting" an API Model (i.e., the set of packages whose docs are published as a single "suite").
Can be invoked by importing
lintApiModel
from@fluid-tools/api-markdown-documenter/beta
. Returns a set of TSDoc-related "errors" discovered while walking the API Model.- The primary goal of this tool is to detect issues that
API-Extractor
cannot validate on a per-package basis when generating API reports. For now, this is limited to validating@link
and@inheritDoc
tags to ensure that symbolic references are valid within the API Model.
- The primary goal of this tool is to detect issues that
- Updated
loadModel
to take a configuration object, rather than individual parameters.- Also allows default use of the console logger when no logger is explicitly given.
- Added the following new utility functions to
ApiItemUtilities
:getCustomBlockComments
: Gets all custom block comments associated with the provided API item.- Will not include built-in block comment kinds like
@see
,@param
, etc.
- Will not include built-in block comment kinds like
getModifierTags
: Gets all modifier tags associated with the provided API item.- Will include built-in modifier tags like
@sealed
, release tags, etc.
- Will include built-in modifier tags like
hasModifierTag
: Checks if the provided API item is tagged with the specified modifier tag.
- The following existing APIs were updated to return
readonly
arrays, where they were not previouslyreadonly
:getExampleBlocks
getSeeBlocks
getThrowsBlocks
- Allow configuration of "alerts" in child item tables.
- Default behavior can be overridden via the the
getAlertsForItem
option.
- Default behavior can be overridden via the the
- Update default policy for
getHeadingTextForItem
to not insert(BETA)
and(ALPHA)
postfixes based on release tags. If this is the desired behavior, it can be replicated by overridinggetHeadingTextForItem
to do so.
- Removed support for generating front-matter.
Front-matter generation was never properly designed, and did not fit well into the transformation flow as it was implemented.
If you require front-matter in the documents you generate, you can inject it by rendering the
DocumentNode
s generated bytransformApiModel
.
- Fixed an issue where variable item tables did not include type information in default ApiItem transformations.
- Add variable and property type information to associated details sections in default ApiItem transformations.
- Further improved error messages when an unexpected child kind is encountered when iterating over children in default ApiItem transformations.
- Improved error messages when an unexpected child kind is encountered when iterating over children in default ApiItem transformations.
- Added functionality for transforming Documentation Domain trees to hast.
The main entrypoint for this is:
documentToHtml
. - Updated the package to emit ESM only.
- Fixed a bug where inline tags (other than
{@link}
and{@inheritDoc}
, which are handled specially by API-Extractor) were not handled and resulted in errors being logged to the console. Such tags are now handled in the following way:- {@label} tags are simply omitted from the output (they are intended as metadata, not documentation content).
- Other custom inline tags are emitted as italicized text.
- Fixed a bug where pre-escaped text contents (including embedded HTML content) would be incorrectly re-escaped.
- Fixed a bug where type parameter information was only being generated for
interface
andclass
items. - Adds "Constraint" and "Default" columns to type parameter tables when any are present among the type parameters.
- Fixed a bug where getter/setter properties under interface items did not get documentation generated for them.
- The package now outputs ESM only. Consumers will have to migrate accordingly.
DocumentationNode
now has a requiredisEmpty
property. Implementations will need to provide this.- Update the signature of
createTypeParametersSection
to always generate aSectionNode
when called, such that consumers don't have to handle a potentially undefined return value. If the consumer wants to omit the section (for example when the list of type parameters is empty), they can make the call conditional on their end. - Removed
createDocumentWriter
, and exportedDocumentWriter
is now an interface rather than a class. ADocumentWriter
may be instantiated viaDocumentWriter.create
(or you can use your own implementation, which was not previously supported). - Update
typescript
dependency from4.x
to5.x
.