summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-10-13 18:38:33 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-10-13 18:38:33 -0400
commitf10939e21402781b0b6223dd64110df2da085ba0 (patch)
treebfd6c9f94c062d79128bbd709ef87726296d7e15
parent91d6aa7e2b6be8ce62e0598312ff618f68c66e47 (diff)
Include links to reference PDFs in README
-rw-r--r--README.md43
-rw-r--r--list/list.go59
-rwxr-xr-xmkdoc11
3 files changed, 111 insertions, 2 deletions
diff --git a/README.md b/README.md
index 25d68c3..8e0954a 100644
--- a/README.md
+++ b/README.md
@@ -114,6 +114,49 @@ the internal creation timestamps must be the same. To do this, the methods
SetCatalogSort() and SetCreationDate() need to be called for both files. This
is done automatically for all examples.
+[AddFont](pdf/reference/Fpdf_AddFont.pdf)
+[AddLayer](pdf/reference/Fpdf_AddLayer.pdf)
+[AddPage](pdf/reference/Fpdf_AddPage.pdf)
+[Beziergon](pdf/reference/Fpdf_Beziergon.pdf)
+[Bookmark](pdf/reference/Fpdf_Bookmark.pdf)
+[CellFormat 1 tables](pdf/reference/Fpdf_CellFormat_1_tables.pdf)
+[CellFormat 2 align](pdf/reference/Fpdf_CellFormat_2_align.pdf)
+[CellFormat 3 codepageescape](pdf/reference/Fpdf_CellFormat_3_codepageescape.pdf)
+[CellFormat 4 codepage](pdf/reference/Fpdf_CellFormat_4_codepage.pdf)
+[Circle figures](pdf/reference/Fpdf_Circle_figures.pdf)
+[ClipText](pdf/reference/Fpdf_ClipText.pdf)
+[CreateTemplate](pdf/reference/Fpdf_CreateTemplate.pdf)
+[DrawPath fill](pdf/reference/Fpdf_DrawPath_fill.pdf)
+[HTMLBasicNew](pdf/reference/Fpdf_HTMLBasicNew.pdf)
+[Image](pdf/reference/Fpdf_Image.pdf)
+[LinearGradient gradient](pdf/reference/Fpdf_LinearGradient_gradient.pdf)
+[MoveTo path](pdf/reference/Fpdf_MoveTo_path.pdf)
+[MultiCell](pdf/reference/Fpdf_MultiCell.pdf)
+[PageSize](pdf/reference/Fpdf_PageSize.pdf)
+[Polygon](pdf/reference/Fpdf_Polygon.pdf)
+[RegisterImage](pdf/reference/Fpdf_RegisterImage.pdf)
+[RegisterImageReader url](pdf/reference/Fpdf_RegisterImageReader_url.pdf)
+[SVGBasicWrite](pdf/reference/Fpdf_SVGBasicWrite.pdf)
+[SetAcceptPageBreakFunc landscape](pdf/reference/Fpdf_SetAcceptPageBreakFunc_landscape.pdf)
+[SetAlpha transparency](pdf/reference/Fpdf_SetAlpha_transparency.pdf)
+[SetFontLoader](pdf/reference/Fpdf_SetFontLoader.pdf)
+[SetKeywords](pdf/reference/Fpdf_SetKeywords.pdf)
+[SetLeftMargin multicolumn](pdf/reference/Fpdf_SetLeftMargin_multicolumn.pdf)
+[SetLineJoinStyle caps](pdf/reference/Fpdf_SetLineJoinStyle_caps.pdf)
+[SetProtection](pdf/reference/Fpdf_SetProtection.pdf)
+[Splitlines](pdf/reference/Fpdf_Splitlines.pdf)
+[TransformBegin](pdf/reference/Fpdf_TransformBegin.pdf)
+[WriteAligned](pdf/reference/Fpdf_WriteAligned.pdf)
+[barcode Register](pdf/reference/contrib_barcode_Register.pdf)
+[barcode RegisterCodabar](pdf/reference/contrib_barcode_RegisterCodabar.pdf)
+[barcode RegisterCode128](pdf/reference/contrib_barcode_RegisterCode128.pdf)
+[barcode RegisterCode39](pdf/reference/contrib_barcode_RegisterCode39.pdf)
+[barcode RegisterDataMatrix](pdf/reference/contrib_barcode_RegisterDataMatrix.pdf)
+[barcode RegisterEAN](pdf/reference/contrib_barcode_RegisterEAN.pdf)
+[barcode RegisterQR](pdf/reference/contrib_barcode_RegisterQR.pdf)
+[barcode RegisterTwoOfFive](pdf/reference/contrib_barcode_RegisterTwoOfFive.pdf)
+[httpimg Register](pdf/reference/contrib_httpimg_Register.pdf)
+
##Nonstandard Fonts
diff --git a/list/list.go b/list/list.go
new file mode 100644
index 0000000..8099404
--- /dev/null
+++ b/list/list.go
@@ -0,0 +1,59 @@
+package main
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+)
+
+func matchTail(str, tailStr string) (match bool, headStr string) {
+ sln := len(str)
+ ln := len(tailStr)
+ if sln > ln {
+ match = str[sln-ln:] == tailStr
+ if match {
+ headStr = str[:sln-ln]
+ }
+ }
+ return
+}
+
+func matchHead(str, headStr string) (match bool, tailStr string) {
+ ln := len(headStr)
+ if len(str) > ln {
+ match = str[:ln] == headStr
+ if match {
+ tailStr = str[ln:]
+ }
+ }
+ return
+}
+
+func main() {
+ var err error
+ var ok bool
+ var showStr, name string
+ err = filepath.Walk("pdf/reference", func(path string, info os.FileInfo, err error) error {
+ if info.Mode().IsRegular() {
+ name = filepath.Base(path)
+ ok, name = matchTail(name, ".pdf")
+ if ok {
+ name = strings.Replace(name, "_", " ", -1)
+ ok, showStr = matchHead(name, "Fpdf ")
+ if ok {
+ fmt.Printf("[%s](%s)\n", showStr, path)
+ } else {
+ ok, showStr = matchHead(name, "contrib ")
+ if ok {
+ fmt.Printf("[%s](%s)\n", showStr, path)
+ }
+ }
+ }
+ }
+ return nil
+ })
+ if err != nil {
+ fmt.Println(err)
+ }
+}
diff --git a/mkdoc b/mkdoc
index 301c39f..213becc 100755
--- a/mkdoc
+++ b/mkdoc
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# https://github.com/jimmyfrasche/autoreadme
autoreadme -f -template README.md.template
# Improve the appearance of the markdown document with features unavailable in godoc
@@ -16,5 +18,10 @@ cat README.md | tr '\n' '\v' | sed \
-e 's/test.coverage.(\(https:\/\/blog\.golang\.org\/cover\))/[test coverage](\1)/g' \
-e 's/Pull.requests.(\(https:\/\/help\.github\.com\/articles\/using\-pull\-requests\/\))/[Pull requests](\1)/g' \
-e 's/Your change should\v/Your change should\v\v/g' \
- | tr '\v' '\n' > 0
-mv 0 README.md
+ -e 's/##Nonstandard Fonts/__PDFS__\v\v##Nonstandard Fonts/g' \
+ | tr '\v' '\n' > _0
+sed -e '/__PDFS__/,$d' _0 > _1
+go run list/list.go >> _1
+sed -e '1,/__PDFS__/d' _0 >> _1
+rm _0
+mv _1 README.md