-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fixes codeblock indentation in order to make them actually work #184
Conversation
✅ Deploy Preview for aya-rs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks a lot for the fix! 🙂
Unfortunately, markdownlint complains about that:
Error: docs/book/programs/cgroup-skb.md:43 MD046/code-block-style Code block style [Expected: indented; Actual: fenced] https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md046.md
But honestly, I think this error is 🐂 💩, since the "indented" code blocks simply don't work.
So I think we could just try to ignore that error. According to:
https://github.com/DavidAnson/markdownlint-cli2-action?tab=readme-ov-file#config-optional
https://github.com/DavidAnson/markdownlint-cli2
We could try changing the markdownlint job definition in .github/workflows/ci.yml
to:
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: .markdownlint.json
globs: '**/*.md'
And then add the .markdownlint.json
file with the following content:
{
"code-block-style": {
"style": "fenced"
}
}
I think that should fix the CI failure.
Done! |
8dcbfe2
to
a55f490
Compare
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.
Thanks!
CI is now rightfully pointing out some places where code blocks are indented. Can you remove the indentation there as well?
Yeah, just hopped in to see what the CI is yapping about now. |
I found myself copy-pasting a lot of enable/disable pragmas into the codebase, which I found really ugly. |
To be honest, the only reason I decided to introduce it is that we used to have a lot of places with over 200 charaters per line, weird whitespaces and inconsistent heading. And also a lot of PR introducing more of them. 😅 I'm not a big fan of nitpicking such stuff as a person (it gives people room to come up with completely arbitrary rules), so I would rather have a linter making sure that |
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.
LGTM. Mind squashing these down to a single commit with a sensible message?
@@ -0,0 +1,3 @@ | |||
{ | |||
"code-block-style": false |
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.
oh wait, can we make this fenced? or why not?
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.
Having this be fenced
messes with places which have to be indented, like inside an admonition
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.
also, squashed
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.
There's some advice in DavidAnson/markdownlint#207 about how to support admonitions. Any interest in making that work in this PR?
2596e13
to
bc865c8
Compare
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.
Alright, we can tackle the admonition thing in another PR.
@tamird Seems like the "solution" provided in the link you linked isn't actually relevant to our situation since you can't load plugins in the cli. |
Could you resolve the conflict? |
Currently markdownlint (which runs in our CI/CD) refuses non-indented code blocks, but material mkdocs requires code blocks to not be indented. As such, we will ignore this lint rule. mkdocs clashes really hard with the code block related lint and as such I disabled it.
bc865c8
to
938a943
Compare
I would really love to stop chasing this PR, so it'd be nice if you could merge it and not merge new stuff in-between, especially since this is a very minor change. |
Currently the documentation website shows broken code blocks, this PR provides a fix to that :)