labo - LaTeX Bootstrapper
labo is a CLI-utility for bootstrapping LaTeX-projects based on templates.
It uses Jinja2 for the templating.
Configuration
By default labo looks for the configuration file in $HOME/.config/labo/labo.toml and $HOME/.labo.toml, in that order. Currently the only configuration option is the location of the templates. This is specified by the template_dir key:
template_dir = /home/user/.labo
Templates
A template for a LaTeX project for labo is specified by a config.toml file in a folder in the template directory. See example_template/ for a simple example.
The name of the template is determined by the name of this folder. In the config file the template files can be specified using the instantiate key.
For the time being it supports rendering LaTeX and Makefile templates using Jinja2.
Files that need to be copied or need to be linked to the new project can also be specified using the copy and link keys, respectively.
Below is an example of these keys
instantiate = ["main.tex", "Makefile"]
copy = ["document.tex"]
link = ["myclass.cls", "mypackage.sty"]
Variables
The templates can contain variables. These variables can either be defined using hooks or by specifying them
in the config.toml under the [variables] section.
labo prompts automatically for the variables during the bootstrapping of the project.
A variable can be defined as followed:
[variables]
var.prompt = "Foo"
var.default = 1
The prompt key defines the text used for prompting for the variable and is mandatory.
The default key is used to infer the type of the variable and is mandatory.
The variable can be used in a LaTeX-template by \VAR{var} and in a Makefile template by {{var}}.
Hooks
Before the templates are rendered a pre_template_hook is ran. This hook can be defined in a hooks.py
file in the template folder. This hook is passed four arguments: The current working directory, the project path, the options (see next section) and the variables. It is expected to return a dictionary of variables.
Since this hook allows for the execution of arbitrary Python code it is important to ensure that the hook does not contain any malicious code.
Options
A template can define extra options with the options key.
options = ["opt"]
Help
Using the help key a help message can be added to the template.
Usage
Using labo ls all templates can be listed. labo help <template> displays help information about the template <template>. To bootstrap a project use labo new <template> <project name> <template options>.
Metadata
Release files for labo 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| labo-0.1.4.tar.gz | 5.4 kB | Without provenance | Details for labo-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| labo-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for labo-0.1.4-py3-none-any.whl |
Total release size: 11.4 kB
Release files / labo-0.1.4.tar.gz
| Download URL | labo-0.1.4.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c4842b32f5c8d58250246c6889b74c1d3b499968adc9e9984bcea9cc0746f29
|
|
BLAKE2b-256 checksum How to use checksums |
69244a80d27a12057c9ce773399ebd65292c543a5d5d5592b06a1196fd95e084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|
Release files / labo-0.1.4-py3-none-any.whl
| Download URL | labo-0.1.4-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
540785b714028c14c749fb0729dfae31895354e326ec36c10977efcd317d7ba5
|
|
BLAKE2b-256 checksum How to use checksums |
7d2b214f1c9d3928bce520b85379b28cec10f1c82c404dd7392d4f0113187698
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|
Security for labo 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.