Just
Just is a cross-platform task runner that can perform multiple tasks with only a simple command. In other words, it is a useful automation tool that I go into more detail on my project layout garden plot. Here, I'm only going to give the minimum of using it for writing.
Installation
Your local package management system should have a package for Just. It will probably be called just
. Alternatively, you could go to the release page and install it.
Justfile
Just uses a Justfile
to control the scripts. You can do a lot with that, but the easiest approach is to create //Justfile
(no extension) and put in a common header.
set dotenv-load
_default:
just --choose
If you aren't comfortable with Git commits, you could add the following fragment:
commit MESSAGE:
git add -A .
git commit -am $MESSAGE
The MESSAGE
means you have to provide a message when you type just commit "this is a message"
.
If you type just
and hit return, it will bring up a chooser program to let you select your option (ironically except for the above commit target because it requires a message), but if you have other fragments, such as “build”, then it will show up there.
╭──────────────────────────────────╮
│ # Builds the EPUB version of the │
│ [group("building")] │
│ build-epub: │
│ mfgames-writing-format build │
│ │
│ │
│ │
│ │
│ │
│ │
install │ │
chapter-summary │ │
build-pdf │ │
▌ build-epub │ │
build-docx │ │
build │ │
6/6 (0) ───────────────────────── │ │
> ╰──────────────────────────────────╯
You can also type the target inside the folder, such as just build-epub
. This is true even if you are inside another folder.