Extension:Katsa
![]() Release status: experimentalCategory:Experimental extensions |
|
---|---|
![]() |
|
Implementation | APICategory:API extensions |
Description | Provides spies for Scribunto. |
Author(s) | |
Compatibility policy | Master maintains backward compatibility.Category:Extensions with master compatibility policy |
MediaWiki | Category:Extensions without MediaWiki version |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | GitHub: README, LDoc |
Translate the Katsa extension |
Katsa provides a framework for spies.
Installation
Katsa depends on modules from the Scribunto extension.
- Download and place the file(s) in a directory called
Katsa
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'Katsa' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
The workflow for spies is to define a graph, and then call on that graph. The definition is done once, but the graph can be reused several times.
local spy = require 'spy'
local carp = spy.newCarp()
local cluck = spy.newCluck()
local croak = spy.newCroak()
local confess = spy.newConfess()
local h = {}
function h.carp()
carp 'carp carp carp' -- this will log a one-liner in the console
cluck 'cluck cluck cluck' -- this will log a full stack trace
croak 'croak croak croak' -- should just bug out and print a one-liner (but Scribuntos implementation of error() is weird)
confess "confess confess confess" -- bug out and print a full stack trace
end
return h
For further help, see the generated LDoc documentation.
Development
For recreating the Vagrant-based development environment, see Katsa: Topics/Vagrant.
See also
Category:API extensions
Category:All extensions
Category:Experimental extensions
Category:Extensions in GitHub version control
Category:Extensions not in ExtensionJson
Category:Extensions with master compatibility policy
Category:Extensions without MediaWiki version
Category:GPL licensed extensions
Category:ScribuntoExternalLibraryPaths extensions