Usage: The wmk command
The wmk command structure is wmk <action> <base_directory>. The base
directory is of course the directory containing the source files for the site.
(They are actually in subdirectories such as templates, content, etc. –
see File organization).
-
wmk info $basedir: Shows the real path to the location ofwmk.pyand of the content base directory. E.g.wmk info .. Synonyms forinfoareenvanddebug. -
wmk init $basedir: In a folder which containscontent/(with markdown or HTML files) but nowmk_config.yaml, creates some initial templates as well as a samplewmk_config.yaml, thus making it quicker for you to start a new project. -
wmk build $basedir [-q|--quick]: Compiles/copies files into$basedir/htdocs. If-qor--quickis specified as the third argument, only files considered to have changed, based on timestamp checking, are processed. Synonyms forrunarerun,bandr. -
wmk watch $basedir: Watches for changes in the source directories inside$basedirand recompiles if changes are detected. (Note thatbuildis not performed automatically before setting up file wathcing, so you may want to run that first). A synonym forwatchisw. -
wmk serve $basedir [-p|--port <portnum>] [-i|--ip <ip-addr>]: Serves the files in$basedir/htdocsonhttp://127.0.0.1:7007/by default. The IP and port can be modified with the-pand-iswitches or be be configured viawmk_config.yaml– see Configuration file). Synonyms forservearesrvands. -
wmk watch-serve $basedir [-p|--port <portnum>] [-i|--ip <ip-addr>]: Combineswatchandservein one command. Synonym:ws. -
wmk clear-cache $basedir: Remove the HTML rendering cache, which is a SQLite file in$basedir/tmp/. This should only be necessary in case of changed shortcodes or shortcode dependencies. Note that the cache can be disabled inwmk_config.yamlby settinguse_cachetofalse, or on file-by-file basis via a frontmatter setting (no_cache). A synonym forclear-cacheisc. -
wmk preview $basedir $filenamewhere$filenameis the name of a file relative to thecontentsubdirectory of$basedir. This prints (to stdout) the HTML which the given file will be converted to (before it is passed to the template and before potential post-processing). Example:wmk preview . index.md. -
wmk admin $basedir: Build the site and then start wmkAdmin, which must have been installed beforehand into theadminsubdirectory of the$basedir(or into the subdirectory specified withwmk admin $basedir $subdir). The subdirectory may be a symbolic link pointing to a central instance. wmkAdmin allows you to manage the content of the site via a web interface. It is not designed to allow you to install or modify themes or perform tasks that require more technical knowledge, and works best for a standard site based on Markdown or HTML files in thecontentdirectory. -
wmk repl $basedir: Launch a Python shell (ipython, bpython or python3, in order of preference) with the wmk environment loaded and with the$basediras current working directory. Useful for examining wmk's view of the site content or debuggingMDContentfiltering methods. For these purposes,from wmk import get_content_info, followed bycontent = get_content_info('.')is often a good start. -
wmk pip <pip-command>: Runpipin the virtual environment used by wmk. Mainly useful for installing or upgrading Python modules that you want to use in Python files belonging to your projects. -
wmk homedir: Outputs the path towmk's installation directory. May be useful in shell scripts.