Crates.io | cakecutter |
lib.rs | cakecutter |
version | 0.1.0 |
source | src |
created_at | 2022-03-09 05:14:12.06408 |
updated_at | 2022-03-09 05:14:12.06408 |
description | Cakecutter is a utility tool to help you create new projects quickly, from pre-built cakes |
homepage | |
repository | |
max_upload_size | |
id | 546756 |
size | 61,873 |
Cakecutter is a utility tool that quickly sets up a project from a pre-built template.
All template files are in .toml
format, which means they are easy to edit and share with others.
Here's a python project demo
Notice how it created the files and ran the VENV command to initialise the virtual environment, and started installing the dependencies
cargo install cakecutter
cakecutter [TEMPLATE_NAME]
You can also use cakes from github (Provided they have a Cake.toml
file in the root directory of the repository):
cakecutter https://github.com/dhravya/cakecutter
It's really easy to make your own cakefile. There are 4 main sections:
[metadata]
[filestructure]
[content]
[commands]
Since TOML doesn't support .
and /
as keys, we use -
and --
instead.
so instead of main.py
, we use main-py
and instead of src/main.py
we use src--main-py
Metadata is optional, but when you include it, make sure to include the following:
name
: The name of your cakeversion
: Cake versiondescription
: What the cake is forauthor
: The author of CakeThe file structure is where you define the structure of your project.
To include files in the current directory, put them in the root
list
root = [".gitignore", "Cargo.toml", "README.md", "LICENSE"]
For every other directory, use the following syntax:
directory_name = [file1, file2]
So for this repository, it looks something like
root = [".gitignore", "Cargo.toml", "README.md", "LICENSE"]
examples = ["Python.toml"]
Content is where you define the content of your files. It's pretty simple, just write the name of file (following the basic rules) and the content of the files after it
[content]
src--main-py = """
print("Hello World")
"""
This will fill in the file src/main.py
with the content of the string.
These are the commands that run when a cake is made (Stuff like installing dependencies)
All keys here should be numbers starting from one and increasing progressively.
Commands should be written as if written in a Dockerfile
Here's an examples:
[commands]
1 = ['python', '-m', 'venv', 'venv']
2 = ['pip', 'install', '-r', 'requirements.txt']
3 = ['python', 'src/main.py']
This project is licensed under the mit license
Leave a ⭐ if you like this project
Readme made with 💖 using README Generator by Dhravya Shah