Closed jspayne closed 4 years ago
Thanks for your comment. The intent of the init()
function is to allow pandoc filters to initialize the pandoc-xnos library. Usually there is already a pandoc process running, and the init()
function (since pandoc 1.19.1) simply retrieves and returns the PANDOC_VERSION
environment variable. For earlier pandoc versions it is more difficult, as you can see from the init()
code.
It seems to me that you want to do something different: retrieve the version number of a particular pandoc instance. It is probably easiest for you to just use this bit of code from the init()
function:
output = subprocess.check_output([command, '-v'])
line = output.decode('utf-8').split('\n')[0]
pandocversion = line.split(' ')[-1].strip()
Set command = '../my/local/dir/pandoc'
first. Notice that this requires the subprocess
module.
Please let me know if I am misunderstanding your concern.
Cheers, Tom
Hi there. I'm closing this Issue given that it is likely no longer of interest. If that is not the case, please feel welcome to re-open it. Cheers, Tom.
I'd like to be able to pass the path to pandoc to init and have init figure out the pandoc version:
pversion = pandocxnos.init(local_path='../my/local/dir/pandoc')
This would allow me to reference a portable version of pandoc without putting it in the path.