From c266734448544a118ed80e47deaa2590131c7f84 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 12:09:51 -0700 Subject: Use pretty-simple to format native output. Previously we used our own homespun formatting. But this produces over-long lines that aren't ideal for diffs in tests. Easier to use something off-the-shelf and standard. Closes #7580. Performance is slower by about a factor of 10, but this isn't really a problem because native isn't suitable as a serialization format. (For serialization you should use json, because the reader is so much faster than native.) --- test/docbook-xref.native | 213 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 184 insertions(+), 29 deletions(-) (limited to 'test/docbook-xref.native') diff --git a/test/docbook-xref.native b/test/docbook-xref.native index 54a63768e..16113d50b 100644 --- a/test/docbook-xref.native +++ b/test/docbook-xref.native @@ -1,29 +1,184 @@ -Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "An",Space,Str "Example",Space,Str "Book"])]}) -[Header 1 ("ch01",[],[]) [Str "XRef",Space,Str "Samples"] -,Para [Str "This",Space,Str "paragraph",Space,Str "demonstrates",Space,Str "several",Space,Str "features",Space,Str "of",SoftBreak,Str "XRef."] -,BulletList - [[Para [Str "A",Space,Str "straight",Space,Str "link",Space,Str "generates",Space,Str "the",SoftBreak,Str "cross-reference",Space,Str "text:",Space,Link ("",[],[]) [Str "The",Space,Str "Second",Space,Str "Chapter"] ("#ch02",""),Str "."]] - ,[Para [Str "A",Space,Str "link",Space,Str "to",Space,Str "an",Space,Str "element",Space,Str "with",Space,Str "an",SoftBreak,Str "XRefLabel:",SoftBreak,Link ("",[],[]) [Str "Chapter",Space,Str "the",Space,Str "Third"] ("#ch03",""),Str "."]] - ,[Para [Str "A",Space,Str "link",Space,Str "with",Space,Str "an",SoftBreak,Str "EndTerm:",SoftBreak,Link ("",[],[]) [Str "Chapter",Space,Str "4"] ("#ch04",""),Str "."]] - ,[Para [Str "A",Space,Str "link",Space,Str "to",Space,Str "an",SoftBreak,Str "cmdsynopsis",Space,Str "element:",Space,Link ("",[],[]) [Str "chgrp"] ("#cmd01",""),Str "."]] - ,[Para [Str "A",Space,Str "link",Space,Str "to",Space,Str "an",SoftBreak,Str "funcsynopsis",Space,Str "element:",Space,Link ("",[],[]) [Str "max"] ("#func01",""),Str "."]]] -,Header 1 ("ch02",[],[]) [Str "The",Space,Str "Second",Space,Str "Chapter"] -,Para [Str "Some",Space,Str "content",Space,Str "here"] -,Header 1 ("ch03",[],[]) [Str "The",Space,Str "Third",Space,Str "Chapter"] -,Para [Str "Some",Space,Str "content",Space,Str "here"] -,Header 1 ("ch04",[],[]) [Str "The",Space,Str "Fourth",Space,Str "Chapter"] -,Para [Str "Some",Space,Str "content",Space,Str "here"] -,Plain [Str "chgrp"] -,Plain [Str "-R"] -,Plain [Str "-H"] -,Plain [Str "-L"] -,Plain [Str "-P"] -,Plain [Str "-f"] -,Plain [Str "group"] -,Plain [Str "file"] -,Plain [Str "int"] -,Plain [Str "max"] -,Plain [Str "int"] -,Plain [Str "int1"] -,Plain [Str "int"] -,Plain [Str "int2"]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "title" + , MetaInlines + [ Str "An", Space, Str "Example", Space, Str "Book" ] + ) + ] + } + ) + [ Header 1 + ( "ch01", [], [] ) + [ Str "XRef", Space, Str "Samples" ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "demonstrates" + , Space + , Str "several" + , Space + , Str "features" + , Space + , Str "of" + , SoftBreak + , Str "XRef." + ] + , BulletList + [ + [ Para + [ Str "A" + , Space + , Str "straight" + , Space + , Str "link" + , Space + , Str "generates" + , Space + , Str "the" + , SoftBreak + , Str "cross-reference" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "The", Space, Str "Second", Space, Str "Chapter" ] + ( "#ch02", "" ) + , Str "." + ] + ] + , + [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Str "XRefLabel:" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "Chapter", Space, Str "the", Space, Str "Third" ] + ( "#ch03", "" ) + , Str "." + ] + ] + , + [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Str "EndTerm:" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "Chapter", Space, Str "4" ] + ( "#ch04", "" ) + , Str "." + ] + ] + , + [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , SoftBreak + , Str "cmdsynopsis" + , Space + , Str "element:" + , Space + , Link + ( "", [], [] ) + [ Str "chgrp" ] + ( "#cmd01", "" ) + , Str "." + ] + ] + , + [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , SoftBreak + , Str "funcsynopsis" + , Space + , Str "element:" + , Space + , Link + ( "", [], [] ) + [ Str "max" ] + ( "#func01", "" ) + , Str "." + ] + ] + ] + , Header 1 + ( "ch02", [], [] ) + [ Str "The", Space, Str "Second", Space, Str "Chapter" ] + , Para + [ Str "Some", Space, Str "content", Space, Str "here" ] + , Header 1 + ( "ch03", [], [] ) + [ Str "The", Space, Str "Third", Space, Str "Chapter" ] + , Para + [ Str "Some", Space, Str "content", Space, Str "here" ] + , Header 1 + ( "ch04", [], [] ) + [ Str "The", Space, Str "Fourth", Space, Str "Chapter" ] + , Para + [ Str "Some", Space, Str "content", Space, Str "here" ] + , Plain + [ Str "chgrp" ] + , Plain + [ Str "-R" ] + , Plain + [ Str "-H" ] + , Plain + [ Str "-L" ] + , Plain + [ Str "-P" ] + , Plain + [ Str "-f" ] + , Plain + [ Str "group" ] + , Plain + [ Str "file" ] + , Plain + [ Str "int" ] + , Plain + [ Str "max" ] + , Plain + [ Str "int" ] + , Plain + [ Str "int1" ] + , Plain + [ Str "int" ] + , Plain + [ Str "int2" ] + ] -- cgit v1.2.3