-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It is helpful to distinguish between the types of content, such as posts and diagrams, as multiple files may be involved in drafts.
…images from Mermaid diagrams
The idea is simple: find all existing diagrams, construct the right image names by changing the suffix, state the images are pre-requisites for the target, and let the implicit rule defined above handle the rest.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-runningconvert
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
Testing
This has been tested with some of the files from #40.