diff options
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. |