NacoWiki has a command line interface. To use run on the CLI:
php web/index.php {sub-command}
Sub-commands are defined by the Core
class and Plugins
. The standard distribution defines
the following:
bloggen
Generate static blog site
Usage:
php web/albatros.php bloggen [options]
Options
- --cfg-[setting]=value : Modifes the setting
setting
which normally would be configured in NacoWiki definition to value. - --output=directory-path : Sets the output directory path.
Note that most of the configuration is in the opts.yaml
at the
root of the wiki.
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @phpcod commands##bloggen
- @event cli:bloggen
- plugins/Albatros.php,369
cfg
Dump config
This implements the cli sub-command cfg
This shows current running configuration of the wiki.
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:gvars
- @phpcod commands##cfg
- plugins/PluginVars.php,68
files
List files
Makes a list of Wiki files
- @phpcod commands##files
- @event cli:files
- plugins/SiteGen.php,155
gvars
Dump global variables
This implements the cli sub-command gvars
This will dump all the variables defined in the configuration of the wiki user cfg[plugins][PluginVars]
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:gvars
- @phpcod commands##gvars
- plugins/PluginVars.php,46
help
Show this help
This implements a CLI sub-command for HELP
It will look into the plugin configuration and display what are the available sub-commands. In addition if there is a docstring for the implementing function, it will display it. It also shows what plugin's class is providing this command.
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:help
- @phpcod commands##help
- classes/Cli.php,70
install
Install assets
This implements a CLI sub-command for plugins.
This will check if the assets directory specified in the \NanoWikiApp configuration exists, and if it does not exist, it will create it.
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:install
- @phpcod commands##install
- classes/Cli.php,168
lint
Dump left-over metadata files
This will look for dot files that do not have a matching content.
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:lint
- @phpcod commands##lint
- classes/Cli.php,129
mkassets
Copy assets
Makes a copy of static assets to the generated site
- @phpcod commands##mkassets
- @event cli:mkassets
- plugins/SiteGen.php,120
plugins
List available plugins
This implements a CLI sub-command for plugins.
This looks in the plugin configuration and shows what plugins are currently available, its source file and the plugin version if any
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:plugins
- @phpcod commands##plugins
- classes/Cli.php,105
render
Render a wiki page as HTML
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @phpcod commands##render
- @event cli:render
- plugins/SiteGen.php,67
serve
Serve pages
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @phpcod commands##serve
- @event cli:serve
- plugins/Albatros.php,344
vv
Version testing
This implements the cli sub-command vv
This used for Version plugin debuging
- @param \NanoWikiApp $wiki running wiki instance
- @param array $argv Command line arguments
- @event cli:vv
- @phpcod commands##vv
- plugins/Versions.php,733