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
```shell
$ pip install foliantcontrib.init
```
## Usage
Create project from the default “basic” template:
```shell
$ foliant init
Enter the project name: Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in /path/to/awesome-docs
```
Create project from a custom template:
```shell
$ foliant init --template /path/to/custom/template
Enter the project name: Awesome Customized Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Customized Docs" created in /path/to/awesome-customized-docs
```
You can provide the project name without user prompt:
```shell
$ foliant init --name Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in /path/to/awesome-docs
```
Another useful option is `--quiet`, which hides all output except for the path to the generated project:
```shell
$ foliant init --name Awesome Docs --quiet
/path/to/awesome-docs
```
To see all available options, run `foliant init --help`:
```shell
$ foliant init --help
usage: foliant init [-h] [-n NAME] [-t NAME or PATH] [-q]
Generate new Foliant project.
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Name of the Foliant project
-t NAME or PATH, --template NAME or PATH
Name of a built-in project template or path to custom one
-q, --quiet Hide all output accept for the result. Useful for piping.
```
## Project Templates
A project template is a regular Foliant project but 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 `basic`. It's used by default if no template is specified.
This CLI extension add `init` command that lets you create Foliant projects from templates.
## Installation
```shell
$ pip install foliantcontrib.init
```
## Usage
Create project from the default “basic” template:
```shell
$ foliant init
Enter the project name: Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in /path/to/awesome-docs
```
Create project from a custom template:
```shell
$ foliant init --template /path/to/custom/template
Enter the project name: Awesome Customized Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Customized Docs" created in /path/to/awesome-customized-docs
```
You can provide the project name without user prompt:
```shell
$ foliant init --name Awesome Docs
✔ Generating Foliant project
─────────────────────
Project "Awesome Docs" created in /path/to/awesome-docs
```
Another useful option is `--quiet`, which hides all output except for the path to the generated project:
```shell
$ foliant init --name Awesome Docs --quiet
/path/to/awesome-docs
```
To see all available options, run `foliant init --help`:
```shell
$ foliant init --help
usage: foliant init [-h] [-n NAME] [-t NAME or PATH] [-q]
Generate new Foliant project.
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Name of the Foliant project
-t NAME or PATH, --template NAME or PATH
Name of a built-in project template or path to custom one
-q, --quiet Hide all output accept for the result. Useful for piping.
```
## Project Templates
A project template is a regular Foliant project but 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 `basic`. 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
Close
Hashes for foliantcontrib.init-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6edeabf72595b6255d5c402cdb549ef8c9cad3c72077bc975cc4a129e2698310 |
|
MD5 | b690238cd64f59514c6e8c5d5900bdd0 |
|
BLAKE2b-256 | 809d4787f58fa74767ad73a75108c66a67cd9ebefd4448200b14a776efcba18c |
Close
Hashes for foliantcontrib.init-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e155860447d28b834d21869b682c7c1a47093c106eaedc11c12ed50b248bb3e9 |
|
MD5 | 7111c48817211f5fa803f78619558d5f |
|
BLAKE2b-256 | c1c0b7d0242d2858a2180ceeac0647fe2160bfef205f3ee7bc4179fa262b3f4c |