base the project on OG-CSRD to try to stay maintained

if this branch makes it to core, it's because this was a far easier
thing to keep patches up to date with than having to hack the DOCX SRD
apart and back together again. naturally, I went through all of that
work and then CSRD updates happened and everything unraveled. this is
hopefully a better way to do things, by leaning on the existing
community's work

anyway, this creates the CCSRD based on the OG-CSRD and omits the
incorporeal-cms parts of this, since my project doesn't understand
Pandoc Markdown, but Pandoc does (naturally)
This commit is contained in:
2025-07-19 15:25:21 -05:00
parent 9cd6d21628
commit 5aeaedb169
45 changed files with 22 additions and 171498 deletions

View File

@@ -1,18 +1,14 @@
TMPDIR := ./_tmp
CSRD := ./srd/Cypher-System-Reference-Document-2025-05-05-fixed.docx
MD_CSRD := $(TMPDIR)/csrd.md
CSRD := ./og-csrd/index.html
MD_CSRD := $(TMPDIR)/og-csrd.md
CCSRD := $(TMPDIR)/ccsrd.md
WEBDIR := ./incorporealcms-instance
PAGESDIR := $(TMPDIR)/$(WEBDIR)/pages
WEBDIR := $(TMPDIR)/web
HTML_OUT := $(WEBDIR)/index.html
BASE_PATCH_DIR := ./patches/base
BASE_PATCHES := $(wildcard $(BASE_PATCH_DIR)/*.patch)
BASE_PATCHES_OUT := $(subst $(BASE_PATCH_DIR),$(TMPDIR),$(BASE_PATCHES))
WEB_PATCH_DIR := ./patches/web
WEB_PATCHES := $(wildcard $(WEB_PATCH_DIR)/*.patch)
WEB_PATCHES_OUT := $(subst $(WEB_PATCH_DIR),$(TMPDIR),$(WEB_PATCHES))
# DEFAULT BUILD
all: base
@@ -20,7 +16,6 @@ all: base
# CCSRD VERSIONS
base: $(CCSRD) $(BASE_PATCHES_OUT)
web: base $(WEB_PATCHES_OUT)
# CLEANUPS
@@ -38,29 +33,22 @@ $(TMPDIR)/%.patch: $(BASE_PATCH_DIR)/%.patch
@patch $(CCSRD) $< --quiet
@touch $@
$(TMPDIR)/%.patch: $(WEB_PATCH_DIR)/%.patch
$(info >>> WEB '$<')
@patch $(CCSRD) $< --quiet
@touch $@
# OUTPUTS
http: base web
cp -a $(WEBDIR) $(TMPDIR)/
mkdir -p $(PAGESDIR)
cp $(CCSRD) $(PAGESDIR)/index.md
incorporealcms-build $(TMPDIR)/$(WEBDIR) /var/www/localhost/incorporealcms-testing/root
web: $(CCSRD)
mkdir -p $(WEBDIR)
pandoc $(CCSRD) -s -o $(HTML_OUT)
# BUILD STEPS
# generate the basic markdown file
$(MD_CSRD): $(CSRD) | $(TMPDIR)
pandoc -f docx -t gfm $(CSRD) -o $(MD_CSRD) --columns 120
# create the markdown file to patch
$(CCSRD): $(MD_CSRD)
cp -a $(MD_CSRD) $(CCSRD)
# create the build dir
$(TMPDIR):
mkdir -p $(TMPDIR)
# generate the root markdown file
$(MD_CSRD): $(CSRD) | $(TMPDIR)
pandoc $(CSRD) -o $(MD_CSRD) --columns 120
# create the markdown file to patch
$(CCSRD): $(MD_CSRD)
cp -a $(MD_CSRD) $(CCSRD)