diff options
author | Cary Clark <caryclark@skia.org> | 2017-10-04 14:31:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-04 18:50:33 +0000 |
commit | bc5697d3b13b082ade1e8397952265dd604664d1 (patch) | |
tree | e70354fb728f051f119c4f042191f446e13fa00b /tools/bookmaker/mdOut.cpp | |
parent | 0078e912718c9c3013e4db08951d4f3fd584bc57 (diff) |
starting next gaggle of docs
starting next gaggle of docs
Docs-Preview: https://skia.org/?cl=50264
Bug: skia:6898
Change-Id: I639795b55c0c96b2efccac13cb67592f055a75a2
Reviewed-on: https://skia-review.googlesource.com/50264
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools/bookmaker/mdOut.cpp')
-rw-r--r-- | tools/bookmaker/mdOut.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp index b0cec6659b..0b0b2e1bca 100644 --- a/tools/bookmaker/mdOut.cpp +++ b/tools/bookmaker/mdOut.cpp @@ -14,6 +14,20 @@ static void add_ref(const string& leadingSpaces, const string& ref, string* resu *result += leadingSpaces + ref; } +static string preformat(const string& orig) { + string result; + for (auto c : orig) { + if ('<' == c) { + result += "<"; + } else if ('>' == c) { + result += ">"; + } else { + result += c; + } + } + return result; +} + // FIXME: preserve inter-line spaces and don't add new ones string MdOut::addReferences(const char* refStart, const char* refEnd, BmhParser::Resolvable resolvable) { @@ -149,7 +163,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, if (('f' != ref[0] && string::npos == ref.find("()")) // || '.' != t.backup(ref.c_str()) && ('k' != ref[0] && string::npos == ref.find("_Private"))) { - if ('.' == wordStart[0] && distFromParam == 1) { + if ('.' == wordStart[0] && (distFromParam >= 1 && distFromParam <= 16)) { const Definition* paramType = this->findParamType(); if (paramType) { string fullName = paramType->fName + "::" + ref; @@ -756,10 +770,11 @@ void MdOut::markTypeOut(Definition* def) { // TODO: put in css spec that we can define somewhere else (if markup supports that) // TODO: 50em below should match limt = 80 in formatFunction() this->writePending(); + string preformattedStr = preformat(formattedStr); fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em;" "width: 50em; background-color: #f0f0f0\">\n" "%s\n" - "</pre>", formattedStr.c_str()); + "</pre>", preformattedStr.c_str()); this->lf(2); fTableState = TableState::kNone; fMethod = def; |