@@ -17,8 +17,8 @@ usage () {
1717}
1818
1919# Define colors for SVG ~foreground~ seen on Github front page.
20- svg_color_dark_scheme=" #EDF "
21- svg_color_light_scheme=" #014 "
20+ svg_color_dark_scheme=" #EEF "
21+ svg_color_light_scheme=" #011 "
2222
2323TEST_ARGS=
2424
3636#
3737# If the command fails due to expected changes in SVG output, rerun
3838# this script with "TEST_ARGS=-write" first on the command line.
39- # XX Better not to fail if the .txt source has changed.
39+ # X Results are used as "golden" standard for GitHub-side regression tests --
40+ # so arguments here must not conflict with those in "test.yml".
4041go test -run . -v \
41- -svg-color-dark-scheme ${svg_color_dark_scheme} \
42- -svg-color-light-scheme ${svg_color_light_scheme} \
4342 ${TEST_ARGS}
4443
4544# build README.md
4645go run ./cmd/tmpl-expand Root=" ." < README.md.tmpl > README.md \
4746 $( bash -c ' echo ./examples/{trees,overlaps,line-decorations,line-ends,dot-grids,large-nodes,small-grids,big-grids,complicated}.{txt,svg}' )
4847
49- go_to_markdown () {
50- BASENAME= $1
51- # input is a scan of the Go package in $CWD
52- go doc -all |
53- tee ${BASENAME} .go.doc.txt |
54- # XX relative path assumes $CWD is the project root dir
55- go run ./cmd/goatdoc -svgfilesprefix= ${BASENAME} > ${BASENAME} .md
56- }
57-
58- # build API.md XX rename $(go list -f {{.Name}}).goatdoc.md ?
59- go_to_markdown API
48+ # '-d' writes ./awkvars.out
49+ cat * .go |
50+ awk '
51+ /[<]goat[>]/ {p = 1; next}
52+ /[<][/]goat[>]/ {p = 0; next}
53+ p > 0 {print} ' |
54+ tee goat.txt |
55+ go run ./cmd/goat \
56+ -svg-color-dark-scheme ${svg_color_dark_scheme} \
57+ -svg-color-light-scheme ${svg_color_light_scheme} \
58+ > goat.svg
6059
6160if [ ! " $githubuser " ] # XX Is this the right test
6261then
6362 # Render to HTML, for local inspection.
6463 ./markdown_to_html.sh README.md > README.html
6564 ./markdown_to_html.sh CHANGELOG.md > CHANGELOG.html
66- ./markdown_to_html.sh API.md > API.html
6765fi
0 commit comments