From ac47b88d3c4b6232ea8664cea99fbd8394f2dc38 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 11 Jan 2018 10:35:44 -0500 Subject: update bookmaker to ToT more image docs, still not done add ability to comment out non-working examples easily start work on additional self-checks clean up use of this-> in docs TBR=reed@google.com Docs-Preview: https://skia.org/?cl=91720 Bug: skia:6898 Change-Id: I706ab8145290e53ab67d3f509ccf4e1225adb3c3 Reviewed-on: https://skia-review.googlesource.com/91720 Commit-Queue: Cary Clark Reviewed-by: Cary Clark --- tools/bookmaker/bookmaker.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tools/bookmaker/bookmaker.cpp') diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index eb1ce1e366..b63813d667 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -12,8 +12,9 @@ DEFINE_string2(bmh, b, "", "Path to a *.bmh file or a directory."); DEFINE_bool2(catalog, c, false, "Write example catalog.htm. (Requires -b -f -r)"); DEFINE_string2(examples, e, "", "File of fiddlecli input, usually fiddle.json (For now, disables -r -f -s)"); DEFINE_string2(fiddle, f, "", "File of fiddlecli output, usually fiddleout.json."); +DEFINE_bool2(hack, h, false, "Do a find/replace hack to update all *.bmh files. (Requires -b)"); DEFINE_string2(include, i, "", "Path to a *.h file or a directory."); -DEFINE_bool2(hack, k, false, "Do a find/replace hack to update all *.bmh files. (Requires -b)"); +DEFINE_bool2(selfcheck, k, false, "Check bmh against itself. (Requires -b)"); DEFINE_bool2(stdout, o, false, "Write file out to standard out."); DEFINE_bool2(populate, p, false, "Populate include from bmh. (Requires -b -i)"); DEFINE_string2(ref, r, "", "Resolve refs and write *.md files to path. (Requires -b -f)"); @@ -25,11 +26,10 @@ DEFINE_bool2(skip, z, false, "Skip degenerate missed in legacy preprocessor."); /* recipe for generating timestamps for existing doxygen comments find include/core -type f -name '*.h' -print -exec git blame {} \; > ~/all.blame.txt +todos: space table better for Constants should Return be on same line as 'Return Value'? remove anonymous header, e.g. Enum SkPaint::::anonymous_2 -Text Encoding anchors in paragraph are echoed instead of being linked to anchor names - also should not point to 'undocumented' since they are resolvable links #Member lost all formatting #List needs '# content ##', formatting consts like enum members need fully qualfied refs to make a valid link @@ -38,7 +38,7 @@ enum comments should be disallowed unless after #Enum and before first #Const trouble with aliases, plurals need to keep first letter of includeWriter @param / @return lowercase Quad -> quad, Quads -> quads -check for summary containing all methods +see head of selfCheck.cpp for additional todos */ /* @@ -334,6 +334,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy case MarkType::kAlias: case MarkType::kAnchor: case MarkType::kDefine: + case MarkType::kDuration: case MarkType::kError: case MarkType::kFile: case MarkType::kHeight: @@ -1254,6 +1255,7 @@ vector BmhParser::typeName(MarkType markType, bool* checkEnd) { case MarkType::kBug: // fixme: expect number case MarkType::kDefine: case MarkType::kDefinedBy: + case MarkType::kDuration: case MarkType::kError: case MarkType::kFile: case MarkType::kHeight: @@ -1511,8 +1513,8 @@ int main(int argc, char** const argv) { SkCommandLineFlags::Parse(argc, argv); } else { SkCommandLineFlags::PrintUsage(); - const char* const commands[] = { "", "-h", "bmh", "-h", "examples", "-h", "include", "-h", "fiddle", - "-h", "ref", "-h", "status", "-h", "tokens", + const char* const commands[] = { "", "-h", "bmh", "-h", "examples", "-h", "include", + "-h", "fiddle", "-h", "ref", "-h", "status", "-h", "tokens", "-h", "crosscheck", "-h", "populate", "-h", "spellcheck" }; SkCommandLineFlags::Parse(SK_ARRAY_COUNT(commands), commands); return 0; @@ -1587,17 +1589,19 @@ int main(int argc, char** const argv) { SkCommandLineFlags::PrintUsage(); return 1; } + bmhParser.reset(); if (!FLAGS_bmh.isEmpty()) { - bmhParser.reset(); if (!bmhParser.parseFile(FLAGS_bmh[0], ".bmh")) { return -1; } } else if (!FLAGS_status.isEmpty()) { - bmhParser.reset(); if (!bmhParser.parseStatus(FLAGS_status[0], ".bmh", StatusFilter::kInProgress)) { return -1; } } + if (FLAGS_selfcheck && !SelfCheck(bmhParser)) { + return -1; + } bool done = false; if (!FLAGS_include.isEmpty() && FLAGS_tokens) { IncludeParser includeParser; -- cgit v1.2.3