Commit 66381e30 authored by Victor Zverovich's avatar Victor Zverovich

Minor cleanup

parent 1fb1c4c9
...@@ -3731,6 +3731,7 @@ FMT_END_NAMESPACE ...@@ -3731,6 +3731,7 @@ FMT_END_NAMESPACE
**Example**:: **Example**::
#define FMT_STRING_ALIAS 1
#include <fmt/format.h> #include <fmt/format.h>
// A compile-time error because 'd' is an invalid specifier for strings. // A compile-time error because 'd' is an invalid specifier for strings.
std::string s = format(fmt("{:d}"), "foo"); std::string s = format(fmt("{:d}"), "foo");
......
...@@ -113,8 +113,9 @@ class Translator(nodes.NodeVisitor): ...@@ -113,8 +113,9 @@ class Translator(nodes.NodeVisitor):
for i, entry in enumerate(row): for i, entry in enumerate(row):
text = entry[0][0] if len(entry) > 0 else '' text = entry[0][0] if len(entry) > 0 else ''
if i != 0: if i != 0:
self.write(' ') self.write('|')
self.write('{:{}}'.format(text, widths[i])) self.write('{:{}}'.format(text, widths[i]))
self.write('\n')
def visit_table(self, node): def visit_table(self, node):
table = node.children[0] table = node.children[0]
...@@ -122,14 +123,13 @@ class Translator(nodes.NodeVisitor): ...@@ -122,14 +123,13 @@ class Translator(nodes.NodeVisitor):
thead = table[-2] thead = table[-2]
tbody = table[-1] tbody = table[-1]
widths = [int(cs['colwidth']) for cs in colspecs] widths = [int(cs['colwidth']) for cs in colspecs]
sep = ' '.join(['-' * w for w in widths]) sep = '|'.join(['-' * w for w in widths]) + '\n'
self.write(sep) self.write('\n\n')
self.write_row(thead[0], widths) self.write_row(thead[0], widths)
self.write(sep) self.write(sep)
for row in tbody: for row in tbody:
self.write_row(row, widths) self.write_row(row, widths)
self.write(sep) raise nodes.SkipChildren
raise nodes.StopTraversal
def depart_table(self, node): def depart_table(self, node):
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment