diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-20 16:01:32 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-20 18:59:21 -0700 |
| commit | a0cbf638eefe8fcc256df2d290a986bd545d0836 (patch) | |
| tree | 167e705c62ba40dc9fd0193e71ad8f60297d7d7f /src | |
| parent | 237cd4455cdbf4984c6cffb081fbc3437c6950ca (diff) | |
| download | rust-a0cbf638eefe8fcc256df2d290a986bd545d0836.tar.gz rust-a0cbf638eefe8fcc256df2d290a986bd545d0836.zip | |
doc: Switch the tutorial to pandoc's method of tagging code blocks
Instead of '## tag', it's '~~~ {.tag}'
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/extract-tests.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/etc/extract-tests.py b/src/etc/extract-tests.py index 32fc25a685a..e95c6680f99 100644 --- a/src/etc/extract-tests.py +++ b/src/etc/extract-tests.py @@ -29,17 +29,16 @@ while cur < len(lines): chapter = re.sub(r"\W", "_", chap.group(1)).lower() chapter_n = 1 elif re.match("~~~", line): + # Parse the tags that open a code block in the pandoc format: + # ~~~ {.tag1 .tag2} + tags = re.findall("\.([\w-]*)", line) block = "" - ignore = False - xfail = False + ignore = "notrust" in tags or "ignore" in tags + xfail = "xfail-test" in tags while cur < len(lines): line = lines[cur] cur += 1 - if re.match(r"\s*## (notrust|ignore)", line): - ignore = True - elif re.match(r"\s*## xfail-test", line): - xfail = True - elif re.match("~~~", line): + if re.match("~~~", line): break else: block += re.sub("^# ", "", line) @@ -60,4 +59,3 @@ while cur < len(lines): f = open(filename, 'w') f.write(block) f.close() - |
