-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aireilly/update-repo-setup
fixup
- Loading branch information
Showing
1 changed file
with
15 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,46 @@ | ||
# Vale rules for Localization | ||
|
||
|
||
## Vale ruleset for Localization | ||
|
||
This repo contains Vale rules to check for correct AsciiDoc syntax in AsciiDoc module files. These syntax rules are derived from Red Hat's [Modular Docs Guidelines](https://redhat-documentation.github.io/modular-docs/) and [OpenShift Docs Guidelines](https://github.com/openshift/openshift-docs/blob/main/contributing_to_docs/doc_guidelines.adoc). | ||
This repo contains Vale rules to check for correct Localization syntax in AsciiDoc files. | ||
|
||
For Vale installation steps, see here: https://vale.sh/docs/vale-cli/installation/ | ||
|
||
**_NOTE:_** If you need Vale rules to lint grammar and accepted Red Hat terminology in AsciiDoc, see [Vale at Red Hat](https://github.com/redhat-documentation/vale-at-red-hat/). | ||
**_NOTE:_** If you need Vale rules to lint grammar and accepted Red Hat terminology in Localization, see [Vale at Red Hat](https://github.com/redhat-documentation/vale-at-red-hat/). | ||
|
||
## Testing the `AsciiDoc` rule set | ||
To test the `AsciiDoc` rule set, add a `.vale.ini` configuration file in your modules directory. | ||
## Testing the `Localization` rule set | ||
To test the `Localization` rule set, add a `.vale.ini` configuration file in your modules directory. | ||
|
||
1. Add a `.vale.ini` file to your **/modules** directory with the following content: | ||
1. Add a `.vale.ini` file to your repo root directory with the following content: | ||
|
||
``` | ||
StylesPath = ../.vale/styles | ||
StylesPath = .vale/styles | ||
MinAlertLevel = suggestion | ||
Packages = https://github.com/rohennes/vale-asciidoc/releases/download/AsciiDoc/AsciiDoc.zip | ||
Packages = https://github.com/reachlekha/vale-localization/releases/download/Localization/Localization.zip | ||
[[!.]*.adoc] | ||
BasedOnStyles = RedHat, AsciiDoc | ||
BasedOnStyles = RedHat, Localization | ||
``` | ||
|
||
**Note:** This is a separate `vale.ini` file that is designed for modules only - not assemblies. If you are using this with `openshift-docs` or any other repo, don't overwrite existing `vale.ini` files. | ||
2. Run `vale sync` | ||
|
||
2. Run `vale sync` in the modules directory. | ||
## Verification | ||
|
||
### Verification | ||
To verify, run `vale ls-config` in your modules directory to check that the `Localization` package is installed. | ||
|
||
To verify, run `vale ls-config` in your modules directory to check that the `AsciiDoc` package is installed. | ||
|
||
_Example output_ | ||
_Example output_ | ||
|
||
``` | ||
{ | ||
"BlockIgnores": {}, | ||
"Checks": null, | ||
"Formats": {}, | ||
"Asciidoctor": {}, | ||
"Localization": {}, | ||
... | ||
"SBaseStyles": { | ||
"[!.]*.adoc": [ | ||
"AsciiDoc" | ||
"Localization" | ||
] | ||
... | ||
} | ||
``` | ||
|
||
## Optional: Exclude the Vale configuration file from Git | ||
|
||
To exclude the `.vale.ini` configuration file from Git, add the file to the list of ignored files in a global `.gitignore` file in your home directory. | ||
|
||
1. Add the following content to a `.gitignore` file in your home directory: | ||
|
||
`modules/.vale.ini ` | ||
|
||
2. If you didn't have a .gitignore file previously in your home dir, you may need to make git aware of this global .gitignore file by running the following: | ||
|
||
`git config --global core.excludesFile '~/.gitignore'` |