Automation

Up a Level

Transforming the source files[1] into the desired output (PDF and EPUB) is one of the key components of the Model-View-Controller[2] approach of working with Git. These are programs that take the source, make it pretty, and generate the output.

1: ../text-files/
2: ../model-view-controller/

Probably the best, first approach to transformations is a program called Pandoc. Over the years, I feel I have gone beyond that program do and wrote my own program, MfGames Writing. There are many others out there and I hope to document them, but originally I'm going to focus on the two main ones.

MfGames Writing

While I give typed commands for doing various things, it can be difficult to remember every single option. Nor should anyone have to recall such trivia. Instead, writing scripts or tools that do all the work makes a life a lot easier.

For example, say to build the files using MfGames Writing are:

mfgames-writing build pdf
mfgames-writing build epub
mfgames-writing build docx

With Just[3], I can create a file in `//Justfile` with this content:

3: //d.moonfire.us/garden/project-layout/just/
_default:
  just --choose

build: build-epub build-pdf build-docx

build-epub:
    mfgames-writing build epub

build-pdf:
    mfgames-writing build pdf

build-docx:
    mfgames-writing build docx

While this is more complicated, it is a one-time setup just so I can run the following command:

just build

If I only want the PDF? I just have to type: `just build-pdf`.

Footer

Below are various useful links within this site and to related sites (not all have been converted over to Gemini).

Now
Contact
Biography
Bibliography
Support
Fiction
Fedran
Coding
The Moonfires
Categories
Tags
Privacy
Colophon
License
Mailing List