diff options
author | Martin Fischer <martin@push-f.com> | 2022-12-03 08:29:30 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-12-03 08:29:30 +0100 |
commit | b4ac728a4adf513f69617b80b52284ba10e2ddf8 (patch) | |
tree | c1af74254c4d4a756e37aba0122d52fa2689d10d /README.md | |
parent | c3c56543c6febe8fd4c66dda5551abe965efff7f (diff) |
document example configuration in README
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -16,7 +16,28 @@ to provide the following (all in a configurable manner): e.g. automatically higlight pages with names ending in `.rq` as SPARQL (and also display the code actions for them) -Note that code actions are also linkable from other pages via the +## Example configuration + +```php +$wgCode_namespacesWithCodePages[NS_MAIN] = true; + +$wgCode_languages[] = [ + 'tag' => 'query', + 'pygmentsLexer' => 'sparql', + 'actions' => [ + 'run' => 'https://query.wikidata.org/#$code', + 'embed' => 'https://query.wikidata.org/embed.html#$code', + ], + 'linkifiers' => [ + '/\\b[QP][0-9]+\\b/' => 'https://www.wikidata.org/entity/$1', + ], + 'suffix' => '.rq', +]; +``` + +## Linking code actions + +Code actions can be linked from other pages via the `Special:CodeAction` special page, e.g. `Special:CodeAction/run/Example.rq` attempts to execute the `run` action for the `Example.rq` code page and redirect the user accordingly. |