Ideas for docs CLI / CI toolchain automation and extensions #2397
Replies: 4 comments 4 replies
-
Instead of "fixFrontmatter", perhaps we could add a "checkFrontmatter" command that only reports if there are broken notes. That would be useful as a pre-commit or pre-push check on all our internal vaults too. For the pre-commit, we could use husky since most people working on Dendron are likelier to have nodejs. But I can still see that being a barrier of entry, say for someone on Windows who doesn't work on Dendron but wanted to contribute to the documentation. |
Beta Was this translation helpful? Give feedback.
-
I'd be up for supporting any CI testing (within the context of gitlab - given my issues anyway!) Even if it's just converting GH action yml to gitlab CI/CD. As it's something I've wanted to get some learning in for a while, but I'm very new to it all so there may be someone better to help. |
Beta Was this translation helpful? Give feedback.
-
While I support the auto running of certain tools during pre-push, all checks and Validation should still be run as PR/MR checks to make certain that the pre-push runs didn't get prevented or failed to run, etc. |
Beta Was this translation helpful? Give feedback.
-
If Husky is chosen in the end, I think it would be wise to use okonet/lint-staged to somewhat reduce the file amount that needs to be linted. This could also be used to check Assets and configs since we can filter what to run for which file ending. |
Beta Was this translation helpful? Give feedback.
-
Summary
We should evaluate implementing tools in documentation repositories that can help in automating formatting, spelling, and style standards. A side benefit of this will mean that others can make use of our own implementations to use in their own projects, ultimately enforcing good practices and writing standards within their own notes and docs.
Details
Areas of interest, commonly issues for docs management:
husky
orpre-commit
)Tools
Tools of interest to evaluate.
prettier
: Automated formatting ofyaml
,json
,md
, etc. filesmarkdownlint-cli
: Markdown format linting. Not sure what problems Dendron markdown (wikilinks, not refs, etc.) may introduce here, but the CLI allows for custom rulesmarkdownlint-cli2
vscode-markdownlint
spellchecker-cli
(or other spellcheck CLI tool): Supports custom dictionary for words that otherwise should failbrok
(or other external URL validator): External URL validator, hosted in the CI. Uses cache to prevent referencing same URLs every day (expires after 1-month).brok
itself has not been maintained/updated in a while...Dendron: Doctor
commands:findBrokenLinks
: Find any internal, broken Dendron links. Would be great as a test that must pass before PR is merged.fixFrontmatter
: Could auto-run this against vaults, in the event that newly introduced notes have broken frontmatter?fixFrontmatter
to support something likecheckFrontmatter
?husky
: Auto-run commands able to be run locally before a commit is made, catching as many problems as possible (brokenyaml
formatting, applyprettier
before committing, etc.)pre-commit
(Python-based instead of Node)Prose and Style Auditing
There are many tools out there, here is a snapshot of them:
write-good
: Opinionated English prose style analyzerproselint
: Opinionated English prose style analyzervale
(cli): Style guide and spelling evaluationsApproach
I feel that we'd likely want to approach tool automation be first introducing it into a smaller set of documentation, perhaps starting with The Open PKM Catalogue (Source)? Or maybe seed onboarding repo? Otherwise,
dendron-site
would be the repo that - if the tools work - can be rolled out elsewhere after.We'd likely want to get one tool introduced one at a time, starting with a handful of easier wins:
prettier
markdownlint-cli
Dendron: Doctor
commandsprettier
?Benefits of this approach:
Problems to keep in mind
As we start to introduce other tools, they may require additional setup on behalf of the contributor. This can begin to create a barrier to contributing.
husky
: This is a nodejs tool, so requires additional node reqs. This may not be so much an issue with people already using CLIpre-commit
: This is a Python-based tool, so requires Python and installation ofpre-commit
vale
: Another third-party piece of software that needs to be installed. The VS Code extension experience is really clunky, and if you open a project that doesn't have a Vale config, the extension is annoyedWhat about accessibility?
There is another GitHub Discussion around this:
Asks
Beta Was this translation helpful? Give feedback.
All reactions