liara.cmdline¶
Module Contents¶
Classes¶
The command line environment. |
Functions¶
Liara is a static page generator. |
|
Build a site. |
|
Validate links. |
|
List all tags. |
|
Find pages by tag. |
|
Create a document. |
|
Create a default configuration. |
|
Create a quickstart project. |
|
List all content. |
|
Run a local development server. |
|
Modify or inspect the cache. |
|
Inspect state, for example, site data or template matching. |
|
Inspect the content of site.data. |
|
List all data files. |
|
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.
- liara.cmdline.validate_links(env: liara.cmdline.Environment, link_type)¶
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
formatis set totree, this will print the content as a tree. Ifformatis set tolist, 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.