From 88c06828a097914c971a893f0048cd911e9b1a22 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 30 Apr 2019 14:32:56 -0400 Subject: Use Lua script to generate README, doc.go and index.html rather than autoreadme --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5a78d8e --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +doc : README.md doc.go doc/index.html.ok + +test : + go test -v + +cov : + go test -v -coverprofile=coverage && go tool cover -html=coverage -o=coverage.html + +check : + golint . + go vet -all . + gofmt -s -l . + +%.html.ok : %.html + tidy -quiet -output /dev/null $< + touch $@ + +README.md doc.go doc/index.html : document.md + +doc/body.md README.md doc.go : document.md + lua doc/doc.lua + gofmt -s -w doc.go + +doc/index.html : doc/hdr.html doc/body.html doc/ftr.html + cat doc/hdr.html doc/body.html doc/ftr.html > $@ + +doc/body.html : doc/body.md + markdown -f +links,+image,+smarty,+ext,+divquote -o $@ $< + +clean : + rm -f coverage.html coverage doc/*.ok doc/body.md README.md doc.go doc/index.html doc/body.html -- cgit v1.2.1-24-ge1ad From 54f3906c54220782edebd4fef4d8052d0d1d658e Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 30 Apr 2019 15:17:28 -0400 Subject: Remove README template --- Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5a78d8e..887ffd8 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ check : tidy -quiet -output /dev/null $< touch $@ -README.md doc.go doc/index.html : document.md - doc/body.md README.md doc.go : document.md lua doc/doc.lua gofmt -s -w doc.go -- cgit v1.2.1-24-ge1ad 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 From 514e371ce761f71cf004bf0da3246824310b2e4f Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 7 May 2019 15:20:57 -0400 Subject: Add command line goreportcard check; address ineffectual assignments called out by this tool --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b0a5e06..410c89e 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ check : golint . go vet -all . gofmt -s -l . + goreportcard-cli -v README.md : doc/document.md pandoc --read=markdown --write=gfm < $< > $@ -- cgit v1.2.1-24-ge1ad From 65c03ae855f64ff46c37f9d58ed572a302bd355d Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 9 May 2019 10:21:35 -0400 Subject: Handle errors in UTF-8 example --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 410c89e..f2590bd 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ check : golint . go vet -all . gofmt -s -l . - goreportcard-cli -v + goreportcard-cli -v | grep -v cyclomatic README.md : doc/document.md pandoc --read=markdown --write=gfm < $< > $@ -- cgit v1.2.1-24-ge1ad From 5f4e2f65402b9aa611f93b2fa14ea69bf7b26d2d Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 18 May 2019 08:08:21 -0400 Subject: Generalize awk script that produces doc.go --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f2590bd..90624c5 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ doc/index.html : doc/document.md doc/html.txt --metadata pagetitle="GoFPDF Document Generator" < $< > $@ doc.go : doc/document.md doc/go.awk - pandoc --read=markdown --write=plain $< | awk -f doc/go.awk > $@ + pandoc --read=markdown --write=plain $< | awk --assign=package_name=gofpdf --file=doc/go.awk > $@ gofmt -s -w $@ build : -- cgit v1.2.1-24-ge1ad