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

Support pandoc 3.0 #58

Closed chenrui333 closed 1 year ago

chenrui333 commented 1 year ago

While trying to upgrade pandoc 3.0 formula, I ran into some regression test failure.

  ==> pandoc --filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot -f markdown -t html5
  pandoc-plot: Error in $: Incompatible API versions: encoded with [1,23] but attempted to decode with [1,22,2,1].
  CallStack (from HasCallStack):
    error, called at src/Text/Pandoc/JSON.hs:112:48 in pndc-typs-1.22.2.1-0bfa663d:Text.Pandoc.JSON
  Error running filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot:
  Filter returned error status 1
  ==> pandoc --filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot -f markdown -t html5
  pandoc-plot: Error in $: Incompatible API versions: encoded with [1,23] but attempted to decode with [1,22,2,1].
  CallStack (from HasCallStack):
    error, called at src/Text/Pandoc/JSON.hs:112:48 in pndc-typs-1.22.2.1-0bfa663d:Text.Pandoc.JSON
  Error running filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot:
  Filter returned error status 1
  ==> Testing pandoc-plot (again)
  ==> pandoc --filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot -f markdown -t html5
  pandoc-plot: Error in $: Incompatible API versions: encoded with [1,23] but attempted to decode with [1,22,2,1].
  CallStack (from HasCallStack):
    error, called at src/Text/Pandoc/JSON.hs:112:48 in pndc-typs-1.22.2.1-0bfa663d:Text.Pandoc.JSON
  Error running filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot:
  Filter returned error status 1
  ==> pandoc --filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot -f markdown -t html5
  pandoc-plot: Error in $: Incompatible API versions: encoded with [1,23] but attempted to decode with [1,22,2,1].
  CallStack (from HasCallStack):
    error, called at src/Text/Pandoc/JSON.hs:112:48 in pndc-typs-1.22.2.1-0bfa663d:Text.Pandoc.JSON
  Error running filter /opt/homebrew/Cellar/pandoc-plot/1.5.5/bin/pandoc-plot:
  Filter returned error status 1
  Error: pandoc-plot: failed
  An exception occurred within a child process:
    Minitest::Assertion: --- expected
  +++ actual
  @@ -1,3 +1 @@
  -"<h1 id=\"repeat-the-same-thing\">repeat the same thing</h1>
  -<p><img src=\"\" /></p>
  -"
  +""
LaurentRDC commented 1 year ago

That makes sense. pandoc-plot version 1.5.5 and earlier only supports pandoc 2.11 - 2.19. This is what the error 'Error in $: Incompatible API versions: encoded with [1,23] but attempted to decode with [1,22,2,1].' means, although I agree it's not so clear.

I'm working on a pandoc 3 patch right now. I'll post here when it's done.

LaurentRDC commented 1 year ago

Version 1.6.0 has been released, which adds support for pandoc 3 and drops support for pandoc 2

chenrui333 commented 1 year ago

Thanks @LaurentRDC!