Grunt commands¶
These commands are run on the command line, prefixed with grunt. For example, to rebuild the CSS after editing the LESS files, you would run grunt less.
Some commands require you to have external applications installed. Instructions for installing dependencies are included in the developer documentation.
less- Recompiles all LESS files into their corresponding CSS files, including sourcemaps, and then runs
cssmin. The list of files that will be compiled is defined inGruntfile.jsin the variablecssLessFiles. uglify- Minifies Largo’s
.jsJavaScript files to.min.jsfiles. cssmin- Takes all
.cssfiles incss/andhomepages/assets/cssthat are not.min.cssfiles and makes minified versions with the file extension.min.css. shellRuns commands directly on the command line, instead of running Grunt modules.
These commands require you to have set up Largo according to the complete dev environment or documentation contribution environment instructions, because they require several Python libraries that were installed by following those instructions. Besure to have activated your python virtualenv with
workon, as described in those instructions.shell:apidocs- Recompiles the Largo API Docs from structured comments in Largo’s PHP code using /docs/generate_api_docs.py into reStructuredText files.
shell:sphinx- Converts all available reStructuredText files into HTML documentation, which is saved locally in
docs/_build/html/. If you want to preview these docs without pushing them to largo.readthedocs.io, runpython -m SimpleHTTPServeras described in the documentation contribution instructions. shell:msgmerge- Runs msgmerge to merge translation files.
shell:pot- Runs wp i18n make-pot to create a POT file for the project.
watch- Runs
lessif a.lessfile inless/orhomepages/assets/less/is modified. Runsdocsif a reStructuredText.rstfile changes indocs/. potRuns
shell:pot, rebuilding translation files.Running this command requires your computer to have
xgettextinstalled. Installation instructions vary based on operating system; your best bet is Google.xgettextis usually installed in the same package asgettext.po2moConverts the
.pofiles to.mofiles. For more information about.poand.mofiles, see the Wikipedia articles on gettext.Running this command requires your computer to have
xgettextinstalled. Installation instructions vary based on operating system; your best bet is Google.xgettextis usually installed in the same package asgettext.apidocs- Runs
shell:apidocs, rebuilding only the API docs. docs- Runs
shell:sphinx, rebuilding ALL docs. build- Runs
less,cssmin,uglify,apidocs,docs,pot, andshell:msmergeto rebuild the assets, docs, and language files. version- Increments the Largo version number based on
package.json. Files affected are:docs/conf.py,style.css,readme.md. build-release- Runs
buildandversion. publishRuns the following tasks to publish the newest version of Largo on the
masterbranch:confirm- Makes sure that you want to publish a release.
gitcheckout- Checks out the
masterbranch of Largo. gitmerge- Merges the
developbranch intomaster. gittag- Tags the latest commit with the version number from
package.json. gitpush- Pushes the
masterbranch back to GitHub.