diff options
author | David Benjamin <davidben@chromium.org> | 2015-10-18 07:10:28 +0300 |
---|---|---|
committer | Adam Langley <alangley@gmail.com> | 2015-10-26 21:44:27 +0300 |
commit | 5ef619ef2add2183fc2a471e933d0277dc1f59e9 (patch) | |
tree | 01ecc31bf202d4131def5a43b0a22172e1d78e25 /util | |
parent | 63006a913b772d48a364915c3155d51744a8f704 (diff) |
Hide some sections from the docs.
Private structs shouldn't be shown. Also there's a few sections that are
really more implementation details than anything else.
Change-Id: Ibc5a23ba818ab0531d9c68e7ce348f1eabbcd19a
Reviewed-on: https://boringssl-review.googlesource.com/6313
Reviewed-by: Adam Langley <alangley@gmail.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/doc.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util/doc.go b/util/doc.go index 23cd5f46..48d65eb3 100644 --- a/util/doc.go +++ b/util/doc.go @@ -237,6 +237,10 @@ func sanitizeAnchor(name string) string { return strings.Replace(name, " ", "-", -1) } +func isPrivateSection(name string) bool { + return strings.HasPrefix(name, "Private functions") || strings.HasPrefix(name, "Private structures") || strings.Contains(name, "(hidden)") +} + func (config *Config) parseHeader(path string) (*HeaderFile, error) { headerPath := filepath.Join(config.BaseDirectory, path) @@ -341,7 +345,7 @@ func (config *Config) parseHeader(path string) (*HeaderFile, error) { } section.Preamble = comment - section.IsPrivate = len(comment) > 0 && strings.HasPrefix(comment[0], "Private functions") + section.IsPrivate = len(comment) > 0 && isPrivateSection(comment[0]) section.Anchor = anchor lines = rest[1:] lineNo = restLineNo + 1 |