From 012219bbfba1ce62b4eb67be9b0411e545a9ed8c Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 22 Nov 2018 21:14:21 -0500 Subject: [PATCH] docs: derive docs/index.md from README.md The two files are identical except README.md links to docs/* while index.md links to *. A sed script can do that transformation, so use sed to do it. This does modify a file in git, but this is necessary to make all the Github views work consistently. Signed-off-by: Zygo Blaxell --- docs/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 2a3cdf7..a7068fa 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,8 +1,12 @@ MARKDOWN := $(firstword $(shell type -P markdown markdown2 markdown_py 2>/dev/null || echo markdown)) .PHONY: docs -docs: $(subst .md,.html,$(wildcard *.md)) ../README.html +docs: $(subst .md,.html,$(wildcard *.md)) index.html ../README.html %.html: %.md $(MARKDOWN) $< | sed -e 's/\.md/\.html/g' > $@.new mv -f $@.new $@ + +index.md: ../README.md + sed -e 's:docs/::g' < ../README.md > index.md.new + mv -f index.md.new index.md