Skip to main content

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.

Metadata

Release files for foliantcontrib.init 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foliantcontrib.init 1.0.10
File Size Uploaded
foliantcontrib.init-1.0.10.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foliantcontrib.init 1.0.10
File Interpreter ABI Platform
foliantcontrib.init-1.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / foliantcontrib.init-1.0.10.tar.gz

Download URL foliantcontrib.init-1.0.10.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e2eee04036d8cc2ff2650b608006d6022da7701972d56d413dc14e73b79b07ed
BLAKE2b-256 checksum
How to use checksums
d47c741c8e5c86660e2514d22257cf93387904fd9272fc18ec104edfc8d52ac5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / foliantcontrib.init-1.0.10-py3-none-any.whl

Download URL foliantcontrib.init-1.0.10-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ed9607c72c84bc25064df874bfa885a832f88a169f8701f25328e9517a90be1
BLAKE2b-256 checksum
How to use checksums
3f94877c728fc5b59693ee3d866a1ffc6c3a9c837f7a823094adf549e71f3b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

1.0.10 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

1 release file

1.0.6

1 release file

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page