public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to use writerVariables in new API?
@ 2020-04-12 13:40 Dan Firth
       [not found] ` <8925c8c1-6b17-4b62-80f6-f82f3643fc85-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Firth @ 2020-04-12 13:40 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2951 bytes --]

Hi, I'm trying to upgrade to latest pandoc and I have no idea why I'm 
seeing the following error messages.


Shakefile.hs:189:76: error:
    • Couldn't match expected type ‘Text.DocTemplates.Internal.Context
                                      Text’
                  with actual type ‘a0 -> Context a0 b0 t0’
    • Probable cause: ‘Context’ is applied to too few arguments
      In the ‘writerVariables’ field of a record
      In the expression:
        def
          {writerTableOfContents = True,
           writerVariables = Context
                               (M.fromList
                                  [("geometry", "margin=3cm"), ("fontsize", 
"10"),
                                   ("linkcolor", "blue")])}
      In an equation for ‘latexWriterOptions’:
          latexWriterOptions
            = def
                {writerTableOfContents = True,
                 writerVariables = Context
                                     (M.fromList
                                        [("geometry", "margin=3cm"), 
("fontsize", "10"), ....])}
    |
189 | latexWriterOptions = def { writerTableOfContents = True, 
writerVariables = Context (M.fromList [("geometry","margin=3cm"), 
("fontsize", "10"), ("linkcolor","blue")]) }
    |                                                                       
    
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Shakefile.hs:189:85: error:
    • Couldn't match expected type ‘b0 -> t0’
                  with actual type ‘Map [Char] [Char]’
    • Possible cause: ‘M.fromList’ is applied to too many arguments
      In the first argument of ‘Context’, namely
        ‘(M.fromList
            [("geometry", "margin=3cm"), ("fontsize", "10"),
             ("linkcolor", "blue")])’
      In the ‘writerVariables’ field of a record
      In the expression:
        def
          {writerTableOfContents = True,
           writerVariables = Context
                               (M.fromList
                                  [("geometry", "margin=3cm"), ("fontsize", 
"10"),
                                   ("linkcolor", "blue")])}
    |
189 | latexWriterOptions = def { writerTableOfContents = True, 
writerVariables = Context (M.fromList [("geometry","margin=3cm"), 
("fontsize", "10"), ("linkcolor","blue")]) }

I have no idea what I'm seeing. Context contructor takes a Map. M.fromList 
[] is a Map. What is happening?


-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8925c8c1-6b17-4b62-80f6-f82f3643fc85%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3989 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use writerVariables in new API?
       [not found] ` <8925c8c1-6b17-4b62-80f6-f82f3643fc85-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-04-12 14:07   ` Dan Firth
       [not found]     ` <35534ea0-f5cc-42db-8f7c-a9e694e4463b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Firth @ 2020-04-12 14:07 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1074 bytes --]

Sorry this was my error, I still can't figure out how to use this type 
though. If I do

latexWriterOptions = def { writerTableOfContents = True, writerVariables = 
Context (M.fromList [("geometry",MapVal (Context $ M.fromList 
[("margin",SimpleVal "3cm")])), ("fontsize", (SimpleVal "10")), 
("linkcolor",SimpleVal "blue")]) }

then it type checks but I get this now

user error ("! Package keyval Error: true undefined.\n\nSee the keyval 
package documentation for explanation.\nType  H <return>  for immediate 
help.\n ...                                              
\n                                                  \nl.1005 
\\ProcessOptionsKV[p]{Gm}\n")

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/35534ea0-f5cc-42db-8f7c-a9e694e4463b%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1583 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use writerVariables in new API?
       [not found]     ` <35534ea0-f5cc-42db-8f7c-a9e694e4463b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-04-12 14:34       ` Dan Firth
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Firth @ 2020-04-12 14:34 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 628 bytes --]

Ok this worked

latexWriterOptions = def { writerTableOfContents = True, writerVariables = 
Context (M.fromList [("geometry",SimpleVal "margin=3cm"), ("fontsize", 
(SimpleVal "10")), ("linkcolor",SimpleVal "blue")]) }

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6aef0411-8374-46d8-bd77-2e657962e220%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 976 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-12 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 13:40 How to use writerVariables in new API? Dan Firth
     [not found] ` <8925c8c1-6b17-4b62-80f6-f82f3643fc85-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-04-12 14:07   ` Dan Firth
     [not found]     ` <35534ea0-f5cc-42db-8f7c-a9e694e4463b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-04-12 14:34       ` Dan Firth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).