mirror of
https://github.com/erlang-punch/nostr
synced 2026-04-15 17:25:37 +00:00
This commit is a huge one. It had a lot of feature and design the whole project. Documentation, tests, notes, articles, introduction page and main codes have been added. All required dependencies have been added, thoas, gun, and cowboy. Those versions have been fixed. The current client implementation can use a websocket to fetch the event from a relay, the connection can also be closed. Some functions and modules have been created to permit to encode and decode payloads from/to a relay/client. This is not correctly done, yet. A part of nip/01 is already implemented but requires a better structure, better testing and better documentation as well. The parameters for rebar3 and the tools like compilers have been created to ensure a good quality for the produced code. A Makefile can be used to export the notes/articles in pdf, epub, plaintext or html formats.
49 lines
1.4 KiB
Makefile
49 lines
1.4 KiB
Makefile
######################################################################
|
|
# 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]+")
|
|
|
|
# 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
|
|
|
|
.PHONY += all
|
|
all: notes
|
|
|
|
$(BUILD_DIR):
|
|
mkdir -p $@
|
|
|
|
# generate all templates based on notes directory name
|
|
$(foreach note,$(NOTES),$(eval $(call pandoc_template,$(note))))
|
|
|
|
.PHONY += notes
|
|
notes: $(BUILD_DIR) $(NOTES_TARGETS)
|
|
|
|
.PHONY: $(.PHONY)
|