|
44 | 44 | // For example, if you have a package in your current directory and want to |
45 | 45 | // send it to a documentation markdown file, you might do something like this: |
46 | 46 | // |
47 | | -// gomarkdoc . > doc.md |
| 47 | +// gomarkdoc --output doc.md . |
48 | 48 | // |
49 | 49 | // Package Specifiers |
50 | 50 | // |
|
57 | 57 | // |
58 | 58 | // Output Redirection |
59 | 59 | // |
| 60 | +// By default, the documentation generated by the gomarkdoc command is sent to |
| 61 | +// standard output, where it can be redirected to a file. This can be useful if |
| 62 | +// you want to perform additional modifications to the documentation or send it |
| 63 | +// somewhere other than a file. However, keep in mind that there are some |
| 64 | +// inconsistencies in how various shells/platforms handle redirected command |
| 65 | +// output (for example, Powershell encodes in UTF-16, not UTF-8). As a result, |
| 66 | +// the --output option described below is recommended for most use cases. |
| 67 | +// |
| 68 | +// gomarkdoc . > doc.md |
| 69 | +// |
60 | 70 | // If you want to redirect output for each processed package to a file, you can |
61 | | -// alternatively provide the --output/-o option, which accepts a template |
62 | | -// specifying how to generate the path of the output file. A common usage of |
63 | | -// this option is when generating README documentation for a package with |
64 | | -// subpackages (which are supported via the ... signifier available in other |
65 | | -// tools): |
| 71 | +// provide the --output/-o option, which accepts a template specifying how to |
| 72 | +// generate the path of the output file. A common usage of this option is when |
| 73 | +// generating README documentation for a package with subpackages (which are |
| 74 | +// supported via the ... signifier as in other parts of the golang toolchain). |
| 75 | +// In addition, this option provides consistent behavior across platforms and |
| 76 | +// shells: |
66 | 77 | // |
67 | 78 | // gomarkdoc --output '{{.Dir}}/README.md' ./... |
68 | 79 | // |
|
120 | 131 | // documentation. This can be expanded to include all symbols in a package by |
121 | 132 | // adding the --include-unexported/-u flag. |
122 | 133 | // |
123 | | -// gomarkdoc -u . > README.md |
| 134 | +// gomarkdoc -u -o README.md . |
124 | 135 | // |
125 | 136 | // You can also run gomarkdoc in a verification mode with the --check/-c flag. |
126 | 137 | // This is particularly useful for continuous integration when you want to make |
|
0 commit comments