https://github.com/coderjoshdk/precommit-mintlify-validate
Validate your mintlify sites with a pre-commit action
https://github.com/coderjoshdk/precommit-mintlify-validate
hooks mintlify pre-commit
Last synced: 9 months ago
JSON representation
Validate your mintlify sites with a pre-commit action
- Host: GitHub
- URL: https://github.com/coderjoshdk/precommit-mintlify-validate
- Owner: CoderJoshDK
- License: mit
- Created: 2024-02-12T22:54:09.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T23:36:55.000Z (about 2 years ago)
- Last Synced: 2024-02-13T00:27:26.843Z (about 2 years ago)
- Topics: hooks, mintlify, pre-commit
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit mintlify validator
A pre-commit helper for [mintlify websites](https://mintlify.com/)
Don't let yourself upload a broken website. This pre-commit will automagically validate your site.
It does this by running `mintlify broken-links`. In the process of trying to run this command, any other obviously broken components will raise errors.
## General Usage
In your mintlify repo, add a file called `.pre-commit-config.yaml` with (as an example) the following contents:
```yaml
repos:
- repo: https://github.com/CoderJoshDK/precommit-mintlify-validate/
rev: # Get the latest from: https://github.com/CoderJoshDK/precommit-mintlify-validate/
hooks:
- id: mintlify-validate
args: [docs] # relative path to directory with mint.json file (optional, defaults to `.`)
```
Next, have every developer:
1. Install [pre-commit](http://pre-commit.com/). E.g. `brew install pre-commit`.
2. Install [mintlify](https://mintlify.com/docs/development). E.g. `npm i -g mintlify`.
3. Run `pre-commit install` in the repo.
## Expected output
If there are issues with a broken link, the file location and the broken link will be provided in a list.
If the issue is related to a broken component, the location where it breaks will be given (row and column)