Search code examples
pythonpdfpandocmkdocs

mkdocs-pandoc TypeError: _split_row() takes exactly 2 arguments (3 given)


When I try to generate a .pd with mkdocs2pandoc, I am getting following error

Traceback (most recent call last):
  File "/usr/bin/mkdocs2pandoc", line 11, in <module>
    load_entry_point('mkdocs-pandoc==0.2.6', 'console_scripts', 'mkdocs2pandoc')()
  File "/usr/lib/python2.7/site-packages/mkdocs_pandoc/cli/mkdocs2pandoc.py", line 80, in main
    for line in pconv.convert():
  File "/usr/lib/python2.7/site-packages/mkdocs_pandoc/pandoc_converter.py", line 165, in convert
    lines = mkdocs_pandoc.filters.tables.TableFilter().run(lines)
  File "/usr/lib/python2.7/site-packages/mkdocs_pandoc/filters/tables.py", line 177, in run
    ret.extend(self.convert_table(block))
  File "/usr/lib/python2.7/site-packages/mkdocs_pandoc/filters/tables.py", line 91, in convert_table
    for i in range(0, len(self._split_row(lines_orig[0], has_border))):
TypeError: _split_row() takes exactly 2 arguments (3 given)

I have just started new virtual env and instolled only the mkdocs-pandoc with

pip install mkdocs-pandoc

Solution

  • The problem is due to Markdown 2.6.8 (currently latest) being installed with the mkdocs-pandoc package, I have had a look at _split_row() method in it and it looks like it changed signature, so temporarily fix is to install Marckdown 2.6.7, and wait until mkdocs-pandoc is updated.