Settings

Settings are edited at RedPen → Settings, or written to config/redpen.php where they can be per-environment and version controlled.

Reference

SettingDefaultNotes
languageen-USThe language rules are evaluated against.
checkOnLoadtrueCheck when an edit screen opens.
checkOnSavefalseEvaluate on save. Pro.
blockOnErrorfalseLet an error actually block the save. Pro.
backends['rules']Which checkers run, in order.
languageToolEndpointemptyBase URL of a self-hosted LanguageTool server. Parses env vars.
languageToolTimeout10Seconds before giving up on a request.
languageToolPickyfalseAsk for the picky ruleset too.
llmProvideranthropicanthropic or openai.
llmApiKeyemptyYour key. Parses env vars.
llmModelemptyEmpty uses the provider’s default. Parses env vars.
maxFragmentLength20000Characters per field sent to a network backend.
cacheDuration300Seconds a check result is cached. 0 disables caching.
logLevelwarningVerbosity of storage/logs/redpen.log: error, warning, info or debug.

The config file

Create config/redpen.php and return an array. It supports Craft’s multi-environment shape:

<?php

return [
    '*' => [
        'checkOnLoad' => true,
        'backends' => ['rules'],
    ],
    'production' => [
        'checkOnSave' => true,
        'blockOnError' => true,
        'backends' => ['rules', 'languagetool'],
        'languageToolEndpoint' => '$LANGUAGETOOL_URL',
    ],
];

Anything set in this file overrides the control panel and its field is shown as read-only there, the same as any other Craft plugin.

Environment variables

languageToolEndpoint, llmApiKey and llmModel all parse environment variables, so credentials never land in project config:

# .env
LANGUAGETOOL_URL=http://languagetool.internal:8010
REDPEN_LLM_KEY=sk-…

Then enter $REDPEN_LLM_KEY in the settings field, or set it in config/redpen.php.

Nothing is required

No setting is marked required, on purpose. A required validation rule on any one setting makes saving the settings fail wholesale on a fresh install — so nothing can be saved until that one field is filled in. Values are validated for correctness only when they are present.

Logging

RedPen writes to storage/logs/redpen.log at the level set by logLevel. Set it to debug when working out why a network backend is behaving oddly; it records each request, its duration and the shape of the response, without the content of your entries.

More in Editorial

Pairs well with RedPen

For the people writing the content. Scheduling, staging, revision diffs, house style, find and replace, and a warning before two editors overwrite each other.