-
Notifications
You must be signed in to change notification settings - Fork 0
save for stable readthedocs #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -882,11 +882,11 @@ def create_table(self, lines, cnt, secid): | |
| content += " " + self.replace_option_link(line, secid, 1).lstrip() | ||
| content += "\n\n" | ||
| elif re.search(r'=>$', line0): | ||
| line = re.sub(r'={1,}', '=', line0) | ||
| content = "| {}\n".format(line) | ||
| # line = re.sub(r'={1,}', '=', line0) | ||
| content = "| {}\n".format(line0) | ||
| for i in range(1, cnt): | ||
| line = lines[i] | ||
| line = re.sub(r'={2,}', '=', line) | ||
| # line = re.sub(r'={2,}', '=', line) | ||
| content += "| {}\n".format(line) | ||
| content += "\n" | ||
| else: | ||
|
|
@@ -971,19 +971,20 @@ def build_rst_simple_table(self, rows): | |
| for j, val in enumerate(row): | ||
| if j < ncols: | ||
| widths[j] = max(widths[j], len(val), 1) | ||
| sep = " ".join("=" * w for w in widths) + "\n" | ||
| # content = sep | ||
| content = ".. list-table::\n :widths: auto\n :header-rows: 1\n\n" | ||
| content = ".. list-table::\n :widths: auto\n :header-rows: 1\n" | ||
| for row in rows: | ||
| v = row[0] + "\n" | ||
| if len(row) == 1: | ||
| content += " " + row[0] | ||
| continue | ||
| v = row[0] | ||
| if len(v) > 1 and v[0] == '-': v = v[1:] | ||
| content += " * - " + v | ||
| content += "\n * - " + v | ||
| for c in range(1, ncols): | ||
| v = row[c] + "\n" | ||
| v = row[c] | ||
| if len(v) > 1 and v[0] == '-': v = v[1:] | ||
| content += " - " + v | ||
| content += "\n - " + v | ||
|
Comment on lines
+974
to
+985
|
||
|
|
||
| return content | ||
| return content + "\n" | ||
|
|
||
| # | ||
| # description type (dtype): 0 - section, 1 - option, 2 - example, 3 - action | ||
|
|
@@ -1011,9 +1012,9 @@ def create_synopsis(self, lines, cnt, secid, dtype): | |
| line = self.replace_option_link(lines[i], secid, 2, dtype) | ||
| ms = re.match(r'^\s*{}\s+(.+)$'.format(self.DOCS['DOCNAM']), line) | ||
| if ms: | ||
| content += "| {}{}{} {}\n".format(self.Q1, self.DOCS['DOCNAM'], self.Q2, ms.group(1)) | ||
| content += "| {}{}{} {}\n".format(self.Q1, self.DOCS['DOCNAM'], self.Q2, ms.group(1)) | ||
| else: | ||
| content += "| "+line+"\n" | ||
| content += "| "+line+"\n" | ||
| content += "\n" | ||
|
|
||
| return content | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are commented-out
re.sub(...)lines left in the=>$table branch. If these substitutions are no longer needed for ReadTheDocs/Sphinx compatibility, it would be clearer to remove them; if they are sometimes needed, consider making the behavior explicit (e.g., a flag) and add a short comment explaining why the substitutions were disabled.