Propose mdox for docs formatting and link checking#4196
Propose mdox for docs formatting and link checking#4196paulfantom merged 3 commits intoprometheus-operator:masterfrom
mdox for docs formatting and link checking#4196Conversation
CHANGELOG.md
Outdated
| `PrometheusRule` CRD. It addresses the need for rule syntax validation and rule | ||
| selection across namespaces. `PrometheusRule` replaces the configuration of | ||
| Prometheus rules via K8s ConfigMaps. There are two migration paths: | ||
| With this release we introduce a new Custom Resource Definition - the `PrometheusRule` CRD. It addresses the need for rule syntax validation and rule selection across namespaces. `PrometheusRule` replaces the configuration of Prometheus rules via K8s ConfigMaps. There are two migration paths: |
There was a problem hiding this comment.
Is there no line length limit in mdox? I don't see why we would like to switch from nicely formatted multiline text to single-line one. Especially since the latter one is harder to compare when using diff.
There was a problem hiding this comment.
For me, yes, it is. With multi-line, GitHub would present just a small part that has changed, here it presents one giant block of changed text. I don't see why I would need to go through a 400 char paragraph to figure out the PR is just fixing a simple typo. Plus, if a paragraph is very long, GitHub will collapse file change in diff view.
There was a problem hiding this comment.
Hi @paulfantom! mdox now supports preserving soft line breaks(bwplotka/mdox#75). This PR has been updated with the same! 🙂
paulfantom
left a comment
There was a problem hiding this comment.
This is converting all nicely formatted multi-line paragraphs into single-line ones. Having text written this way will create usability issues when using diff (for example in PRs).
|
Yea, that's kind of a feature, you don't need multi-line in practice - all tools are wrapping lines for you, so why doing this manual work? 🤔 It's hard to edit anything. In terms of diff, why there are usability issues? In terms of merging, you don't have correct merge options for human text anyway. 🤔 Anyway, we can add some option to wrap automatically to given length maybe, but to me there is no point ): |
bwplotka
left a comment
There was a problem hiding this comment.
Nice work, love it 👍🏽
It's up to all maintainers if they want this tool here, LGTM to me. Let's make sure everyone is happy.
CHANGELOG.md
Outdated
| `PrometheusRule` CRD. It addresses the need for rule syntax validation and rule | ||
| selection across namespaces. `PrometheusRule` replaces the configuration of | ||
| Prometheus rules via K8s ConfigMaps. There are two migration paths: | ||
| With this release we introduce a new Custom Resource Definition - the `PrometheusRule` CRD. It addresses the need for rule syntax validation and rule selection across namespaces. `PrometheusRule` replaces the configuration of Prometheus rules via K8s ConfigMaps. There are two migration paths: |
|
Looks like your point was addressed @paulfantom , do you think it's worth a try? (: cc @simonpasquier @fpetkovski |
paulfantom
left a comment
There was a problem hiding this comment.
Sorry, I was on vacation for the last few weeks.
It looks good from my side and I would love to see this merged. Could you rebase it so merge conflicts are solved?
Thanks for all your help! 💪 👍
|
@paulfantom I've rebased and updated mdox to latest. 🙂 |
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>

Description
This PR proposes the use of
mdoxfor formatting docs, both remote and local link checking, and for generating markdown code blocks within them.yaml mdox-exec="cat example/storage/storageclass.yaml".make docsandmake check-docsfor runningmdox fmtandmdox fmt --checkThis check currently skips all generated docs, as specified in
cmd/po-docgen.Doc transforming can be added later!
Note: Would need feedback on how Makefile and CI use mdox and if it can be better! 🙂
cc: @bwplotka
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
xin the box that apply.CHANGE(fix or feature that would cause existing functionality to not work as expected)FEATURE(non-breaking change which adds functionality)BUGFIX(non-breaking change which fixes an issue)ENHANCEMENT(non-breaking change which improves existing functionality)NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Changelog entry