diff --git a/.gitattributes b/.gitattributes index 88cff8f..63777ee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ /tests export-ignore /.travis.yml export-ignore +/codecov.yml export-ignore diff --git a/readme.md b/readme.md index 753aa98..c40d546 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,9 @@ # Spellcheck for SilverStripe -[![Build Status](https://travis-ci.org/silverstripe-labs/silverstripe-spellcheck.svg?branch=master)](https://travis-ci.org/silverstripe-labs/silverstripe-spellcheck) +[![Build Status](https://travis-ci.org/silverstripe/silverstripe-spellcheck.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-spellcheck) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/silverstripe/silverstripe-spellcheck/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-spellcheck/?branch=master) +[![codecov](https://codecov.io/gh/silverstripe/silverstripe-spellcheck/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-spellcheck) + Improves spellcheck support for SilverStripe CMS, including an implementation for HunSpell. @@ -9,18 +12,20 @@ Improves spellcheck support for SilverStripe CMS, including an implementation fo Ensure that your server is setup with [hunspell](http://hunspell.sourceforge.net/), and the necessary [dictionaries](http://download.services.openoffice.org/files/contrib/dictionaries/) for each language you wish to use. -Install the spellcheck module with composer, using `composer require silverstripe/spellcheck:*`, or downloading +Install the spellcheck module with composer, using `composer require silverstripe/spellcheck ^2.0`, or downloading the module and extracting to the 'spellcheck' directory under your project root. +**Note:** this version is compatible with SilverStripe 4. For SilverStripe 3, please see [the 1.x release line](https://github.com/silverstripe/silverstripe-spellcheck/tree/1.0). + ## Configuration Setup the locales you wish to check for using yaml. If you do not specify any, it will default to the current i18n default locale, and may not be appropriate if you have not configured dictionaries for some locales. -mysite/_config/config.yml +mysite/\_config/config.yml ```yaml -SpellController: +SilverStripe\SpellCheck\Handling\SpellController: locales: - en_NZ - fr_FR @@ -28,20 +33,20 @@ SpellController: ``` By default only users with the `CMS_ACCESS_CMSMain` permission may perform spellchecking. This permisson -code can be altered (or at your own risk, removed) by configuring the `SpellController.required_permission` config. +code can be altered (or at your own risk, removed) by configuring the `SilverStripe\SpellCheck\Handling\SpellController.required_permission` config. ```yaml -SpellController: +SilverStripe\SpellCheck\Handling\SpellController: # Restrict to admin only required_permission: 'ADMIN' ``` ## Extending -Additional spell check services can be added by implementing the `SpellProvider` interface and setting this as +Additional spell check services can be added by implementing the `SilverStripe\SpellCheck\Providers\SpellProvider` interface and setting this as the default provider using yaml. -mysite/_config/config.yml +mysite/\_config/config.yml ```yaml --- @@ -49,7 +54,7 @@ Name: myspellcheckprovider After: '#spellcheckprovider' --- # Set the default provider to HunSpell -Injector: - SpellProvider: MySpellProvider +SilverStripe\Core\Injector\Injector: + SilverStripe\SpellCheck\Data\SpellProvider + class: MySpellProvider ``` -