liara.cmdline

Module Contents

Classes

Environment

The command line environment.

Functions

cli

Liara is a static page generator.

main

build

Build a site.

validate_links

Validate links.

list_tags

List all tags.

find_by_tag

Find pages by tag.

create

Create a document.

create_config

Create a default configuration.

quickstart

Create a quickstart project.

check_tools

list_content

List all content.

serve

Run a local development server.

cache

Modify or inspect the cache.

inspect

Inspect state, for example, site data or template matching.

inspect_data

Inspect the content of site.data.

inspect_data_files

List all data files.

inspect_template_match

Match a template pattern.

Data

API

class liara.cmdline.Environment

The command line environment.

This provides access to global variables that are useful for command line commands, as well as a global liara instance.

Initialization

property liara: liara.Liara
liara.cmdline.pass_environment = 'make_pass_decorator(...)'
liara.cmdline.cli(env: liara.cmdline.Environment, debug: bool, verbose: bool, config, date: str)

Liara is a static page generator.

liara.cmdline.main()
liara.cmdline.build(env: liara.cmdline.Environment, profile: bool, profile_file: str | bytes | os.PathLike, cache: bool, parallel: bool)

Build a site.

Validate links.

Checks all internal/external links for validity. For internal links, a check is performed if the link target exists. For external links, a web request is made to the link target. If the request returns an error code, the link is considered invalid.

liara.cmdline.list_tags(env: liara.cmdline.Environment)

List all tags.

This uses a metadata field named ‘tags’ and returns the union of all tags, as well as the count how often each tag is used.

liara.cmdline.find_by_tag(env: liara.cmdline.Environment, tags: list[str])

Find pages by tag.

This searches the metadata for a ‘tags’ field, which is assumed to be a list of tags.

liara.cmdline.create(env: liara.cmdline.Environment, object_type: str)

Create a document.

liara.cmdline.create_config(output: IO)

Create a default configuration.

liara.cmdline.quickstart(template_backend: Literal[jinja2, mako])

Create a quickstart project.

liara.cmdline.check_tools(env: liara.cmdline.Environment, try_install: bool)
liara.cmdline.list_content(env: liara.cmdline.Environment, format: Literal[tree, list, json], content_type: list[str])

List all content.

If format is set to tree, this will print the content as a tree. If format is set to list, this will produce a flat list instead. JSON will print a JSON structure with information for each node.

liara.cmdline.serve(env: liara.cmdline.Environment, browser: bool, port: int, cache: bool, admin: bool)

Run a local development server.

liara.cmdline.cache(env: liara.cmdline.Environment, action: Literal[clear, inspect])

Modify or inspect the cache.

liara.cmdline.inspect()

Inspect state, for example, site data or template matching.

liara.cmdline.inspect_data(env: liara.cmdline.Environment)

Inspect the content of site.data.

liara.cmdline.inspect_data_files(env: liara.cmdline.Environment)

List all data files.

liara.cmdline.inspect_template_match(env: liara.cmdline.Environment, path: str, kind: Optional[Literal[document, index]])

Match a template pattern.