From 50996f28baf0361e2171a1f0cebdcc7106fef2ac Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 4 May 2019 19:42:18 -0400 Subject: Use Pandoc to generate README and doc.go --- Makefile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 887ffd8..b0a5e06 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -doc : README.md doc.go doc/index.html.ok +all : documentation -test : - go test -v +documentation : doc/index.html doc.go README.md -cov : +cov : all go test -v -coverprofile=coverage && go tool cover -html=coverage -o=coverage.html check : @@ -11,19 +10,19 @@ check : go vet -all . gofmt -s -l . -%.html.ok : %.html - tidy -quiet -output /dev/null $< - touch $@ +README.md : doc/document.md + pandoc --read=markdown --write=gfm < $< > $@ -doc/body.md README.md doc.go : document.md - lua doc/doc.lua - gofmt -s -w doc.go +doc/index.html : doc/document.md doc/html.txt + pandoc --read=markdown --write=html --template=doc/html.txt \ + --metadata pagetitle="GoFPDF Document Generator" < $< > $@ -doc/index.html : doc/hdr.html doc/body.html doc/ftr.html - cat doc/hdr.html doc/body.html doc/ftr.html > $@ +doc.go : doc/document.md doc/go.awk + pandoc --read=markdown --write=plain $< | awk -f doc/go.awk > $@ + gofmt -s -w $@ -doc/body.html : doc/body.md - markdown -f +links,+image,+smarty,+ext,+divquote -o $@ $< +build : + go build -v clean : - rm -f coverage.html coverage doc/*.ok doc/body.md README.md doc.go doc/index.html doc/body.html + rm -f coverage.html coverage doc/index.html doc.go README.md -- cgit v1.2.1-24-ge1ad