• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..18-Jul-2019-

README.mdH A D18-Jul-2019957 3020

sample-makefileH A D18-Jul-2019319 1712

snipdoc.awkH A D18-Jul-20192.6 KiB11764

README.md

1# Snipdoc
2
3Snipdoc is a simple tool for maintaining package documentation that contains
4code samples.
5
61. Create a subdirectory of your package to hold the following files. "internal"
7   is a good name.
8
92. Write a template file (for example, "doc.template") with the text of your package documentation. The file
10should look exactly like you want your doc.go file to look, except for code
11snippets.
12Instead of embedding a code snippet, write a line consisting solely of
13
14  [NAME]
15
16  for your choice of NAME.
17
183. Write a snippets file (for example, "doc-snippets.go") as a valid Go source
19   file. Begin each snippet you'd like to appear in your package docs with
20   `//[ NAME` and end it with `//]`.
21
224. Construct your doc.go file with the command
23   ```
24   awk -f snipdoc.awk doc-snippets.go doc.template
25   ```
26   The file "sample-makefile" in this directory verifies that the
27   snippets file compiles and safely constructs a doc.go file.
28
29
30