public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* --defaults issue: "Multiple YAML documents encountered"
@ 2023-09-05 21:22 t t
       [not found] ` <f4fee45c-4f45-4b96-a12e-ce203ca06dfen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: t t @ 2023-09-05 21:22 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi all, 
I've been struggling to make a defaults file work... beginning to think 
that this is in fact a bug rather than my ineptitude.
I keep getting the message  "Multiple YAML documents encountered" even 
though there's just one such document involved (that I'm aware of)... that 
is, if I call
`pandoc a.md --defaults=b.yaml -o=c.pdf`

where there's just one line in the .md file, and no metadata file involved, 
nor any headers in there. The yaml used to reproduce the error is 
absolutely minimal (just two lines with three dashes each will reproduce 
the error). 
Of course I did initially try with larger files that actually contained 
things ... (the point of the defaults is mostly to concatenate input files 
without going through the command line)...

This is on macos 12.6.8. , pandoc 3.1.7, upgraded today via homebrew. The 
error happened on 2.19 (?) as well, which is what made me upgrade...

Any suggestions on what I might be doing wrong here?

Thanks,
Best,
Tobias


-- 
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/f4fee45c-4f45-4b96-a12e-ce203ca06dfen%40googlegroups.com.

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

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

* Re: --defaults issue: "Multiple YAML documents encountered"
       [not found] ` <f4fee45c-4f45-4b96-a12e-ce203ca06dfen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-09-05 21:28   ` Bastien DUMONT
  2023-09-05 23:51     ` t t
  2023-09-06  6:22     ` BPJ
  0 siblings, 2 replies; 6+ messages in thread
From: Bastien DUMONT @ 2023-09-05 21:28 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

> The yaml used to reproduce the error is absolutely
> minimal (just two lines with three dashes each will reproduce the error). 

It doesn't happen to me when I end the file with three points instead of three dashes.

-- 
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/ZPedbTNoS6KKoG2l%40localhost.


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

* Re: --defaults issue: "Multiple YAML documents encountered"
  2023-09-05 21:28   ` Bastien DUMONT
@ 2023-09-05 23:51     ` t t
       [not found]       ` <da60dc79-7264-4141-869f-c3acbdc958adn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2023-09-06  6:22     ` BPJ
  1 sibling, 1 reply; 6+ messages in thread
From: t t @ 2023-09-05 23:51 UTC (permalink / raw)
  To: pandoc-discuss


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

Hm, I just tried that - that gives me an aeson exception:
Aeson exception:                                                           
                                            
Error in $: Expected a mapping                                             
                                            
                                                                            
                                           
shell returned 64  

On Tuesday, September 5, 2023 at 5:28:21 PM UTC-4 Bastien DUMONT wrote:

> > The yaml used to reproduce the error is absolutely
> > minimal (just two lines with three dashes each will reproduce the 
> error). 
>
> It doesn't happen to me when I end the file with three points instead of 
> three dashes.
>

-- 
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/da60dc79-7264-4141-869f-c3acbdc958adn%40googlegroups.com.

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

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

* Re: --defaults issue: "Multiple YAML documents encountered"
  2023-09-05 21:28   ` Bastien DUMONT
  2023-09-05 23:51     ` t t
@ 2023-09-06  6:22     ` BPJ
  1 sibling, 0 replies; 6+ messages in thread
From: BPJ @ 2023-09-06  6:22 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

Den tis 5 sep. 2023 23:29Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> skrev:

> > The yaml used to reproduce the error is absolutely
> > minimal (just two lines with three dashes each will reproduce the
> error).
>
> It doesn't happen to me when I end the file with three points instead of
> three dashes.
>

Three dots is the correct way to end a YAML stream, variations permitted by
Pandoc metadata blocks and other tools notwithstanding. Three dashes signal
the *start* of a YAML document within a stream, so if you "end" the file
with three dashes some parsers will (correctly) see that as the start of a
second, empty document, and may discard all but the last document in the
stream and ergo you get an empty or invalid value. I believe that correctly
they ought to discard all but the *first* document (I have no time to look
it up in the spec), but there you have it.



> --
> 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/ZPedbTNoS6KKoG2l%40localhost
> .
>

-- 
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/CADAJKhCnJ9fDf%2BHdxysDDW%3DmvPjQtCCOtYnujYypo8AJXmTPaw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2938 bytes --]

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

* Re: --defaults issue: "Multiple YAML documents encountered"
       [not found]       ` <da60dc79-7264-4141-869f-c3acbdc958adn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-09-06  7:08         ` Bastien DUMONT
  2023-09-06 14:42           ` t t
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien DUMONT @ 2023-09-06  7:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

If you still test an empty YAML file, the parser is right: is expects a mapping after the line of dashes, and you don't provide one. Please fill you YAML file!

Le Tuesday 05 September 2023 à 04:51:41PM, t t a écrit :
> Hm, I just tried that - that gives me an aeson exception:
> Aeson exception:                                                              
>                                        
> Error in $: Expected a mapping                                                
>                                        
>                                                                                
>                                        
> shell returned 64  
> 
> On Tuesday, September 5, 2023 at 5:28:21 PM UTC-4 Bastien DUMONT wrote:
> 
>     > The yaml used to reproduce the error is absolutely
>     > minimal (just two lines with three dashes each will reproduce the
>     error). 
> 
>     It doesn't happen to me when I end the file with three points instead of
>     three dashes.
> 
> --
> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/da60dc79-7264-4141-869f-c3acbdc958adn%40googlegroups.com.
> 
> References:
> 
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/da60dc79-7264-4141-869f-c3acbdc958adn%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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/ZPglgythiDmnRK4Q%40localhost.


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

* Re: --defaults issue: "Multiple YAML documents encountered"
  2023-09-06  7:08         ` Bastien DUMONT
@ 2023-09-06 14:42           ` t t
  0 siblings, 0 replies; 6+ messages in thread
From: t t @ 2023-09-06 14:42 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks for the explanations, now I got it! Indeed I hadn't known yaml 
outside of pandoc headers, so the three dots were news to me... I think I 
did try them at some point yesterday but there was some other ill-formed 
stuff in the file that kept giving me aeson errors (which seem to be 
notoriously inscrutable?)... so now I rewrote that file from scratch and it 
works.
Thanks!
On Wednesday, September 6, 2023 at 3:09:00 AM UTC-4 Bastien DUMONT wrote:

> If you still test an empty YAML file, the parser is right: is expects a 
> mapping after the line of dashes, and you don't provide one. Please fill 
> you YAML file!
>
> Le Tuesday 05 September 2023 à 04:51:41PM, t t a écrit :
> > Hm, I just tried that - that gives me an aeson exception:
> > Aeson exception:                                                         
>      
> >                                        
> > Error in $: Expected a mapping                                           
>      
> >                                        
> >                                                                         
>        
> >                                        
> > shell returned 64  
> > 
> > On Tuesday, September 5, 2023 at 5:28:21 PM UTC-4 Bastien DUMONT wrote:
> > 
> > > The yaml used to reproduce the error is absolutely
> > > minimal (just two lines with three dashes each will reproduce the
> > error). 
> > 
> > It doesn't happen to me when I end the file with three points instead of
> > three dashes.
> > 
> > --
> > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [2]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/da60dc79-7264-4141-869f-c3acbdc958adn%40googlegroups.com.
> > 
> > References:
> > 
> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2] 
> https://groups.google.com/d/msgid/pandoc-discuss/da60dc79-7264-4141-869f-c3acbdc958adn%40googlegroups.com?utm_medium=email&utm_source=footer
>
>

-- 
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/411c4534-ad29-4e8b-991d-b83eef0b66can%40googlegroups.com.

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

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

end of thread, other threads:[~2023-09-06 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-05 21:22 --defaults issue: "Multiple YAML documents encountered" t t
     [not found] ` <f4fee45c-4f45-4b96-a12e-ce203ca06dfen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-09-05 21:28   ` Bastien DUMONT
2023-09-05 23:51     ` t t
     [not found]       ` <da60dc79-7264-4141-869f-c3acbdc958adn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-09-06  7:08         ` Bastien DUMONT
2023-09-06 14:42           ` t t
2023-09-06  6:22     ` BPJ

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).