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

Cannot determine pandoc version when run with panzer #12

Closed
fredcallaway opened this issue Apr 27, 2016 · 10 comments
Closed

Cannot determine pandoc version when run with panzer #12

fredcallaway opened this issue Apr 27, 2016 · 10 comments

Comments

@fredcallaway
Copy link

https://github.com/msprev/panzer

ERROR:     !Traceback (most recent call last):
ERROR:     !  File "/Users/fred/anaconda/bin/pandoc-eqnos", line 7, in <module>
ERROR:     !    from pandoc_eqnos import main
ERROR:     !  File "/Users/fred/anaconda/lib/python3.5/site-packages/pandoc_eqnos.py", line 88, in <module>
ERROR:     !    raise RuntimeError('Cannot determine pandoc version.  '\
ERROR:     !RuntimeError: Cannot determine pandoc version.  Please file an issue at https://github.com/tomduck/pandoc-eqnos/issues
@fredcallaway
Copy link
Author

I just hardcoded my pandoc version into the file.

I wonder if it might be better to just assume the most recent version if you can't get the version, with a warning message of course.

@tomduck
Copy link
Owner

tomduck commented Apr 27, 2016

Thanks for the feedback, @fredcallaway. This is an issue because pandoc doesn't provide filter authors with version information. See pandoc Issue #2640.

Can you please tell me how panzer calls pandoc with the pandoc-fignos filter? e.g., Is python's subprocess module used? If so, what does the call look like?

Pandoc-eqnos checks for version information by testing for:

  1. A command-line argument to pandoc-fignos (used with pipe chains in my regression tests);
  2. The version of the parent process (usually pandoc); and
  3. The version of whatever pandoc is available from the command line.

These are in order of precedence. The first check that succeeds wins.

If none of these checks can be made to work for you then we will add another. There should be no need to hard-code version information into pandoc-fignos itself.

@fredcallaway
Copy link
Author

subprocess is used. Here's an excerpt:

command = [entry['command']] + entry['arguments']
...
process = subprocess.Popen(command,
                           stderr=subprocess.PIPE,
                           stdin=subprocess.PIPE,
                           stdout=subprocess.PIPE)

I think entry['command'] is "pandoc-eqnos". I'm not sure about arguments. I think the writer is the first argument.

It seems that (3) should work here though, because I can indeed call pandoc -v from a terminal.

@tomduck
Copy link
Owner

tomduck commented Apr 27, 2016

I see the problem. You are using pandoc-fignos in a pipe chain, and so the parent process is panzer. (2) is succeeding when it should not. (1) is an option, but (3) would be better. Let me get back to you.

@tomduck
Copy link
Owner

tomduck commented Apr 28, 2016

I reworked the version detection code (again!) and posted pandoc-eqnos 0.10 to pypi. It should work for you. Can you give it a test and let me know?

@fredcallaway
Copy link
Author

Well done! Will you port this to fignos as well? If so, I’ll start tracking version there as well.

Cheers,
Fred

On Apr 27, 2016, at 9:25 PM, Thomas J. Duck notifications@github.com wrote:

I reworked the version detection code (again!) and posted pandoc-eqnos 0.10 to pypi. It should work for you. Can you give it a test and let me know?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #12 (comment)

@tomduck
Copy link
Owner

tomduck commented Apr 28, 2016

Thanks! Yes, I have already pushed the updated code for fignos and tablenos to GitHub. I'm working on a few other fignos Issues, and expect to have a new release ready in the next few days. Soon enough?

Cheers,
Tom

@tomduck
Copy link
Owner

tomduck commented May 3, 2016

I'm refactoring pandoc-fignos to support some fancy new features. The updates for this Issue will go out at the same time. Stay tuned...

@fredcallaway
Copy link
Author

Oh boy! I'm crossing my fingers for "Figure 2 on page 4"

@tomduck
Copy link
Owner

tomduck commented May 15, 2016

I just posted a new release to pypi that has this feature. Thanks again for your feedback. Please let me know if you have any trouble with it.

Note that pandoc-fignos/eqnos/tablenos now have clever referencing. Fun!

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