[DX-1717]Add taskfile with md:list and md:fmt targets #4321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests contains a draft Taskfile.yml. You'll need some software installed:
mdox fmt
The following taskfile targets are available:
A few issues have been filed upstream against mdox, some have work arounds when running
task md:fmt
:Additionally, md:list also reformats code blocks with a dot prefix (e.g.
.js
becomesjs
). This issue is more of a hugo validation issue. For the extremely wrong variants mdox does report issues when scanning.In order for this to be usable:
master
branch, and the PR branchtask md:fmt
and it will auto-correct any changes made in the PRIt's absolutely required to keep
master
in sync with the PR branch on local. If the PR gets rebased, and you don't update your local checkout of the master branch, additional files will be reformatted.Note: the tool also nicely reformats markdown tables, however more testing is needed to see if some unwanted behaviour occurs for the existing docs. Tested via #4186 ;
To use this for testing on PRs (before any merges are considered), fetch the file inside the root of the repository:
This lets you run
task md:list
to inspect which changes on a PR would be analyzed, andtask md:fmt
to run the formatters.