Skip to content

Commit

Permalink
Merge pull request #31 from creative-commoners/pulls/2.0/update-docs
Browse files Browse the repository at this point in the history
DOCS Update readme for SS4 namespaces, add new build badges
  • Loading branch information
robbieaverill authored Dec 12, 2017
2 parents 329a6a0 + 54937aa commit db143fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/tests export-ignore
/.travis.yml export-ignore
/codecov.yml export-ignore
27 changes: 16 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -9,47 +12,49 @@ 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
- de_DE
```
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
---
Name: myspellcheckprovider
After: '#spellcheckprovider'
---
# Set the default provider to HunSpell
Injector:
SpellProvider: MySpellProvider
SilverStripe\Core\Injector\Injector:
SilverStripe\SpellCheck\Data\SpellProvider
class: MySpellProvider
```

0 comments on commit db143fe

Please sign in to comment.