diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-05-11 21:38:22 -0600 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:16 +0200 |
| commit | 1cbb2a40c886603a2e2ccc883179cc2d196280e1 (patch) | |
| tree | 88b4b32748e8d4f931414371f3b93011315d27f3 /html/Makefile | |
| parent | ec2741ae85303309253cb790d8d0554cd358d919 (diff) | |
| download | muhqs-game-1cbb2a40c886603a2e2ccc883179cc2d196280e1.tar.gz muhqs-game-1cbb2a40c886603a2e2ccc883179cc2d196280e1.zip | |
make rules in html linkable
Diffstat (limited to 'html/Makefile')
| -rw-r--r-- | html/Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/html/Makefile b/html/Makefile index e28c9dee..5c462103 100644 --- a/html/Makefile +++ b/html/Makefile @@ -26,6 +26,8 @@ GENERATE_CARD_LISTING := $(GAME_ROOT)/scripts/generate_card_listing.py GENERATE_HOVER_LINKS := $(GAME_ROOT)/scripts/generate_card_hover_links.py +PREPARE_RULES := $(GAME_ROOT)/scripts/prepare_html_rules.py + SETS := $(shell find $(CARDS_YML_DIR) -mindepth 1 -type d -printf "%f\n") SETS_SOURCEDIRS := $(foreach set, $(SETS), $(addprefix $(CARDS_YML_DIR)/, $(set))) @@ -123,6 +125,15 @@ $(1)/%.html: %.md $(MAKEFILE_LIST) $(HTML_TEMPLATE) $(GENERATE_HOVER_LINKS) else $(GENERATE_HOVER_LINKS) $$< | pandoc $(PANDOC_FLAGS) $(2) -o $$@; fi endef +define generateRulesHtml +$(1)/%.html: %.md $(MAKEFILE_LIST) $(HTML_TEMPLATE) $(GENERATE_HOVER_LINKS) + @echo "building $$@" + @if test \( ! \( -d $$(@D) \) \); then mkdir -p $$(@D);fi + $(VERBOSE) if [[ $$$$(cat $$< | wc -l) -gt 80 ]]; \ + then $(GENERATE_HOVER_LINKS) $$< | pandoc --toc $(PANDOC_FLAGS) $(2) | $(PREPARE_RULES) > $$@; \ + else $(GENERATE_HOVER_LINKS) $$< | pandoc $(PANDOC_FLAGS) $(2) | $(PREPARE_RULES) > $$@; fi +endef + $(eval $(call generateHtml, $(BUILDDIR),)) -$(eval $(call generateHtml, $(BUILDDIR)/rules, -N)) +$(eval $(call generateRulesHtml, $(BUILDDIR)/rules, -N)) $(eval $(call generateHtml, $(BUILDDIR)/blog,)) |
