Markdoc formatter
See original GitHub issueI need to write a script that modifies Markdoc files. Specifically, it will add an id
attribute to nodes that do not yet have one. For example, given the file:
# Debugging
# Running {% #running %}
I want to modify the file to:
# Debugging {% #d3adb33f %}
# Running {% #running %}
(Where d3adb33f
is some fresh identifier, e.g. a UUID.)
I want to do this transform with a pipeline like
input --[Markdoc.parse]--> AST -> --[custom logic]--> AST --[Markdown.stringify]--> output
However, I don’t see a Markdoc.stringify
, or a Node.toString
, or a Markdoc renderer, or anything like that.
Has anyone written a Markdown.stringify
or similar? Or could you recommend some other way to achieve my goals?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Markdoc | A powerful, flexible, Markdown-based authoring ...
Adopt anywhere. Use Markdoc to create interactive documentation experiences, static content sites, authoring tooling, and more.
Read more >markdoc/markdoc: A powerful, flexible, Markdown ... - GitHub
A powerful, flexible, Markdown-based authoring framework. Markdoc is a Markdown-based syntax and toolchain for creating custom documentation sites and ...
Read more >How Stripe builds interactive docs with Markdoc
Our custom authoring format, called Markdoc, was designed to decouple code and content while enforcing proper discipline at the boundaries.
Read more >Markdoc: A Markdown-based document format and framework ...
Markdoc is a Markdown-based document format and a framework for content publishing. It was designed internally at Stripe to meet the needs ...
Read more >Stripe Releases Markdoc! - Elaniin Blog
Markdoc is a Markdown-based syntax document, toolchain, and framework for ... However, it can be a fully declarative format that can be ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jameshfisher, no one has written this yet, but it is on our roadmap to do so. I will leave this issue open in case someone takes a stab at writing one 🙂
Going to close out this issue, with the existence of https://github.com/markdoc/markdoc/blob/main/src/formatter.ts.
If folks run into issues with the formatter (as I am sure there are still bugs), please open a new issue 👍.