diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-05-15 10:31:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 10:31:05 -0700 |
| commit | 0d8bca92e208e705150097d26db6a5390dc9eb9b (patch) | |
| tree | 122acb729c3e0e629642bc39f7f2ee9db3fc084a /docs/c2rst.py | |
| parent | bd78ab3c2812f7772021be7863f89a9650589d80 (diff) | |
| parent | 8ac3e7977f87219454dbab50264a723e797b877a (diff) | |
Merge pull request #2810 from dherrada/master
Pyi integration
Diffstat (limited to 'docs/c2rst.py')
| -rw-r--r-- | docs/c2rst.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/docs/c2rst.py b/docs/c2rst.py deleted file mode 100644 index 76489dca3..000000000 --- a/docs/c2rst.py +++ /dev/null @@ -1,31 +0,0 @@ -def c2rst(app, docname, source): - """ Pre-parse '.c' & '.h' files that contain rST source. - """ - # Make sure we're outputting HTML - if app.builder.format != 'html': - return - - fname = app.env.doc2path(docname) - if (not fname.endswith(".c") and - not fname.endswith(".h")): - #print("skipping:", fname) - return - - src = source[0] - - stripped = [] - for line in src.split("\n"): - line = line.strip() - if line == "//|": - stripped.append("") - elif line.startswith("//| "): - stripped.append(line[len("//| "):]) - stripped = "\r\n".join(stripped) - - rendered = app.builder.templates.render_string( - stripped, app.config.html_context - ) - source[0] = rendered - -def setup(app): - app.connect("source-read", c2rst) |
