Discover the power of BluePrinter, a template engine based on Apache Velocity designed to create files from templates.
BluePrinter is a template engine based on Apache Velocity designed to create files from templates.
It allows users to enter values for placeholders in the template and generate output files. BluePrinter can be used to automate file creation tasks and generate files with dynamic content.
Users can interact with BluePrinter through an interactive command-line interface that prompts them for input values. BluePrinter can be extended with plugins to add custom functionality and support additional features.
I wanted a tool that allows me to:
- Create files from templates with placeholders.
- Prompt users for input values during file creation.
- Extend functionality with plugins, for exemple:
- Fetch data from external sources. (API, Database, Environment Variables, Web Scraping, etc.) to populate templates.
- Generate files in different formats. (JSON, XML, CSV, etc.)
- Generate README files, with result of tests, benchmarks, etc.
You can find more examples of my use cases in my adventofcode repository.
- Java 21 or higher
- Maven 3.6.3 or higher
To get started with BluePrinter, you can follow the installation instructions and use the command-line interface to create files from templates.
Or you can use the BluePrinter API to integrate it with your applications and extend its functionality with plugins.
Show instructions
- Download the latest release from the releases page.
- You can download the
blueprinter.zipfile for Windows or theblueprinter.tar.gzfile for Linux.
- You can download the
- Extract the contents of the archive in a
blueprinterdirectory. - Add the
blueprinterdirectory to your PATH environment variable.- On Windows, you can add the directory to the PATH using the System Properties dialog.
- On Linux, you can add the directory to the PATH by editing the
.bashrcor.bash_profilefile.- Example:
export PATH=$PATH:/path/to/blueprinter
- Example:
- Run the
bpcommand to run BluePrinter.
Show instructions
-
Clone the repository:
git clone https://github.com/yourusername/blueprinter.git cd blueprinter -
Build the project using Maven:
mvn clean install
-
Run the application:
java -jar blueprinter-shell/target/blueprinter-shell-1.1.5.jar
Show instructions
- Add the BluePrinter dependency to your
pom.xmlfile:<dependency> <groupId>dev.vinyard.blueprinter.runner</groupId> <artifactId>blue-printer-runner</artifactId> <version>1.2.0</version> </dependency>
To use BluePrinter, you can run the application and follow the prompts to create files from templates. You can also extend its functionality by adding plugins.
You can use the command line interface to interact with BluePrinter:
java -jar blueprinter-1.0.0.jar --template my-template.vm --output my-output.txt- Template Engine: Create files from templates using Apache Velocity.
- Interactive Prompts: Ask users for necessary information during file creation.
- Plugin Support: Extend functionality with custom plugins.
- Flexible Configuration: Configure templates and output files easily.
-
Create a template file
my-template.vm:Hello, $name! -
Run BluePrinter with the template:
java -jar blueprinter-1.0.0.jar --template my-template.vm --output my-output.txt
-
Follow the prompts to enter the value for
name. -
The output file
my-output.txtwill be created with the contentHello, <name>.
-
Add your plugin dependency in
pom.xml:<dependency> <groupId>com.example</groupId> <artifactId>my-plugin</artifactId> <version>1.0.0</version> </dependency>
-
Implement your plugin and register it with BluePrinter.
Contributions are welcome! Please fork the repository and submit a pull request.
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes
- Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
