jez / pandoc-sidenote

Convert Pandoc Markdown-style footnotes into sidenotes
MIT License
136 stars 17 forks source link

Compiled binary not compatible with pandoc 2.8.1 #10

Closed andrewheiss closed 4 years ago

andrewheiss commented 4 years ago

Pandoc 2.8.1 is built with pandoc-types 1.20, which doesn't work with the binary version installed through homebrew:

pandoc-sidenote: Error in $: Incompatible API versions: encoded with [1,20] but attempted to decode with [1,17].
CallStack (from HasCallStack):
  error, called at ./Text/Pandoc/JSON.hs:108:64 in pandoc-types-1.17-KRy4e6Qs9AIJIlwwj55hmZ:Text.Pandoc.JSON
Error running filter pandoc-sidenote:
Filter returned error status 1

Pandoc information:

pandoc 2.8.1
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.3
andrewheiss commented 4 years ago

And building with cabal seems to cause an error now, possibly because of the latest version of pandoc-types (maybe because of this change?)

[1 of 1] Compiling Text.Pandoc.SideNote ( src/Text/Pandoc/SideNote.hs, dist/build/Text/Pandoc/SideNote.o )

src/Text/Pandoc/SideNote.hs:14:30: error:
    • Couldn't match type ‘text-1.2.4.0:Data.Text.Internal.Text’
                     with ‘[Char]’
      Expected type: Maybe String
        Actual type: Maybe text-1.2.4.0:Data.Text.Internal.Text
    • In the expression: Just text
      In an equation for ‘getFirstStr’:
          getFirstStr (Str text : _) = Just text
   |
14 | getFirstStr (Str text : _) = Just text
   |                              ^^^^^^^^^

src/Text/Pandoc/SideNote.hs:36:31: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the first argument of ‘Str’, namely ‘""’
      In the expression: Str ""
      In an equation for ‘deNote’: deNote (Note _) = Str ""
   |
36 |         deNote (Note _) = Str ""
   |                               ^^

src/Text/Pandoc/SideNote.hs:54:33: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the first argument of ‘Format’, namely ‘"html"’
      In the first argument of ‘RawInline’, namely ‘(Format "html")’
      In the expression: RawInline (Format "html") labelHTML
   |
54 |   let label = RawInline (Format "html") labelHTML
   |                                 ^^^^^^

src/Text/Pandoc/SideNote.hs:54:41: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the second argument of ‘RawInline’, namely ‘labelHTML’
      In the expression: RawInline (Format "html") labelHTML
      In an equation for ‘label’:
          label = RawInline (Format "html") labelHTML
   |
54 |   let label = RawInline (Format "html") labelHTML
   |                                         ^^^^^^^^^

src/Text/Pandoc/SideNote.hs:57:33: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the first argument of ‘Format’, namely ‘"html"’
      In the first argument of ‘RawInline’, namely ‘(Format "html")’
      In the expression: RawInline (Format "html") inputHTML
   |
57 |   let input = RawInline (Format "html") inputHTML
   |                                 ^^^^^^

src/Text/Pandoc/SideNote.hs:57:41: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the second argument of ‘RawInline’, namely ‘inputHTML’
      In the expression: RawInline (Format "html") inputHTML
      In an equation for ‘input’:
          input = RawInline (Format "html") inputHTML
   |
57 |   let input = RawInline (Format "html") inputHTML
   |                                         ^^^^^^^^^

src/Text/Pandoc/SideNote.hs:61:28: error:
    • Couldn't match expected type ‘text-1.2.4.0:Data.Text.Internal.Text’
                  with actual type ‘[Char]’
    • In the expression: noteTypeCls
      In the expression: [noteTypeCls]
      In the first argument of ‘Span’, namely
        ‘(ident, [noteTypeCls], attrs)’
   |
61 |   let note = Span (ident, [noteTypeCls], attrs) content'
   |                            ^^^^^^^^^^^
jez commented 4 years ago

Thanks for writing this up. Unfortunately, I don’t regularly use pandoc-sidenote, so I won’t have the time to fix this any time soon. Happy to review any PRs that implement a fix. Usually these version upgrades are pretty rote, so if you want to tackle it, I don’t imagine you’ll find much resistance.