-
Notifications
You must be signed in to change notification settings - Fork 0
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
Get yarn markdown-lint
to work
#21
Conversation
On `gravitational/docs`, the `yarn markdown-lint` script runs the docs site's `remark`-based linters on the Teleport documentation content. This change ensures that the script works as expected on Docusaurus content. - Add dependencies for `yarn markdown-lint`. - Add a `build-remark` script for building remark plugins in order to run the linter. - Copy `.remarkrc.mjs` from `gravitational/docs`, but add an `updatePaths` function to remark-includes to work with the plugin's new interface. - Edit `getVersionFromFile` to accommodate linting. Get a version if the file is currently in the `content` directory, which we need to do in order to get `remarkIncludes` to work when linting files in `content`. Also add branching in `getCurrentDir` to work with the structure of the `content` directory. - Update package.json to use the versions of `remark` packages found in gravitational/docs. This minimizes the content changes we'll need to make to accommodate the linting configuration.
@ptgott seems like you need to review some dependencies |
package.json
Outdated
"unist-util-visit-parents": "^6.0.1", | ||
"unist-util-find": "^1.0.2", | ||
"unist-util-visit": "4.1.0", | ||
"unist-util-visit-parents": "^5.1.0", |
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.
Seems like some dependencies got downgraded
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.
I was trying to replicate our gravitational/docs
configuration to minimize new linting errors. I had to fix new linting errors anyway, so I've reverted these downgrades
package.json
Outdated
@@ -45,12 +46,12 @@ | |||
"@mdx-js/react": "^3.0.0", | |||
"clsx": "^2.1.1", | |||
"date-fns": "^3.6.0", | |||
"highlightjs-terraform": "https://github.com/highlightjs/highlightjs-terraform#eb1b9661e143a43dff6b58b391128ce5cdad31d4", |
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.
Any reason why this is needed?
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.
We used this to enable HCL syntax highlighting in the previous docs site. We're using Docusaurus-native syntax highlighting now, so we shouldn't need this until (potentially) we address #6
- Revert some dependency downgrades - Remove highlightjs-terraform
f9f5dfe
to
cb937e5
Compare
It is not enabled in CI, and has led to issues with rate limiting from third-party sites in the past.
On
gravitational/docs
, theyarn markdown-lint
script runs the docs site'sremark
-based linters on the Teleport documentation content. This change ensures that the script works as expected on Docusaurus content.yarn markdown-lint
.build-remark
script for building remark plugins in order to run the linter..remarkrc.mjs
fromgravitational/docs
, but add anupdatePaths
function to remark-includes to work with the plugin's new interface.getVersionFromFile
to accommodate linting. Get a version if the file is currently in thecontent
directory, which we need to do in order to getremarkIncludes
to work when linting files incontent
. Also add branching ingetCurrentDir
to work with the structure of thecontent
directory.remark
packages found in gravitational/docs. This minimizes the content changes we'll need to make to accommodate the linting configuration.