Skip to content

Commit

Permalink
change the way we set booktabs to use the internal mechanism
Browse files Browse the repository at this point in the history
The set_table_style api was borked with 0.13… it expects a string, but
then iterates over it as though it were a list/tuple of strings.
Internally it falls back to the settings.table_style value, so we'll use
that.
  • Loading branch information
mpacer committed Feb 24, 2018
1 parent a3e809c commit 61eb3ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions publisher/writer/__init__.py
Expand Up @@ -57,14 +57,7 @@ def __init__(self, *args, **kwargs):
self.figure_type = 'figure'
self.figure_alignment = 'left'
self.table_type = 'table'

try:
self.active_table.set_table_style('booktabs')
except TypeError:
raise TypeError(
"You are running into an error because you are using docutils "
"version {}, instead please install docutils version {}".format(dc.__version__, '0.12.0')
)
self.settings.table_style = ['booktabs']

def visit_docinfo(self, node):
pass
Expand Down Expand Up @@ -395,7 +388,6 @@ def depart_table(self, node):

self.out.append(r'\end{%s}' % self.table_type)
self.active_table.set('preamble written', 1)
self.active_table.set_table_style('booktabs')

def visit_thead(self, node):
# Store table caption locally and then remove it
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -8,4 +8,4 @@ pygments
pytest
testpath
##### requirements with version specifiers
docutils == 0.12
docutils >= 0.14

0 comments on commit 61eb3ba

Please sign in to comment.