From 56234bc8898673b1bbe4126258a9fac7f52371f9 Mon Sep 17 00:00:00 2001 From: niamtokik Date: Sat, 4 Nov 2023 15:34:34 +0000 Subject: [PATCH] add notes --- Makefile | 79 +++++++++++++++++++ .../README.md | 23 ++++++ notes/README.md | 21 +++++ notes/_template/README.md | 11 +++ 4 files changed, 134 insertions(+) create mode 100644 Makefile create mode 100644 notes/0001-creating-custom-mnesia-backends-from-scratch/README.md create mode 100644 notes/README.md create mode 100644 notes/_template/README.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1ad8ba0 --- /dev/null +++ b/Makefile @@ -0,0 +1,79 @@ +###################################################################### +# A simple makefile to generate notes as epub/pdf/html/plaintext +# it requires gnumakefile, a shell, grep and pandoc (with pdf support) +###################################################################### +BUILD_DIR ?= _build/notes +NOTES_DIR ?= notes +NOTES = $(shell ls $(NOTES_DIR) | grep -E "^[0-9]+-") +PANDOC_OPTS = -C +PANDOC = pandoc $(PANDOC_OPTS) + +###################################################################### +# template to generate the targets +###################################################################### +define pandoc_template = +NOTES_TARGETS += $$(BUILD_DIR)/$(1).pdf +$$(BUILD_DIR)/$(1).pdf: + $(PANDOC) -f markdown -t pdf -o $$@ \ + --resource-path="$$(NOTES_DIR)/$(1)" \ + "$$(NOTES_DIR)/$(1)/README.md" + +NOTES_TARGETS += $$(BUILD_DIR)/$(1).epub +$$(BUILD_DIR)/$(1).epub: + $(PANDOC) -f markdown -t epub -o $$@ \ + --resource-path="$$(NOTES_DIR)/$(1)" \ + "$$(NOTES_DIR)/$(1)/README.md" + +NOTES_TARGETS += $$(BUILD_DIR)/$(1).txt +$$(BUILD_DIR)/$(1).txt: + $(PANDOC) -f markdown -t plain -o $$@ \ + --resource-path="$$(NOTES_DIR)/$(1)" \ + "$$(NOTES_DIR)/$(1)/README.md" + +NOTES_TARGETS += $$(BUILD_DIR)/$(1).html +$$(BUILD_DIR)/$(1).html: + $(PANDOC) -f markdown -t html -o $$@ \ + --resource-path="$$(NOTES_DIR)/$(1)" \ + "$$(NOTES_DIR)/$(1)/README.md" +endef + +###################################################################### +# default target, used to build automatically the notes +###################################################################### +.PHONY += all +all: notes + +###################################################################### +# create the build directory +###################################################################### +$(BUILD_DIR): + mkdir -p $@ + +###################################################################### +# generate all templates based on notes directory name +###################################################################### +$(foreach note,$(NOTES),$(eval $(call pandoc_template,$(note)))) + +###################################################################### +# generate all notes +###################################################################### +.PHONY += notes +notes: $(BUILD_DIR) $(NOTES_TARGETS) + +###################################################################### +# remove all generated articles and notes +###################################################################### +.PHONY += clean +clean: + rm $(NOTES_TARGETS) + +###################################################################### +# usage +###################################################################### +help: + @echo "Usage: make [help|all|notes|clean]" + +###################################################################### +# .PHONY target +###################################################################### +.PHONY: $(.PHONY) diff --git a/notes/0001-creating-custom-mnesia-backends-from-scratch/README.md b/notes/0001-creating-custom-mnesia-backends-from-scratch/README.md new file mode 100644 index 0000000..6775bdb --- /dev/null +++ b/notes/0001-creating-custom-mnesia-backends-from-scratch/README.md @@ -0,0 +1,23 @@ +--- +date: 2023-11-04 +title: Mnesia Backends +subtitle: The Missing Documentation and Procedures to Create Custom Mnesia Backends +author: Mathieu Kerjouan +keywords: [erlang,otp,mnesia,backends,backend,database] +license: CC BY-NC-ND +abstract: +--- + +# Mnesia Backends + +## The Missing Documentation and Procedures to Create Custom Mnesia Backends + +## Introduction + +## Using Mnesia + +## Custom Backends + +### Unix Filesystem Backend + +# References and Resources diff --git a/notes/README.md b/notes/README.md new file mode 100644 index 0000000..2801348 --- /dev/null +++ b/notes/README.md @@ -0,0 +1,21 @@ +--- +title: Notes and Comments +--- + +This part of the repository is dedicated for the notes and comments +from the developers, to explain the "why" they created something and +what was their ideas. + +**All articles MUST be licensed under [CC +BY-NC-ND](https://creativecommons.org/licenses/by-nc-nd/4.0/)**. + +| Date | Title | Author | Notes | +|------------|-----------------------------|--------|-------| +| + +The codes presented in these articles are usually tested under OpenBSD +and ParrotLinux (Debian-like distribution) with the latest major +release of Erlang (R25 or R26). + +These articles are also available in EPUB, PDF and HTML files. A +template is available in [`_template`](_template) directory. diff --git a/notes/_template/README.md b/notes/_template/README.md new file mode 100644 index 0000000..77aba5c --- /dev/null +++ b/notes/_template/README.md @@ -0,0 +1,11 @@ +--- +date: 2023-02-25 +title: +subtitle: +author: +keywords: +license: CC BY-NC-ND +abstract: +--- + +