Can rumdl lint markdown in YAML files? #641
-
|
I've got some large AsyncAPI specs that feed into a docs pipeline, and I would love to be able to lint (auto-formatting is a stretch goal!) the markdown descriptions. Is that possible, without all the false positives that come with a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Markdown-in-YAML-field linting isn't built in yet: rumdl can lint markdown extracted from Rust doc comments and from fenced code blocks, but it has no YAML field extraction. And you're right that a What works today, using rumdl's stdin support plus yq '[.. | select(has("description")) | .description] | join("\n\n")' spec.yaml \
| rumdl check --stdin --stdin-filename spec-descriptions.mdThis pulls every Your auto-format stretch goal works too - swap yq '[.. | select(has("description")) | .description] | join("\n\n")' spec.yaml \
| rumdl fmt --stdin -Two caveats:
Native field extraction isn't on the roadmap right now, but the pipe above should keep your docs pipeline covered. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, @rvben! This was super helpful. |
Beta Was this translation helpful? Give feedback.
Markdown-in-YAML-field linting isn't built in yet: rumdl can lint markdown extracted from Rust doc comments and from fenced code blocks, but it has no YAML field extraction. And you're right that a
[per-file-flavor]YAML entry would lint the whole file as markdown, which floods you with false positives on the YAML syntax itself.What works today, using rumdl's stdin support plus
yq:This pulls every
descriptionout of the spec, joins them into one markdown document, and lints it. I tested it against the official AsyncAPIstreetlights/slack/gittere…