jgm / pandocfilters

A python module for writing pandoc filters, with a collection of examples
BSD 3-Clause "New" or "Revised" License
512 stars 111 forks source link

pandoc.exe: Error running filter .\examples\caps.py #53

Closed greatkeke closed 6 years ago

greatkeke commented 7 years ago

Hello,Sir. Thx for your project very much.

I'm interested in Markdown. So, I found pandoc is something I wanted. But It couldn't parse * [] task1 to <p><input type="checkbox"/>task1</p>. Then, I decided to write a filter to resolve it.

Then

But there was an error after I had run pandoc --filter ./examples/caps.py. The error is

PS C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples> pandoc --filter .\caps.py
abcd
^Z
pandoc.exe: Error running filter .\caps.py
C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples\caps.py: createProcess: invalid argument (Exec format error)
PS C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples>

And then, I checked my way again and again, it was still the same. So, I asked google, but nobody had this error.

In the end, I ask you for help. Was anything forgot to write in the readme?

jgm commented 7 years ago

What version of pandoc? And, do you get the same error if you leave off the .\ before caps.py?

+++ Feng [Dec 21 16 01:57 ]:

Hello,Sir. Thx for your project very much.

I'm interested in Markdown. So, I found pandoc is something I wanted. But It couldn't parse * [] task1 to

<input type="checkbox"/>task1

. Then, I decided to write a filter to resolve it.

Then

  • I installed Python 3.5.
  • Clone your project to test the filters
  • I opened Powershell on Windows 10 as administrator
  • Go to the director of the project
  • Run Python step.py install
  • Run pandoc --filter ./examples/caps.py

    But there was an error after I had run pandoc --filter ./examples/caps.py. The error is PS C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples> pandoc --filter .\caps.py abcd ^Z pandoc.exe: Error running filter .\caps.py C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples\caps.py: c reateProcess: invalid argument (Exec format error) PS C:\Users\MyName\Downloads\pandoc-filter\pandocfilters-master\examples>

    And then, I checked my way again and again, it was still the same. So, I asked google, but nobody had this error.

    In the end, I ask you for help. Was anything forgot to write in the readme?

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

  1. https://github.com/jgm/pandocfilters/issues/53
  2. https://github.com/notifications/unsubscribe-auth/AAAL5HDJNsf3LXxW_cpb8Hku--HcYRytks5rKPgKgaJpZM4LSw9P
greatkeke commented 7 years ago

Pandoc version: 1.17.2

Yes, it's the same in that occasion.

sergiocorreia commented 7 years ago

Try the latest Pandoc (1.9). Had the same error and with 1.8 and 1.9 it's gone

ickc commented 7 years ago

Try the latest Pandoc (1.9). Had the same error and with 1.8 and 1.9 it's gone

@kexxxfeng, he means 1.18 and 1.19. Anyway, it is always a good idea to use the latest versions of everything (in this case, pandocfilter and pandoc). Often bugs are already fixed in the latest version.

And also you might check out @sergiocorreia's alternative of pandocfilters — panflute. @jgm recommended this, and @sergiocorreia has ported the examples, including the caps.py you were trying.

And regarding your need to use GitHub checkbox, you might also want to see jgm/pandoc#3051, especially this comment by @jgm. He already made an example on what syntax to use (basically a span enclosing the checked/unchecked item). But note that the discussion over there isn't finalized.