https://github.com/ziqi-yang/jpg
[mirror] Just a Project Generator
https://github.com/ziqi-yang/jpg
generator just project template
Last synced: 3 months ago
JSON representation
[mirror] Just a Project Generator
- Host: GitHub
- URL: https://github.com/ziqi-yang/jpg
- Owner: Ziqi-Yang
- License: other
- Created: 2024-03-24T14:21:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-21T05:17:22.000Z (5 months ago)
- Last Synced: 2025-04-01T20:53:25.072Z (3 months ago)
- Topics: generator, just, project, template
- Language: Just
- Homepage: https://codeberg.org/meow_king/jpg
- Size: 59.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Just a Project Generator
A simple and powerful project generator using
[just](https://github.com/casey/just)To use this tool, you may need the knowledge of
[just](https://github.com/casey/just) and shell script (However, `just`
let you run script using many other languages).Basically, `jpg` provides you with useful `just` recipes, which can be
used in your own command to generate projects.## Features
1. fully customizable
2. simple and there is no extra rules you need to learn
3. use languages and tools you know and you like (e.g.
[cargo-generate](https://github.com/cargo-generate/cargo-generate)
for rust project)## Installation
we install `jpg` at [global `just`
directory](https://github.com/casey/just?tab=readme-ov-file#global-and-user-justfiles).``` sh
mkdir -p ~/.config/just
cd ~/.config/just
git clone https://codeberg.org/meow_king/jpg.git jpg
```Create and edit `~/.config/just/justfile`. Example file:
``` justfile
set allow-duplicate-variablesimport "./jpg/mod.just"
import "~/.config/jpg/mod.just"default:
just -g --list
```Create your user files and template files at `~/.config/jpg/`.
You can take as a
reference.## Usage
just -g
you can use `just -g --list` to show list of available commands.
### Override jpg variables
For example, if you want to override `JPG_V_USER_NAME`, you can add this
to your `~/.config/just/justfile`.``` just
JPG_V_USER_NAME := "Name"
```### Define your own template
Be sure to read all libraries files of `jpg` to know the recipes you can
use and what dependencies they need.For example:
``` just
[doc("create new Emacs project")]
new-emacs name: (exit-if-exists name) (jpg-copy-template name "emacs") (jpg-git-jj-init name)
#!/usr/bin/env sh
set -eu
cd '{{name}}'
mv -n ./xxx.el '{{name}}.el'
read -p "description: " description
export description
just -g jpg-render-jinja2 .
wget https://raw.githubusercontent.com/alphapapa/makem.sh/master/makem.sh
chmod +x ./makem.sh
```