-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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-infra] Use markdownlint
to fix brand names
#42240
base: next
Are you sure you want to change the base?
Conversation
'search-replace': { | ||
rules: [ | ||
{ | ||
name: 'non-breaking-space-in-brand-names', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going with this, I think we can remove https://github.com/mui/material-ui/blob/next/docs/mui-vale/styles/MUI/MuiBrandName.yml and fully rely on markdownlint
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have tried using the Vale VS Code extension and keep everything in Vale?
edit: I saw your comment related to this after posting.
Netlify deploy previewhttps://deploy-preview-42240--material-ui.netlify.app/ Bundle size report |
.markdownlint-cli2.cjs
Outdated
'Pigment CSS', | ||
], | ||
replace: [ | ||
'Material UI', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
If we just do this in markdown, and it's automated, would it make sense to use entities?
'Material UI', | |
'Material UI', |
That way it's more explicit, it feels a bit magic to me otherwise.
package.json
Outdated
@@ -167,6 +167,7 @@ | |||
"lerna": "^8.1.2", | |||
"lodash": "^4.17.21", | |||
"markdownlint-cli2": "^0.13.0", | |||
"markdownlint-rule-search-replace": "^1.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move this to "dependencies"
I believe Toolpad and X won't have to add this as a dependency as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels wrong, but it is convenient 😅
I'll move it to dependencies, thanks!
.markdownlint-cli2.cjs
Outdated
'MUI Toolpad', | ||
'MUI Connect', | ||
'Stack Overflow', | ||
'Pigment CSS', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe "Tailwind CSS" also breaks the Vale rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are many more entries in different files: https://github.com/mui/material-ui/tree/next/docs/mui-vale/styles/MUI
extends: substitution | ||
message: Use a non-breaking space (option+space on Mac, Alt+0160 on Windows or AltGr+Space on Linux, instead of space) for brand name ('%s' instead of '%s') | ||
level: error | ||
ignorecase: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that https://www.npmjs.com/package/markdownlint-rule-search-replace is case-sensitive. I tried using regexp in serachPattern
, but it's terribly slow.
Maybe moving it to markdowlint
wasn't a great idea 😅
@samuelsycamore Do you want to give vale VS Code extension a try? You will also need to install Vale
{ search: 'MUI Core', replace: 'MUI Core' }, | ||
{ search: 'MUI Toolpad', replace: 'Toolpad' }, | ||
{ search: 'MUI Toolpad', replace: 'Toolpad' }, | ||
{ search: 'MUI Connect', replace: 'MUI Connect' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ search: 'MUI Connect', replace: 'MUI Connect' }, |
We can remove this one — we don't use Connect anymore! 👍
{ search: 'Github', replace: 'GitHub' }, | ||
{ search: 'StackOverflow', replace: 'Stack Overflow' }, | ||
{ search: 'CSS modules', replace: 'CSS Modules' }, | ||
{ search: 'Tailwind CSS', replace: 'Tailwind CSS' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ search: 'Tailwind CSS', replace: 'Tailwind CSS' }, | |
{ search: 'TailwindCSS', replace: 'Tailwind CSS' }, |
The before should probably be this?
The brand names will be fixed automatically if the
markdownlint
VS Code extension is installed: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint