From bbb06645dabafd7ab77cfe6ed8f1bed77fed624b Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Fri, 19 Aug 2022 22:19:03 -0400 Subject: [PATCH] Move using a custom dictionary to file under 'docs' This is more consistent with the other dictionary examples and how-tos. Signed-off-by: Daniel F. Dickinson --- README.md | 33 +-------------------------------- docs/use-a-custom-dictionary.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 32 deletions(-) create mode 100644 docs/use-a-custom-dictionary.md diff --git a/README.md b/README.md index 5e294b9..1766162 100644 --- a/README.md +++ b/README.md @@ -16,41 +16,10 @@ repos: ## How-To Guides and Configuration Examples * [Use Dictionaries from `cspell-dicts`](docs/use-dictionaries-from-cspell-dicts.md) +* [Use a Custom Dictionary](docs/use-a-custom-dictionary.md) * [Use a Different Dictionary Based Upon the Filename](docs/file-or-folder-based-overrides.md) * [Example `pre-commit` Setup for French](docs/pre-commit-example-setup-for-french.md) -### Setup Custom Dictionary - -To use a custom dictionary with the `pre-commit` hook, create either a `cspell.config.yaml` or `cspell.json` file in your project's root directory. - -`cspell.config.yaml` - -```yaml -dictionaryDefinitions: - - name: myWords - path: ./path/to/cSpell_dict.txt - addWords: true -dictionaries: - - myWords -``` - -`cSpell.json` - -```json -{ - "dictionaryDefinitions": [ - { - "name": "myWords", - "path": "./path/to/cSpell_dict.txt", - "addWords": true - } - ], - "dictionaries": ["myWords"] -} -``` - -If you installed the [Code Spell Checker extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for VS Code, this can be done automatically from the command palette by running "Spell: Create a CSpell configuration file". - ## Install from GitHub This repo also allows installing the `cspell-cli` directly from GitHub: diff --git a/docs/use-a-custom-dictionary.md b/docs/use-a-custom-dictionary.md new file mode 100644 index 0000000..f847724 --- /dev/null +++ b/docs/use-a-custom-dictionary.md @@ -0,0 +1,32 @@ +# Setup Custom Dictionary + +To use a custom dictionary with the `pre-commit` hook, create either a `cspell.config.yaml` or `cspell.json` file in your project's root directory. + +`cspell.config.yaml` + +```yaml +dictionaryDefinitions: + - name: myWords + path: ./path/to/cSpell_dict.txt + addWords: true +dictionaries: + - myWords +``` + +`cSpell.json` + +```json +{ + "dictionaryDefinitions": [ + { + "name": "myWords", + "path": "./path/to/cSpell_dict.txt", + "addWords": true + } + ], + "dictionaries": ["myWords"] +} +``` + +If you installed the [Code Spell Checker extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for VS Code, this can be done automatically from the command palette by running "Spell: Create a CSpell configuration file". +