Getting started with github-docs-cookiecutter
- Requirements include python3, Nutri-Matic (docs & hooks), rust (rustup), and git-cliff (changelogs).
- Python3 Packages
- cookiecutter is required to utilize templates from github.
- Nutri-Matic is required to be sourced in python environment for template cookiecutter hooks to work.
- Python3 Packages
I find that it easiest to clone the nutri-matic repository. Use the included makefile to install all python dependencies with make python-install from within the cloned directory. Then, source the created file, .venv/bin/activate, or point the below script variable, PYTHON_VENV, to desired python virtual environment.
Examples
Bash script can be copied and pasted into a shell file. Then, used to begin generating new projects.
Template Options:
- cookiecutter-cookiecutter to generate new cookiecutter template projects.
- python3-cookiecutter to generate python3 projects.
- ansible-cookiecutter to generate ansible galaxy project.
#!/bin/bash
PYTHON_VENV="~/Documents/git_repo/nutri-matic/.venv/bin/activate"
PROJECT_NAME="example project name"
TEMPLATE="cookiecutter-cookiecutter"
LICENSE="AGPL-3.0-or-later"
BRANCH="main"
DESCRIPTION="Example cookiecutter template project."
rm -rf $PROJECT_NAME/
source $PYTHON_VENV
cookiecutter git@github.com:jcook3701/$TEMPLATE.git \
--checkout $BRANCH \
--no-input \
project_name=$PROJECT_NAME \
description=$DESCRIPTION \
license=$LICENSE
deactivate