Library and CLI for generating installation instructions from json schema and jinja templates.
pipx install installation-instruction
python -m pip install installation-instruction
(Don't try at home.)
name: installation-instruction
type: object
properties:
method:
enum:
- pipx
- pip
----------------------------------
{% call command() %}
{% if method == "pip" %}
python -m pip
{% else %}
pipx
{% endif %}
install installation-instruction
{% endcall %}
Usage: ibi [OPTIONS] COMMAND [ARGS]...
Library and CLI for generating installation instructions from json schema
and jinja templates.
Options:
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
default Default command to create custom default settings with add,...
cat Shows source of installation instructions config file.
install Installs with config and parameters given.
show Shows installation instructions for your specified config file...
Options are dynamically created with the schema part of the config file.
Tip
Show help for a config file with: ibi show CONFIG_FILE/FOLDER/GIT_REPO_URL --help
.
- The config is comprised of a single file
install.cfg
. - The config has two parts delimited by
------
(6 or more-
). - Both parts should be developed in different files for language server support.
- The first section of the config is a json-schema.
- It can be written in JSON or to JSON capabilites restricted YAML.
- When creating a schema use the following schema draft version: https://json-schema.org/draft/2020-12/schema
title
are used for pretty print option names.description
is used for the options help message.- For adding a description and a pretty print name to enum values (for web-installation-instruction):
- Indent the schema with the key
schema
. - Add
pretty
anddescription
keys. - Create lists like
key: Pretty Key
.
- Indent the schema with the key
title
anddescription
from within the schema overwritepretty
anddescription
outside of the schema.
schema:
name: installation-instruction
type: object
properties:
method:
enum:
- pipx
- pip
pretty:
pipx: Pipx
pip: Pip
description:
pipx: Installs python packages into virtual environments.
pip: Standard python package manager.
- For the package to set the default os to the running system, name the property
__os__
.
__os__:
- windows
- linux
- macos
- Non empty lines are executed one by one.
- Wrapping a command with
{% call command() %}
and{% endcall %}
essentially removes all line breaks for convenience. - If you wish to stop the render from within the template you can use the macro
raise
. ({{ raise("no support!") }}
.)
Please have a look at the examples.
If you want to contribute to the development of installation_instruction
, we recommend
the following editable installation from this repository:
python -m pip install --editable .[tests]
Having done so, the test suite can be run using pytest
:
python -m pytest
This repository was set up using the SSC Cookiecutter for Python Packages.