mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-23 19:00:09 +00:00
Minor cleanup
This commit is contained in:
parent
1fb1c4c912
commit
66381e308d
@ -3731,6 +3731,7 @@ FMT_END_NAMESPACE
|
||||
|
||||
**Example**::
|
||||
|
||||
#define FMT_STRING_ALIAS 1
|
||||
#include <fmt/format.h>
|
||||
// A compile-time error because 'd' is an invalid specifier for strings.
|
||||
std::string s = format(fmt("{:d}"), "foo");
|
||||
|
@ -113,8 +113,9 @@ class Translator(nodes.NodeVisitor):
|
||||
for i, entry in enumerate(row):
|
||||
text = entry[0][0] if len(entry) > 0 else ''
|
||||
if i != 0:
|
||||
self.write(' ')
|
||||
self.write('|')
|
||||
self.write('{:{}}'.format(text, widths[i]))
|
||||
self.write('\n')
|
||||
|
||||
def visit_table(self, node):
|
||||
table = node.children[0]
|
||||
@ -122,14 +123,13 @@ class Translator(nodes.NodeVisitor):
|
||||
thead = table[-2]
|
||||
tbody = table[-1]
|
||||
widths = [int(cs['colwidth']) for cs in colspecs]
|
||||
sep = ' '.join(['-' * w for w in widths])
|
||||
self.write(sep)
|
||||
sep = '|'.join(['-' * w for w in widths]) + '\n'
|
||||
self.write('\n\n')
|
||||
self.write_row(thead[0], widths)
|
||||
self.write(sep)
|
||||
for row in tbody:
|
||||
self.write_row(row, widths)
|
||||
self.write(sep)
|
||||
raise nodes.StopTraversal
|
||||
raise nodes.SkipChildren
|
||||
|
||||
def depart_table(self, node):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user