-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: add markdown linting and fix errors #1091
Conversation
added a rule to warn when headings increment more than 1 level at a time. ⨎ npm test
> specs-new@1.0.0 test /Users/oli/Code/filecoin-project/specs
> remark content --quiet
content/algorithms/porep/stacked_drg_circuit.md
10:1-10:25 warning Heading levels should increment by one level at a time heading-increment remark-lint
content/libraries/drand/_index.md
25:1-25:29 warning Heading levels should increment by one level at a time heading-increment remark-lint
⚠ 2 warnings |
ok this is starting to feel nice... added a rule to warn when code fences do not have a language flag ⨎ npm test
> specs-new@1.0.0 test /Users/oli/Code/filecoin-project/specs
> remark content --quiet
content/algorithms/crypto/signatures.md
64:1-66:4 warning Missing code language flag fenced-code-flag remark-lint
content/algorithms/porep/stacked_drg.md
255:1-257:4 warning Missing code language flag fenced-code-flag remark-lint
260:1-262:4 warning Missing code language flag fenced-code-flag remark-lint
content/algorithms/post/election_post.md
213:1-221:4 warning Missing code language flag fenced-code-flag remark-lint
content/libraries/drand/_index.md
29:1-35:4 warning Missing code language flag fenced-code-flag remark-lint
⚠ 5 warnings |
Added rule to ensure all docs start with an h1 ⨎ npm test
> specs-new@1.0.0 test /Users/oli/Code/filecoin-project/specs
> remark content --quiet
content/implementations/lotus.md
17:1-17:9 warning First heading level should be `1` first-heading-level remark-lint
⚠ 1 warning |
made a custom lint rule to warn aginst our pattern of putting a horizontal rule after a heading... to fix #1081 see: https://github.com/olizilla/remark-lint-no-hr-after-heading content/systems/filecoin_vm/sysactors/cron_actor.md
11:1-11:4 warning Don’t use a horizontal line after a heading no-hr-after-heading remark-lint
content/systems/filecoin_vm/sysactors/init_actor.md
11:1-11:4 warning Don’t use a horizontal line after a heading no-hr-after-heading remark-lint
content/systems/filecoin_vm/sysactors/reward_actor.md
10:1-10:4 warning Don’t use a horizontal line after a heading no-hr-after-heading remark-lint
⚠ 138 warnings |
plugins: | ||
# make remark aware of fontmatter. | ||
remark-frontmatter: | ||
# sensible linter defaults see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-recommended#rules |
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 is where we configure what markdown linting rules we want. we start with a preset with a bunch of rules enabled, then add some of our own, then remove some of the preset rules that were too noisey
@@ -31,8 +27,6 @@ This circuit proves that given a Merkle root `CommD`, `CommRLast`, and `commRSta | |||
- otherwise, execute the function | |||
- **Inclusion path**: Binary representation of the Merkle tree path that must be proven packed into a single `Fr` element. | |||
|
|||
# Offline PoRep circuit |
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.
Bring this back says @hugomrdias
@hugomrdias fixed merge conflict and the drg header nesting, and added a note about Good to merge? |
adds remark-lint as a fancy and configurable markdown lintert that we can tweak to help us write better specs. License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
adds remark-lint-heading-increment to warn when headings increment with more than 1 level at a time. see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-heading-increment License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
adds remark-lint-fenced-code-flag to ensure code fences have a language flag License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
adds remark-lint-first-heading-level - warn when the first heading has a level other than 1 License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
Adding horizontal rules under headings leads to inconisistent heading levels getting underlined, as we re-write the headings based on depth in the tree. We can underline h1/h2s with css if required. fixes #1081 License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
e35d232
to
9f99146
Compare
Adds remark-lint as a fancy and configurable markdown linter that we can tweak to help us write better specs.
I have fixed markdown errors as I've added rules, including multiple broken links and missing code blocks. The current output of the linter is clean on this branch, and I've enabled it in CI.
Run
npm test
to try it out. Example output:License: MIT
Signed-off-by: Oli Evans oli@tableflip.io