summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-17 21:30:00 -0500
committerJune McEnroe <june@causal.agency>2019-02-17 21:30:00 -0500
commit5666794d51b927cca3dec538abacd67f5f1fcf7a (patch)
tree421d19ead13d709d4d9cf709c7f28cb31c304437 /bin
parentAdd hi -f html -o anchor for line number links (diff)
downloadsrc-5666794d51b927cca3dec538abacd67f5f1fcf7a.tar.gz
src-5666794d51b927cca3dec538abacd67f5f1fcf7a.zip
Generate HTML with hi -n -f html -o anchor
Running hi twice to insert stuff between the head and the content is a
bit of a hack but oh well.
Diffstat (limited to '')
-rw-r--r--bin/Makefile10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 9fa34ce9..43d2cce1 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -101,18 +101,16 @@ $(HTMLS): ttpre hi
 .SUFFIXES: .html
 
 .c.html:
-	@echo '<!DOCTYPE html>' > $@
-	@echo '<title>$(<:%.c=%)</title>' >> $@
+	@./hi -f html -o document,anchor,tab=4 -m $< /dev/null > $@
 	@echo '<code><a href="$(GITEA_URL)/$<">$< in git</a></code>' >> $@
 	man -P cat ./man1/$(<:%.c=%.1) | ./ttpre >> $@
-	./hi -f html -o inline,tab=4 $< >> $@
+	./hi -n -f html -o anchor $< >> $@
 
 .sh.html:
-	@echo '<!DOCTYPE html>' > $@
-	@echo '<title>$(<:%.sh=%)</title>' >> $@
+	@./hi -f html -o document,anchor,tab=4 -m $< /dev/null > $@
 	@echo '<code><a href="$(GITEA_URL)/$<">$< in git</a></code>' >> $@
 	man -P cat ./man1/$(<:%.sh=%.1) | ./ttpre >> $@
-	./hi -f html -o inline,tab=4 $< >> $@
+	./hi -n -f html -o anchor $< >> $@
 
 clean:
 	rm -f $(BINS_ALL) $(LINKS) tags scheme.h scheme.png *.o *.html
tr class='logheader'>2021-01-25Use vi and lessJune McEnroe I haven't used neovim in a couple weeks by now, so I may as well commit this. 2021-01-20Use mtags for sh in source-filterJune McEnroe 2021-01-20Generate tags for sh files in mtagsJune McEnroe Only matches functions declared at the beginnings of lines, but I'm fine with that. 2021-01-20Add messy sh lexerJune McEnroe Surprisingly seems to work for everything I looked at in my repos. 2021-01-20Add all target to git.causal.agency MakefileJune McEnroe 2021-01-20Remove Lua supportJune McEnroe Lua support is unused and the dlsym fwrite/write hacks horrify me. Clean it up. 2021-01-20Fix tests for diff spansJune McEnroe 2021-01-20Avoid matching ':' in make tagsJune McEnroe Otherwise a :: rule includes one of the ':'s in the tag name. 2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe Otherwise the "id" in "void" matches for "void id". 2021-01-19Escape \ and / in mtags search patternsJune McEnroe 2021-01-20Use mtags in source-filterJune McEnroe 2021-01-19Add mtags to generate tags for make and mdocJune McEnroe 2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe 2021-01-19Don't use a pager if reading standard inputJune McEnroe 2021-01-19Support BSD make syntax and match *.amJune McEnroe These don't really go together, but... 2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe Otherwise it ends up going into Shell state. 2021-01-18Allow matching lexers using first input lineJune McEnroe