An open API service indexing awesome lists of open source software.

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

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-variables

import "./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
```