Create Foliant projects from templates.
Project description
Project Initializer for Foliant
This CLI extension add init
command that lets you create Foliant projects from templates.
Installation
$ pip install foliantcontrib.init
Usage
You can create a project from the default base template or from a custom template
Base template
Create project from the default base template:
$ foliant init
Enter the project name: Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in awesome-docs
Custom template
You can load a custom template from a local path or from a git repo
Custom template from a local path
$ foliant init --template /path/to/custom/template
Enter the project name: Awesome Customized Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Customized Docs" created in awesome-customized-docs
Custom template from a git repository
$ foliant init --template https://github.com/path/to/custom/template
Enter the project name: Awesome Docs from git
────────────────────
Project "Awesome Docs from git" created in awesome-docs-from-git
Other options
You can provide the project name without user prompt:
$ foliant init --name Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in awesome-docs
Another useful option is --quiet
, which hides all output except for the path to the generated project:
$ foliant init --name Awesome Docs --quiet
awesome-docs
To see all available options, run foliant init --help
:
$ foliant init --help
usage: foliant init [-h] [-n NAME] [-t NAME, PATH or git-repo] [-q] [-d]
Generate a new Foliant project.
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Name of the Foliant project.
-t NAME, PATH or git-repo, --template NAME, PATH or git-repo
Name of a built-in project template or path to custom one.
-q, --quiet Hide all output accept for the result. Useful for piping.
-d, --debug Log all events during project creation. If not set, only warnings and errors are logged.
Project Templates
A project template is a regular Foliant project but maybe containing placeholders in files. When the project is generated, the placeholders are replaced with the values you provide. Currently, there are two placeholders: $title
and $slug
.
There is a built-in template called base
. It's used by default if no template is specified.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for foliantcontrib.init-1.0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36cd61a77ba61c45a6ec3d2cdc2aba2914b3704005ef0065d9f1c468e1ba372 |
|
MD5 | aca4814765683e31c18a13c32093091d |
|
BLAKE2b-256 | 8456a133f5044ae2a8db9171fa14d15f60f2677f49d26cfb2fd97d5df04ded95 |
Hashes for foliantcontrib.init-1.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83193b5dbcc9a01961bb4672f085ce52b9199376bc987915bf713536b5e7b5d |
|
MD5 | 8d74a918cc6b75c9d8d8e7f978483dc8 |
|
BLAKE2b-256 | 85c808139ed898e3d0f68707cdf59a3ffd3787ef30783cccf790c633672e911d |