DCsunset / pandoc-include

A pandoc filter to allow file and header inclusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid API Version

rutrum opened this issue · comments

I have a test file that looks like this, note that it doesn't use any include syntax.

---
title: Title
---

# Header

Text

When I compile this using the filter like so

pandoc -t latex -f markdown --filter pandoc-include -o test.pdf test.md

I get the following error

Traceback (most recent call last):
  File "/home/rutrum/.local/bin/pandoc-include", line 8, in <module>
    sys.exit(main())
  File "/home/rutrum/.local/lib/python3.8/site-packages/pandoc_include/main.py", line 333, in main
    return pf.run_filter(action, doc=doc)
  File "/home/rutrum/.local/lib/python3.8/site-packages/panflute/io.py", line 227, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/home/rutrum/.local/lib/python3.8/site-packages/panflute/io.py", line 200, in run_filters
    doc = load(input_stream=input_stream)
  File "/home/rutrum/.local/lib/python3.8/site-packages/panflute/io.py", line 58, in load
    doc = json.load(input_stream, object_hook=from_json)
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/json/__init__.py", line 370, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "/home/rutrum/.local/lib/python3.8/site-packages/panflute/elements.py", line 1362, in from_json
    return Doc(*items, api_version=api, metadata=meta)
  File "/home/rutrum/.local/lib/python3.8/site-packages/panflute/elements.py", line 66, in __init__
    raise TypeError("invalid api version", api_version)
TypeError: ('invalid api version', [1, 17, 5, 4])
Error running filter pandoc-include:
Filter returned error status 1

I get similar errors when using the include syntax. I installed this using pip, and pip show pandoc-include reveals that I am using version 1.2.

Oh my, I never considered upgrading pandoc from version 2.5 to 2.19. This fixed the issue, sorry about this.