Custom Style Guide

Make hyperlint your own

Customizing the style guide is a great way to ensure that Hyperlint provides the most accurate and helpful feedback for changes to your documentation.

The style guide is a series of YAML files that Hyperlint uses to: (a) find errors in the content (b) provide recommendations on how to improve the content.

Hyperlint does this automatically for you.

Updating the style guide means placing several files in the .hyperlint directory of your repository.

Customizing the vocabulary

There are two files that you can use to customize the vocabulary used by Hyperlint, through accepted words and rejected words.

Accepted words are words that Hyperlint will enforce specific spelling for.

Rejected words are words that Hyperlint will reject entirely from your documentation, alerting whenever they are present.

Managing the vocabulary

When notifying you of spelling issues, Hyperlint will automatically suggest corrections and updates to the accepted vocabulary list. Hyperlint will do so by opening a pull request to the pull request introducing the change, and making the recommendations.

In doing so, Hyperlint will also remove comments for these erroneous alerts from the pull request.

Accepted vocabulary

The file needs to be located at: .hyperlint/styles/config/vocabularies/hyperlint/accept.txt

Example contents:

Hyperlint
APIs

Rejected vocabulary

These are the words that Hyperlint will reject entirely from your documentation, alerting whenever they are present.

The file needs to be located at: .hyperlint/styles/config/vocabularies/hyperlint/reject.txt

Example contents:

Bad Word
Bad Word or phrase

Customizing style guide rules

Rules must live in the .hyperlint/styles/hyperlint directory and must have a .yml extension.

These rules follow the Vale style guide rule format.

Here's an example:

filename: .hyperlint/styles/hyperlint/RemoveVale.yml

Contents:

extends: existence
ignorecase: true
level: warning
message: Consider removing '%s'
tokens:
  - blah
  - style-a-rific

Using an existing Vale style guide setup

Under the hood, Hyperlint uses the vale style guide to provide some of it's style guide rules. You can leverage your existing Vale setup. No additional configuration is needed, if you have a .vale.ini file in the home directory of your GitHub repository, Hyperlint will automatically pick it up and use the contents.