Closed ilyatitovich closed 7 months ago
We may also need the remark-toc plugin, which allows us to generate TOC for *.md files.
We may need to write custom rule here too, since we need not generate TOC but to test current TOC (i am not sure how this plugin works to be honest, maybe it checks).
And I'm a little confused by the task: Find way to avoid calling in .github/workflows/root.yml, because I don't see this file in the workflows directory.
Oops. I renamed this file to test.yml
since I created an issue.
Here is a problem. We run test.yml
on non-md changes because it runs a lot of expensive test (like staging deploy).
We need to keep separation between “just test docs quickly on spellchecking PR” and “change a code”. But test.yml
now runs all tests which started from test:
. So we need to change test.yml
to not run test:markdown
(but run it on pnpm test
which should test everything).
In order to exclude the running of the "test:markdown"
script from GitHub Actions, I suggest adding the grep -v "test:markdown"
filter. It will skip and run all scripts starting with "test:"
except "test:markdown"
.
Added docs.yml
file to run tests specifically for .md files.
I removed the remark-lint-code-block-style
package, because it really doesn’t do what we need. I have not yet discovered a plugin that checks indentation inside a list element.
Added --frail
to the script: "test:markdown": "remark . --frail"
. Now linter displays a warning and returns an error:
Added the remark tool to the Tools section in README.md.
Updated the docs.yml
file, adding PR bypass and standard installation of the environment and packages.
Updated the script in the test.yml
file for running tests by adding the regular expression '/^test:(?!markdown\b)/'
. It will allow us to run all tests except the "test:markdown". Checked locally - it works.
Resolve conversation
But I think it is the last code review. We are very close to merging.
Corrected logical mistakes in docs.yml
. Resolved conflicts.
Interesting task! I learned a lot of new things :)
Thanks! I created an issue for next step https://github.com/hplush/slowreader/issues/140
Fixes #97
When searching for a Markdown linter, I settled on remark. The linter has an extensive collection of plugins and presets for processing Markdown files, allowing us to check only the necessary rules. It is possible to write custom rules to perform specific tasks.
I added 4 packages:
--output
to the script:"test:markdown": "remark . --output"
.We may also need the remark-toc plugin, which allows us to generate TOC for *.md files.
Additionally, a
.remarkrc.js
file has been added, in which the necessary plugins are connected.Using this linter, we can check whether links in a document are alive. For other tasks we need to write our own rules.
If this linter suits us, then I’ll start to work with GitHub Actions to add .github/workflows/docs.yml to run linter on */.md files changes.
And I'm a little confused by the task:
Find way to avoid calling in .github/workflows/root.yml
, because I don't see this file in theworkflows
directory.Motivation
Add to the project a good, flexible linter for checking *.md files for mistakes.
Checklist
scripts/
, add a comment with a description.README.md
.README.md
.core/
. What code will also be useful on other platforms?pnpm size
and check the difference in the JS bundle size. Is it relevant to the changes? Change the limit inweb/.size-limit.json
if necessary.index.html
.core/
: