LaurentRDC / pandoc-plot

Render and include figures in Pandoc documents using your plotting toolkit of choice
https://laurentrdc.github.io/pandoc-plot/
GNU General Public License v2.0
224 stars 8 forks source link

pandoc-plot not working on ubuntu conda installs #70

Closed candronikos closed 3 months ago

candronikos commented 3 months ago

I get the below error when running conda pandoc-plot package off a derivative of the pandoc/extra:latest-ubuntu docker image.

If I understand the conda forge page correctly it looks like the linux install file is up to version v1.2.3. Could you confirm and if this is the issue, give it a version bump?

CallStack (from HasCallStack):
  error, called at src/Text/Pandoc/JSON.hs:112:48 in pandoc-types-1.22-yqj0uPaWYy3l6CXdzFnRu:Text.Pandoc.JSON
Error running filter pandoc-plot:
Filter returned error status 1

Cheers


UPDATE 1: 3 hours later. Also doesn't work with cabal install. Using the following in the DOCKERFILE

RUN apt-get install -y zlib1g-dev build-essential
RUN cabal install pandoc-plot
LaurentRDC commented 3 months ago

Hmm I'm not responsible for packaging pandoc/extra.

In general, you might get strange errors like the one above if your pandoc version and pandoc-plot versions aren't compatible. If you look in the changelog, you'll see that since pandoc-plot 1.6, pandoc 2 isn't supported.

Can you check the version of pandoc and pandoc-plot on the command line?

candronikos commented 3 months ago

Thanks for the feedback. I've included the output when using the --version flag below and I'm surprised to see that the version of pandoc used in the container is version 3. Is there anything I can do to fix this on my end?

docker run --rm        --volume "/$(pwd):/data"        --user $(id -u):$(id -g) pandoc-report --version
pandoc 3.2.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: //.pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
LaurentRDC commented 3 months ago

I saw your issue here.

I'm not well-versed in docker. In a bash script, you can download pandoc-plot from GitHub releases like so:

> curl -ksSL -o pandocplot.zip https://github.com/LaurentRDC/pandoc-plot/releases/download/1.7.0/pandoc-plot-Linux-x86_64-static.zip 
> unzip pandocplot.zip
> sudo chmod u+x pandoc-plot
> ./pandoc-plot --version
1.7.0

Maybe you can use this in your dockerfile?

candronikos commented 3 months ago

Downloading the executable as you suggested works.

Thank you :)