You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(api-markdown-documenter): Add documentation domain to mdast transformation (#24787)
Updates the library with a new transformation layer that converts the
`DocumentationNode` representation to
[mdast](https://github.com/syntax-tree/mdast), and replaces the
library's custom Markdown rendering with
[mdast-util-to-markdown](https://github.com/syntax-tree/mdast-util-to-markdown).
For an example of how the website build will be updated in response to
these changes, see here:
#25072.
<!-- NOTE: This section is automatically generated by embedding the referenced file contents. Do not update these generated contents directly. -->
@@ -289,6 +285,38 @@ If you would like to add rendering support for a custom `Documentation Domain` n
289
285
290
286
If you would like to change any or all of this library's default rendering policies, you may simply override the default policies for the desired `type`s.
291
287
288
+
### ToMarkdown Transformation
289
+
290
+
This library includes APIs for transforming `Documentation Domain` trees to Markdown syntax trees using [mdast](https://github.com/syntax-tree/mdast).
// Use the resulting Markdown documents with your favorite mdast-compatible library!
314
+
```
315
+
316
+
<!-- prettier-ignore-end -->
317
+
318
+
<!-- AUTO-GENERATED-CONTENT:END -->
319
+
292
320
### HtmlRenderer
293
321
294
322
This library includes APIs for HTML rendering.
@@ -367,10 +395,12 @@ Other validation may be added in the future as needed.
367
395
368
396
- Rather than repeatedly walking up a given `ApiItem`'s hierarchy when evaluating paths, links, etc., we could pass down transformation context object containing a running record of the item's hierarchy as we walk the tree.
369
397
370
-
## Longer-term work
398
+
###Longer-term work
371
399
372
-
- Add `documentToMarkdown` API that generates `mdast` output.
373
-
- Update Markdown rendering APIs to leverage the `mdast` and `hast` domain outputs.
400
+
- Replace [Documentation Domain](#documentation-domain) with `mdast`.
401
+
- The `mdast` ecosystem already supports conversion from `mdast` to HTML and other formats.
402
+
There really isn't a reason for this library to have its own proprietary format.
403
+
For the couple of special concepts this library does have (e.g. hierarchical sections with contextual heading levels), we can leverage `mdast`'s extensibility model.
0 commit comments