Giter VIP home page Giter VIP logo

Comments (14)

lierdakil avatar lierdakil commented on June 14, 2024

Pandoc 1.14 (a.k.a. repo version) has changed API interface. pandoc-1.14 branch contains some work w.r.t. this change. You may want to try it and see if it works. I think it doesn't support external yaml settings as of yet though.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

And please do check your pandoc version, since PandocError type is introduced in 1.14, and should not be present in 1.13.2. If it is, then we messed up badly somewhere...

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

If I have 1.13.2 (in /usr/local/bin) and 1.14 (in ~/.cabal/bin) installed simultaneously, but I don't include 1.14 in the $PATH, shouldn't it not try to run 1.14 (and give me 1.14 errors)?

Even if I explicitly tell it to use 1.13.2, I get the same errors:

~/.../filters/pandoc-crossref : /usr/local/bin/pandoc --version
pandoc 1.13.2
...

~/.../filters/pandoc-crossref : /usr/local/bin/pandoc -F pandoc-crossref.hs -i demo.md -o blah.html

pandoc-crossref.hs:152:50:
    Couldn't match expected type ‘Pandoc’
                with actual type ‘Either Text.Pandoc.Error.PandocError Pandoc’
    In the second argument of ‘($)’, namely ‘readMarkdown def s’
    In the second argument of ‘($)’, namely
      ‘getInlines $ readMarkdown def s’
(etc...)

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

Ooh. Switching to the 1.14 branch almost fixes it. There's only one error left. Still strange that 1.13.2 is giving all those 1.14-related errors, though.

pandoc-crossref.hs:167:9:
    Non type-variable argument
      in the constraint: MonadState References m
    (Use FlexibleContexts to permit this)
    When checking that ‘setTmplV’ has the inferred type
      setTmplV :: forall (m :: * -> *).
                  MonadState References m =>
                  (String -> Maybe MetaValue) -> m ()
    In an equation for ‘applyTemplate’:
        applyTemplate i t tmpl
          = do { setTmplV $ \ n -> ...;
                 res <- replaceTemplate tmpl;
                 setTmplV $ const Nothing;
                 .... }
          where
              setTmplV f = modify $ \ s -> ...
pandoc: Error running filter pandoc-crossref.hs

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

It's likely 1.13.2 binary using 1.14 library from your ~/.ghc, where cabal installed it. I'm not sure how to fix it, but I'd advise to simply use a sandbox for pandoc-1.14, which does not pollute ghc package set in any way.

As for other error, what ghc version do you run?

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

I'm using GHC 7.10.1.

I'd never heard of cabal sandboxes before (I live with Python; never touched Haskell). Reinstalling 1.14 now.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

Can't really test with ghc 7.10, but I can try to specify type, so maybe it helps. One moment.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

Ok, tried specifying type conservatively. Also merged support for settings file into pandoc-1.14 branch. See if this helps.

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

Ack. Finally emerged from cabal hell with freshly sandboxed 1.14 install, and the binary seems to work fine. However, when using pandoc-crossref.hs as a filter, I get errors about Text.Pandoc and other libraries not existing. I'm absolutely sure this is because ghc isn't looking at the sandbox path (despite it being in my $PATH—when the filter is run, it doesn't know where to look for the import Text.Pandoc, etc. commands).

So this is totally off topic from this bug, but I have no idea how to connect the sandboxed version of 1.14 to the filter. Sorry! :)

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

You can build an executable from within cabal sandbox and use that:

cabal --sandbox-config-file=/full/path/to/pandocs/cabal.sandbox.config exec -- ghc --make pandoc-crossref.hs

This will create pandoc-crossref executable, which you can then use with pandoc-1.14 as usual (i.e. pandoc -F pandoc-crossref ...). I will be adding cabal build file later, but for now this should do.

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

Getting closer! I can compile pandoc-crossref just fine, but then it complains about not finding a file:

~/.../filters/pandoc-crossref : cabal --sandbox-config-file=/Users/andrew/Research/Markdown\ magic/pandoc_dev/cabal.sandbox.config exec -- ghc --make pandoc-crossref.hs
[1 of 1] Compiling Main             ( pandoc-crossref.hs, pandoc-crossref.o )
Linking pandoc-crossref ...
ld: warning: directory not found for option '-L/private/tmp/ghc20150402-41611-1b15z9c/ghc-7.10.1/gmp-static'
~/.../filters/pandoc-crossref : pandoc -F pandoc-crossref demo.md -o asdf.html
pandoc: Error running filter pandoc-crossref
pandoc-crossref: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

(I'm so sorry about this super long thread!)

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

Try pandoc -F ./pandoc-crossref ..., since it's not in PATH.

from pandoc-crossref.

andrewheiss avatar andrewheiss commented on June 14, 2024

THAT'S IT. I hadn't thought to include ./, since I figured the command would see it in the current folder. Thanks so much!

In other news, it ran perfectly fine with no errors, so your conservative type specification worked.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 14, 2024

Glad to hear it. Closing this as resolved then.

from pandoc-crossref.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.