Skip to content
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

Draft
wants to merge 6 commits into
base: next
Choose a base branch
from

Conversation

cherniavskii
Copy link
Member

The brand names will be fixed automatically if the markdownlint VS Code extension is installed: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint

@cherniavskii cherniavskii added the scope: docs-infra Specific to the docs-infra product label May 14, 2024
'search-replace': {
rules: [
{
name: 'non-breaking-space-in-brand-names',
Copy link
Member Author

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.

Copy link
Member

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.

@mui-bot
Copy link

mui-bot commented May 14, 2024

Netlify deploy preview

https://deploy-preview-42240--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against bbda3fd

'Pigment CSS',
],
replace: [
'Material UI',
Copy link
Member

@Janpot Janpot May 14, 2024

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?

Suggested change
'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",
Copy link
Member

@Janpot Janpot May 14, 2024

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

Copy link
Member Author

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!

'MUI Toolpad',
'MUI Connect',
'Stack Overflow',
'Pigment CSS',
Copy link
Member

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

Copy link
Member Author

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
Copy link
Member Author

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

.markdownlint-cli2.cjs Show resolved Hide resolved
{ search: 'MUI Core', replace: 'MUI Core' },
{ search: 'MUI Toolpad', replace: 'Toolpad' },
{ search: 'MUI Toolpad', replace: 'Toolpad' },
{ search: 'MUI Connect', replace: 'MUI Connect' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ 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' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ search: 'Tailwind CSS', replace: 'Tailwind CSS' },
{ search: 'TailwindCSS', replace: 'Tailwind CSS' },

The before should probably be this?

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: out-of-date The pull request has merge conflicts and can't be merged scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants