-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: set markdown tabwidth: 4 #30608
base: main
Are you sure you want to change the base?
docs: set markdown tabwidth: 4 #30608
Conversation
the linter got me - working on a fix |
tagging another manager with the same prettier issue in #30569 - https://docs.renovatebot.com/modules/manager/conan/ |
The linter issue will need to be addressed in |
the following
which produces this output:
If we disable the two configs like shown here:
we get the following instead:
Removing https://github.com/renovatebot/renovate/blob/main/docs/usage/index.md?plain=1#L60 and re-running
However, this means these two list rules won't be evaluated. |
tagging our resident docs expert, @HonkingGoose, for an opinion/advice on these linter rules. |
First impressions/thoughts:
|
It was odd/unexpected for me as well. However it does appear to be a style opinion aimed at increasing readability for root-level lists.
I agree.
Unfortunately, it's complicated. My original opinion was we should leave things be the way they are, since the risk of making such a sweeping change (and possibly causing or uncovering more rendering/formatting issues) to fix a relatively benign problem seemed overkill. "Let sleeping dogs lie". However, it seems 4 space tab width is actually the more correct tab width for markdown in general, and perhaps this change should be made regardless. This drafted PR makes the change to 4 space tab width, but has made the linter very angry in the process. To solve the linter issue, However, from what I can tell, it appears that I think this leaves us with some options:
2 - Simple enough to fix now, but is there a way to automatically enforce this? As-in ban the structure or something? This feels limiting for doc writers. 3 - I have not been successful finding a way to adjust this behavior in prettier directly. I have only found ways to make the linter ignore this issue. FWIW, tldr; Every option has other problems from what I can tell. I could be missing something though. Thoughts from anyone? |
Others have similar problemsI searched the Material for MkDocs discussions. Others are having similar problems too:
Maintainer for Material for MkDocs formats manuallyThe maintainer of Material for MkDocs formats everything by hand. 1 That's okay, when you write most of the docs, and review all PRs. But we get many contributions, and I can't check them all. 😄 So we should keep using linters to format our code/docs. About your bullet items
TLDR
Yeah, all the solutions are good/bad in different ways. Maybe someone else has the perfect solution. 🙃 Footnotes |
I found this discussion: The maintainer of Material for MkDocs ( It's a bit scary making such a big change in settings. 🙂 |
Hmm, this comment in particular is unfortunate. It seems we're in agreement 4 space tab width is correct for Markdown, but the list issue is pretty ugly with the current linter + prettier. I still have not found a way to adjust the prettier 🤔 |
at least you can preview your changes now
|
@SnakeDoc thank you for attempting this fix, although I'm not sure if it's something we plan to move forward with? Could you summarize the latest status/plans? |
Thanks @rarkins. The original issue we were attempting to fix was identified in #30569 - nested markdown lists. Caused by a tabwidth conflict - It does appear 4 space tabs are more correct for markdown - however that change presently causes new problems that don't appear easily mitigated. Specifically, changing to 4 space tabs results in a conflict between To be clear - the conflict between In #30857 we added a I see three possibilities:
I am unsure how to proceed on this, or even if we should proceed at this point. |
Is there another possibility that we could leave the source files in this repo as prettier's default, but then add a "massage" function as part of our docs build to detect and modify nested lists prior to passing to mkdocs? |
I think Prettier is unlikely to add support for 4-spaces as tab-width, as they say they follow the CommonMark spec: But we could try to create a PR to support 4-spaces in ordered lists in the Markdownlint program? The maintainer says they're open to a PR: So we have a variant of option 1:
|
I find it hard to understand how we transform the input into the final docs build. Adding more steps to the build makes understanding the build even more difficult. For me, adding a massage step seems worse than fixing our source docs. I know we're a bit stuck on figuring out the best way to fix the source docs... 😄 If the maintainers decide that a massage step is the best way forward, that's fine by me too. |
Changes
PR as requested in #30569
Sets
.prettierrc.json
and.editorconfig
markdown config to use 4 space characters as tab width.pnpm doc-fix-everything
was run after the tab width changes, resulting in most or all markdown files being updated.Context
See discussion in #30569 regarding a possible markdown formatting conflict between prettier and mkdocs. This PR is to see what changing markdown
tabWidth: 4
would impact.Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: