Commit Graph

31 Commits

Author SHA1 Message Date
Allen Sun 45a52e208c doc: Remove one additional blank line after Synopsis (#591)
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
2017-12-04 10:21:50 +01:00
Albert Nigmatzianov 2da4a54c5c Improve tests in doc/ 2017-11-09 07:56:43 +01:00
Shahidh K Muhammed 419e0f8d51 doc: add ReST doc generation (#537) 2017-10-07 19:39:47 +02:00
Albert Nigmatzianov ca57f0f5db doc: Ad help flag and cmd when generating docs 2017-05-20 19:28:06 +02:00
Albert Nigmatzianov 6bfe2ba1a2 doc: Add docs 2017-05-09 11:14:48 +02:00
Albert Nigmatzianov 6dd90846ba doc: Use w.Write instead of fmt in yaml_docs
benchmark                        old ns/op     new ns/op     delta
BenchmarkGenYamlToFile-4         62488         61622         -1.39%

benchmark                        old allocs     new allocs     delta
BenchmarkGenYamlToFile-4         121            120            -0.83%

benchmark                        old bytes     new bytes     delta
BenchmarkGenYamlToFile-4         26706         26280         -1.60%
2017-04-26 21:30:17 +02:00
Albert Nigmatzianov 97af803f3b doc: Cleanup md_docs
Performance gain:
benchmark                        old ns/op     new ns/op     delta
BenchmarkGenMarkdownToFile-4     23096         10295         -55.43%

benchmark                        old allocs     new allocs     delta
BenchmarkGenMarkdownToFile-4     47             48             +2.13%

benchmark                        old bytes     new bytes     delta
BenchmarkGenMarkdownToFile-4     1984          2832          +42.74%
2017-04-26 21:30:17 +02:00
Albert Nigmatzianov de484eefb4 doc: Refactor man docs
Performance impact (very strange):
benchmark                        old ns/op     new ns/op     delta
BenchmarkGenManToFile-4          30037         29001         -3.45%

benchmark                        old allocs     new allocs     delta
BenchmarkGenManToFile-4          77             89             +15.58%

benchmark                        old bytes     new bytes     delta
BenchmarkGenManToFile-4          9075          9651          +6.35%
2017-04-26 21:30:17 +02:00
Albert Nigmatzianov f95d58bdf3 Fix #401 (#402)
* doc: Add and edit docs

* doc: Add tests
2017-04-19 14:39:58 +02:00
Albert Nigmatzianov 6421115516 doc: Fix govet complaints (#408) 2017-04-01 15:45:39 -05:00
Albert Nigmatzianov 0960ff7fa9 Rename IsHelpCommand to IsAdditionalHelpTopicCommand (#398)
Fixes #393
2017-03-09 10:37:15 -05:00
French Ben 35136c09d8 Added support for yaml ouptut in docs gen (#380)
Signed-off-by: French Ben <frenchben@docker.com>
2017-01-30 16:45:31 -05:00
Raphael 'kena' Poss 1dd5ff2e11 Make SEE ALSO references and generated file names agree with each other. 2016-12-29 00:59:22 -07:00
Julien Kassar 6b74a60562 Update doc/man_docs.md (#363) 2016-11-15 09:16:05 -05:00
Daniel Nephin 67feb8173c Add support for setting a function to handle flag parsing errors.
The default pflag error is to only print the bad flag. This enables an application
to include a usage message or other details about the error.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-10-10 10:56:48 -04:00
Chris Broadfoot d1371ecdb4 gofmt, govet, run those in Travis, add 1.7 2016-08-23 13:30:43 -07:00
Daniel Nephin e291587027 Cretea a new GenManTree function that takes an options struct.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-21 14:47:14 -04:00
Daniel Nephin 97206b3170 Use the correct man page section for the filename
Also make header mutation cleaner.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-21 14:30:54 -04:00
Daniel Nephin 112c7dca3a Hide deprecated shorthand flags in man page generation. 2016-06-21 14:30:26 -04:00
Daniel Nephin 29c0a1f42e Use the correct UseLine for the man page synposis.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-20 17:27:41 -04:00
joe2far 719241171d Fixed typos in README and docstring 2016-06-07 11:50:48 +01:00
Ian Walter a0bd6c17b3 Fixing golint warnings
* Moving final return outside of if-else
* Removing type declarations that Go can infer from values
* Cleaning up some existing comments
* Changing snake_case variables to camelCase
2016-03-31 09:53:34 -04:00
Garth Kidd 57f473263e Add explicit doc.GenMan SEE ALSO test covering #229 2016-01-21 12:12:26 +11:00
Garth Kidd cb8496d6b2 Ensure SEE ALSO list has no leading comma, fixing #229 2016-01-21 12:11:56 +11:00
Garth Kidd 356750645f Update doc generation examples. Fixes #227. 2016-01-17 11:29:42 +11:00
Garth Kidd 8e6aca4182 Use filepath.Join, not string math. Fixes #226. 2016-01-17 11:25:20 +11:00
Daniel Martí 5df1341f93 Treat write errors in man doc generation
Just like the last commit, but now for manpages.

genMan still works with a buffer and returns []byte instead of working
directly with an io.Writer. This is because, in turn, md2man takes byte
slices instead of readers and writers.

Wrapping genMan around a writer is unnecessary especially since it's not
an exported function, and also because we'd still need a buffer to get
the output bytes.
2016-01-06 12:25:27 +01:00
Daniel Martí eb5040e69e Treat write errors in markdown doc generation
This code was already using io.Writer, but was completely ignoring write
errors.

The most worrying part is how GenMarkdownTreeCustom used an unnecessary
buffer to then dump all of its contents on a file, and instead of
returning an error on file creation/writing, it would just exit the
entire program.
2016-01-06 12:21:04 +01:00
Daniel Martí ea06b29c10 Simplify GenMarkdownTreeCustom signature 2016-01-06 11:59:08 +01:00
Daniel Martí 5fa1003a36 Remove unused outs global var 2016-01-06 11:49:16 +01:00
Frank Schroeder b3f29e98e6 Issue #195: Move doc generation into separate pkg
* Move man_docs and md_docs into new doc pkg
* Replace *bytes.Buffer with io.Writer
* Replace c == cmd.helpCommand with c.IsHelpCommand()
* Remove redundant len(children) == 0 check in HasSeeAlso
* Duplicate test setup for doc generation
2015-12-24 09:01:59 -05:00