Usage¶
Installation¶
To use AutoGenFiles, first install it using pip:
(.venv) $ pip install autogenfiles
AutoGenFiles in action¶
For using AutoGenFiles you need a templates/ directory with templates inside and a variables.yaml file with a variables section.
Example¶
Then create a templates folder and templates inside of it:
$ mkdir templates
$ touch templates/{{ project_name }}.md
The content of the templates could be something like this:
---
layout: post
title: '#{{ project_name }}'
image: "{{ project_number }}.jpg"
---
Welcome to {{ project_name }}!
{{ project_description }}
Now create a variables.yaml:
$ touch variables.yaml
And add the following content:
[variables]
project_name = AutoGenFiles
project_number = 42
project_description = Generate files from templates
Now run autogenfiles:
(.venv) $ autogenfiles
Other examples¶
For more examples on how to use AutoGenFiles checkout AutoGenFiles Playground repository.