From 88e3f0506dd1f28f47130565ced61d161093a157 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Fri, 3 Feb 2023 13:57:05 +0100 Subject: [PATCH] docs: Update README (#4097) --- packages/cspell-glob/README.md | 24 ++++++++ packages/cspell-tools/README.md | 14 ++++- packages/cspell-trie-lib/README.md | 10 ++++ packages/cspell-trie/README.md | 36 ++++++++++-- packages/cspell/README.md | 92 +++++++++++++++++------------- packages/hunspell-reader/README.md | 24 ++++++++ static/tidelift.md | 3 + 7 files changed, 156 insertions(+), 47 deletions(-) create mode 100644 static/tidelift.md diff --git a/packages/cspell-glob/README.md b/packages/cspell-glob/README.md index dedfaf6ee304..3649cde7639c 100644 --- a/packages/cspell-glob/README.md +++ b/packages/cspell-glob/README.md @@ -15,3 +15,27 @@ const cspellGlob = require('cspell-glob'); // TODO: DEMONSTRATE API ``` + +## CSpell for Enterprise + + + +Available as part of the Tidelift Subscription. + +The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + + + + +
+ +--- + +

+Brought to you by +Street Side Software Logo Street Side Software + +

+ + diff --git a/packages/cspell-tools/README.md b/packages/cspell-tools/README.md index 3bd5de6bd1c7..e6085354af08 100644 --- a/packages/cspell-tools/README.md +++ b/packages/cspell-tools/README.md @@ -1,6 +1,6 @@ -# cSpell-Tools +# CSpell-Tools -Tools used to assist cSpell Development. +Tools used to assist CSpell Development. The Primary use of this tool is to build dictionaries used by cspell. This tool will convert a word list or a hunspell file into a file usable by cspell. @@ -36,6 +36,16 @@ For large files, this process can take a long time and us a lot of memory. The tool `cspell-trie` can be used to read the contents of a `.trie` or `.trie.gz` file. +## CSpell for Enterprise + + + +Available as part of the Tidelift Subscription. + +The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +
diff --git a/packages/cspell-trie-lib/README.md b/packages/cspell-trie-lib/README.md index 44d45b224994..cfbcf241195d 100644 --- a/packages/cspell-trie-lib/README.md +++ b/packages/cspell-trie-lib/README.md @@ -211,6 +211,16 @@ How to walk the data to see if "talks" is in it. cspell:word DAFSA DAWG --> +## CSpell for Enterprise + + + +Available as part of the Tidelift Subscription. + +The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +
diff --git a/packages/cspell-trie/README.md b/packages/cspell-trie/README.md index b714af48a870..2506189dfb0e 100644 --- a/packages/cspell-trie/README.md +++ b/packages/cspell-trie/README.md @@ -114,13 +114,37 @@ each line can only refer to previous lines. How to walk the data to see if "talks" is in it. -1. Start with the root at offset 8. -2. t found goto 7 -3. a found goto 6 -4. l found goto 5 -5. k found goto 4 -6. s found stop (goto 0 is stop). +1. Start with the root at offset 8. +1. t found goto 7 +1. a found goto 6 +1. l found goto 5 +1. k found goto 4 +1. s found stop (goto 0 is stop). + +## CSpell for Enterprise + + + +Available as part of the Tidelift Subscription. + +The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + + + + +
+ +--- + +

+Brought to you by +Street Side Software Logo Street Side Software + +

+ + diff --git a/packages/cspell/README.md b/packages/cspell/README.md index 3b5d65acdf47..9c228737c758 100644 --- a/packages/cspell/README.md +++ b/packages/cspell/README.md @@ -29,12 +29,16 @@ A Spell Checker for Code! cspell was initially built as the spell checking service for the [spell checker extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for [Visual Studio Code](https://code.visualstudio.com/). -## cspell for enterprise +## CSpell for Enterprise + + Available as part of the Tidelift Subscription. The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + ## Installation ```sh @@ -45,9 +49,19 @@ npm install -g cspell There is a docker image at [Packages for cspell](https://github.com/streetsidesoftware/cspell-cli/pkgs/container/cspell). -`cspell` commands below can be run by replacing `cspell` with: `docker run -v -i -t $PWD:/workdir ghcr.io/streetsidesoftware/cspell:latest` +`cspell` commands below can be run by replacing -Example: +``` +cspell +``` + +with: + +``` +docker run -v -i -t $PWD:/workdir ghcr.io/streetsidesoftware/cspell:latest +``` + +**Example:** ```sh docker run -v -i -t $PWD:/workdir ghcr.io/streetsidesoftware/cspell:latest lint --help @@ -310,7 +324,7 @@ The concept is simple, split camelCase and snake_case words before checking them It is possible to add spell check settings into your source code. This is to help with file specific issues that may not be applicable to the entire project. -All settings are prefixed with `cSpell:` or `spell-checker:`. +All settings are prefixed with `cspell:` or `spell-checker:`. - `disable` -- turn off the spell checker for a section of code. - `enable` -- turn the spell checker back on after it has been turned off. @@ -327,26 +341,26 @@ It is possible to disable / enable the spell checker by adding comments to your #### Disable Checking -- `/* cSpell:disable */` +- `/* cspell:disable */` - `/* spell-checker: disable */` - `/* spellchecker: disable */` - `// cspell:disable-line` -- disables checking for the current line. - `/* cspell:disable-next-line */` -- disables checking till the end of the next line. - + #### Enable Checking -- `/* cSpell:enable */` +- `/* cspell:enable */` - `/* spell-checker: enable */` - `/* spellchecker: enable */` #### Example ```javascript -// cSpell:disable +// cspell:disable const wackyWord = ['zaallano', 'wooorrdd', 'zzooommmmmmmm']; -/* cSpell:enable */ +/* cspell:enable */ const words = ['zaallano', 'wooorrdd', 'zzooommmmmmmm']; // cspell:disable-line disables this entire line @@ -363,7 +377,7 @@ var liep = 1; /* cspell:disable */ // It is still disabled -// cSpell:enable +// cspell:enable // It is now enabled const str = 'goededag'; // <- will be flagged as an error. @@ -376,15 +390,15 @@ const str = 'goededag'; // <- will be flagged as an error. const str = 'goedemorgen'; // <- will NOT be flagged as an error. ``` - + ### Ignore _Ignore_ allows you the specify a list of words you want to ignore within the document. ```javascript -// cSpell:ignore zaallano, wooorrdd -// cSpell:ignore zzooommmmmmmm +// cspell:ignore zaallano, wooorrdd +// cspell:ignore zzooommmmmmmm const wackyWord = ['zaallano', 'wooorrdd', 'zzooommmmmmmm']; ``` @@ -395,7 +409,7 @@ const wackyWord = ['zaallano', 'wooorrdd', 'zzooommmmmmmm']; The _words_ list allows you to add words that will be considered correct and will be used as suggestions. ```javascript -// cSpell:words woorxs sweeetbeat +// cspell:words woorxs sweeetbeat const companyName = 'woorxs sweeetbeat'; ``` @@ -406,8 +420,8 @@ const companyName = 'woorxs sweeetbeat'; In some programing language it is common to glue words together. ```c -// cSpell:enableCompoundWords -char * errormessage; // Is ok with cSpell:enableCompoundWords +// cspell:enableCompoundWords +char * errormessage; // Is ok with cspell:enableCompoundWords int errornumber; // Is also ok. ``` @@ -417,7 +431,7 @@ The last setting in the file determines the value for the entire file. ### Excluding and Including Text to be checked. By default, the entire document is checked for spelling. -`cSpell:disable`/`cSpell:enable` above allows you to block off sections of the document. +`cspell:disable`/`cspell:enable` above allows you to block off sections of the document. `ignoreRegExp` and `includeRegExp` give you the ability to ignore or include patterns of text. By default the flags `gim` are added if no flags are given. @@ -430,17 +444,17 @@ The spell checker works in the following way: #### Exclude Example ```javascript -// cSpell:ignoreRegExp 0x[0-9a-f]+ -- will ignore c style hex numbers -// cSpell:ignoreRegExp /0x[0-9A-F]+/g -- will ignore upper case c style hex numbers. -// cSpell:ignoreRegExp g{5} h{5} -- will only match ggggg, but not hhhhh or 'ggggg hhhhh' -// cSpell:ignoreRegExp g{5}|h{5} -- will match both ggggg and hhhhh -// cSpell:ignoreRegExp /g{5} h{5}/ -- will match 'ggggg hhhhh' -/* cSpell:ignoreRegExp /n{5}/ -- will NOT work as expected because of the ending comment -> */ +// cspell:ignoreRegExp 0x[0-9a-f]+ -- will ignore c style hex numbers +// cspell:ignoreRegExp /0x[0-9A-F]+/g -- will ignore upper case c style hex numbers. +// cspell:ignoreRegExp g{5} h{5} -- will only match ggggg, but not hhhhh or 'ggggg hhhhh' +// cspell:ignoreRegExp g{5}|h{5} -- will match both ggggg and hhhhh +// cspell:ignoreRegExp /g{5} h{5}/ -- will match 'ggggg hhhhh' +/* cspell:ignoreRegExp /n{5}/ -- will NOT work as expected because of the ending comment -> */ /* - cSpell:ignoreRegExp /q{5}/ -- will match qqqqq just fine but NOT QQQQQ + cspell:ignoreRegExp /q{5}/ -- will match qqqqq just fine but NOT QQQQQ */ -// cSpell:ignoreRegExp /[^\s]{40,}/ -- will ignore long strings with no spaces. -// cSpell:ignoreRegExp Email -- this will ignore email like patterns -- see Predefined RegExp expressions +// cspell:ignoreRegExp /[^\s]{40,}/ -- will ignore long strings with no spaces. +// cspell:ignoreRegExp Email -- this will ignore email like patterns -- see Predefined RegExp expressions var encodedImage = 'HR+cPzr7XGAOJNurPL0G8I2kU0UhKcqFssoKvFTR7z0T3VJfK37vS025uKroHfJ9nA6WWbHZ/ASn...'; var email1 = 'emailaddress@myfancynewcompany.com'; var email2 = ''; @@ -453,8 +467,8 @@ var email2 = ''; In general you should not need to use `includeRegExp`. But if you are mixing languages then it could come in helpful. ```Python -# cSpell:includeRegExp #.* -# cSpell:includeRegExp ("""|''')[^\1]*\1 +# cspell:includeRegExp #.* +# cspell:includeRegExp ("""|''')[^\1]*\1 # only comments and block strings will be checked for spelling. def sum_it(self, seq): """This is checked for spelling""" @@ -471,7 +485,7 @@ def sum_it(self, seq): The _dictionaries_ list allows you to specify dictionaries to use for the file. ```javascript -// cSpell:dictionaries lorem-ipsum +// cspell:dictionaries lorem-ipsum const companyName = 'Lorem ipsum dolor sit amet'; ``` @@ -682,7 +696,7 @@ The number of `!`s is important. ## LanguageSettings -The Language Settings allow configuration to be based upon the programming language and/or the e. +The Language Settings allow configuration to be based upon the programming language and/or the locale. There are two selector fields `locale` and `languageId`. - `languageId` defines which programming languages to match against. @@ -749,13 +763,13 @@ Brought to you by +Brought to you by +Street Side Software Logo Street Side Software + +

+ + diff --git a/static/tidelift.md b/static/tidelift.md new file mode 100644 index 000000000000..18d4edcfce83 --- /dev/null +++ b/static/tidelift.md @@ -0,0 +1,3 @@ +Available as part of the Tidelift Subscription. + +The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)