Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add Makefile with utilities for creating posts and diagrams #43

Merged
merged 15 commits into from
Jan 26, 2024

Conversation

agrski
Copy link
Owner

@agrski agrski commented Jan 26, 2024

Why

Motivation

From my experiences in #40, it was somewhat involved to create and run the appropriate commands for generating images from Mermaid diagrams, particularly when considering the inclusion of copyright notices for each image. Regenerating these was also somewhat annoying, with the steps needing to be performed in the right order -- regenerating via mmdc didn't include the copyright notice, and re-running convert would add an additional such notice (thereby duplicating it).

In short, this process was ideal for automation. Makefiles are a convenient way of defining reusable recipes, especially when there are files in nested directories, regular transformations of file names, and multiple files which may need to be reprocessed. Makefiles have the further benefit that only out of date files need to be reprocessed, which is faster and more efficient, particularly when there are many such files in existence.

In addition, posts and Mermaid diagrams all have some level of boilerplate common to each of them. For posts, this is simply the front matter, whereas for diagrams it is not only the front matter but also definitions for styling classes of entities. Rather than having to copy & paste this from existing diagrams, it is convenient to be able to generate these from pre-defined templates, in the process creating files with the appropriate names.

Issues

What

Changes

  • Add Makefile at the project root.
  • Add Make recipe for listing available commands/targets.
  • Add Make recipe for creating new draft posts.
  • Add Make recipe for creating new Mermaid diagrams for draft posts.
  • Add Make recipe for (re)generating images from Mermaid diagrams.

Testing

This has been tested with some of the files from #40.

@agrski agrski self-assigned this Jan 26, 2024
@agrski agrski changed the title build: Add Makefile with utilities for creating posts and images build: Add Makefile with utilities for creating posts and diagrams Jan 26, 2024
@agrski agrski marked this pull request as ready for review January 26, 2024 22:56
@agrski agrski merged commit 98737e8 into master Jan 26, 2024
2 checks passed
@agrski agrski deleted the add-makefile branch January 26, 2024 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant