Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pandoc-include results in NotImplementedError #12

Closed
axelkennedal opened this issue Nov 24, 2020 · 3 comments
Closed

Using pandoc-include results in NotImplementedError #12

axelkennedal opened this issue Nov 24, 2020 · 3 comments

Comments

@axelkennedal
Copy link

I installed pandoc-include through pip and added the executable to the path. Upon trying to use the filter I get this error:

Traceback (most recent call last):
  File "/Users/axelkennedal/.local/bin/pandoc-include", line 8, in <module>
    sys.exit(main())
  File "/Users/axelkennedal/.local/lib/python3.7/site-packages/pandoc_include.py", line 166, in main
    return pf.run_filter(action, doc=doc)
  File "/Users/axelkennedal/.local/lib/python3.7/site-packages/panflute/io.py", line 224, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/Users/axelkennedal/.local/lib/python3.7/site-packages/panflute/io.py", line 197, in run_filters
    doc = load(input_stream=input_stream)
  File "/Users/axelkennedal/.local/lib/python3.7/site-packages/panflute/io.py", line 58, in load
    doc = json.load(input_stream, object_hook=from_json)
  File "/Users/axelkennedal/miniconda3/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Users/axelkennedal/miniconda3/lib/python3.7/json/__init__.py", line 361, in loads
    return cls(**kw).decode(s)
  File "/Users/axelkennedal/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/axelkennedal/miniconda3/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "/Users/axelkennedal/.local/lib/python3.7/site-packages/panflute/elements.py", line 1375, in from_json
    raise NotImplementedError(f'Unknown tag: {tag}')
NotImplementedError: Unknown tag: Caption
Error running filter pandoc-include:
Filter returned error status 1

Is this a bug or an issue with my local installation? I use the filter like this in a bash script: pandoc ${DOCPATH} -o ${OUTPUTFILE} --filter pandoc-include. Compilation with pandoc works perfectly fine if I remove the pandoc-include filter.

I'm on macOS 10.15.6 with Python 3.7.6.

@DCsunset
Copy link
Owner

I think this error is caused by the panflute library issue.

You could try to upgrade panflute by pip3 install -U panflute, and then try to run the filter again.

@DCsunset
Copy link
Owner

I have also published a new version of pandoc-include to fix this issue.
Alternatively, you could try running pip3 install -U pandoc-include to fix it.

@axelkennedal
Copy link
Author

Okay, thank you for your help. I have however opted to use the pandoc-lua-filters instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants