Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2487)

Unified Diff: docs/src/filter_demo_output.py

Issue 234733003: Improvements and bugfixes to the depot_tools doc generation process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « docs/src/depot_tools_tutorial.demo.tldr.sh ('k') | docs/src/git-freeze.demo.1.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/src/filter_demo_output.py
diff --git a/docs/src/filter_demo_output.py b/docs/src/filter_demo_output.py
index 5f0fd3e45db905e7b0ede83d62d1b5a1f3f64e5a..3b3afb8d04f5e55d43f16816688b4669075d7c5f 100755
--- a/docs/src/filter_demo_output.py
+++ b/docs/src/filter_demo_output.py
@@ -77,6 +77,8 @@ def main():
w = sys.stdout.write
+ comment_marker = '###COMMENT###'
+
callout_counter = 1
if backend == 'xhtml11':
preamble = (
@@ -88,11 +90,11 @@ def main():
in_code = False
body = c.convert(output, full=False)
for i, line in enumerate(body.splitlines()):
- if line.startswith('# '):
+ if line.startswith(comment_marker):
if in_code:
w(postamble)
in_code = False
- w(line[1:])
+ w(line[len(comment_marker):])
else:
if not in_code:
w(preamble)
@@ -115,11 +117,11 @@ def main():
in_code = False
body = simpleXML(output)
for i, line in enumerate(body.splitlines()):
- if line.startswith('# '):
+ if line.startswith(comment_marker):
if in_code:
w(postamble)
in_code = False
- w(line[1:])
+ w(line[len(comment_marker):])
else:
if not in_code:
w(preamble)
« no previous file with comments | « docs/src/depot_tools_tutorial.demo.tldr.sh ('k') | docs/src/git-freeze.demo.1.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698