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

Use prettier to format docs #4539

Closed
jeddy3 opened this issue Jan 11, 2020 · 3 comments · Fixed by #4588
Closed

Use prettier to format docs #4539

jeddy3 opened this issue Jan 11, 2020 · 3 comments · Fixed by #4588
Labels
status: wip is being worked on by someone type: infrastructure an improvement to devops

Comments

@jeddy3
Copy link
Member

jeddy3 commented Jan 11, 2020

We should use prettier to format the markdown documentation for consistency. (See #4435). At the moment I'm using "Save without formatting" whenever I work on markdown files in stylelint.

However, this will require us to add /* prettier-ignore */ comments inside our CSS examples which show idiosyncratic patterns. This should only be for the whitespace rules.

We'll also probably need to strip out these comments as part of the website transformation script.

Any objections to this proposal?

@jeddy3 jeddy3 added the status: needs discussion triage needs further discussion label Jan 11, 2020
@alexander-akait
Copy link
Member

No, 👍 for prettier

@jeddy3
Copy link
Member Author

jeddy3 commented Jan 16, 2020

I'll label this ready to implement as there are only thumbs up.

However, this will require us to add /* prettier-ignore */ comments inside our CSS examples which show idiosyncratic patterns.

I did a little more digging, and we should use <!-- prettier-ignore --> comments above our CSS examples, rather than /* prettier-ignore */ within them as the latter will show up in our docs. Fortunately, the prettier command comments exclude the next node in the abstract syntax tree from formatting so implementing this should be a find and replace on CSS opening code fences, rather than anything more time-consuming.

I'll implement after we merge #4548.

@jeddy3 jeddy3 added status: blocked is blocked by another issue or pr type: infrastructure an improvement to devops and removed status: needs discussion triage needs further discussion labels Jan 16, 2020
@hudochenkov
Copy link
Member

To clarify, we need to add ignore comments before every ```css, ```scss, and ```less blocks. And will have to always remember to add these comments (and tell our contributors) before every rule in future. (Or write a remark plugin to check this).

@jeddy3 jeddy3 added status: wip is being worked on by someone and removed status: blocked is blocked by another issue or pr labels Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: infrastructure an improvement to devops
3 participants