Experimental. This builds against local checkouts, listed in cabal.project, of pandoc-types and the dependencies that use it (citeproc, texmath, commonmark-pandoc, pandoc-lua-marshal), in deps/. In pandoc-types, Meta and MetaMap now hold an OMap instead of a Map. Code that used Map functions on metadata now uses Data.Map.Ordered. Metadata fields keep their order: - YAML metadata (metadata blocks, --metadata-file, references) is read into a type whose mappings keep the order of the input; scalars are converted as before. Metadata in defaults files is still read through aeson, so its keys come out sorted. - The JSON reader and JSON filters use pandoc-types' new decodePandoc, which preserves the order of metadata fields. - Lua filters preserve the order (via pandoc-lua-marshal). Expected test outputs are updated: metadata now appears in the order in which readers add fields, rather than sorted by key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
Pandoc
|
|
Meta
|
|
{ unMeta =
|
|
fromList
|
|
[ ( "title"
|
|
, MetaInlines
|
|
[ Str "Text"
|
|
, Space
|
|
, Str "before"
|
|
, Space
|
|
, Str "list"
|
|
]
|
|
)
|
|
, ( "author"
|
|
, MetaInlines [ Str "Cynthia" , Space , Str "Johnson" ]
|
|
)
|
|
, ( "operator"
|
|
, MetaInlines [ Str "John" , Space , Str "MacFarlane" ]
|
|
)
|
|
]
|
|
}
|
|
[ OrderedList
|
|
( 1 , Decimal , Period )
|
|
[ [ Para [ Str "One" ] ]
|
|
, [ Para [ Str "Two" ]
|
|
, OrderedList
|
|
( 1 , LowerAlpha , Period )
|
|
[ [ Para [ Str "Three" ] ]
|
|
, [ Para [ Str "Four" ]
|
|
, OrderedList
|
|
( 1 , LowerRoman , Period )
|
|
[ [ Para [ Str "Five" ] ]
|
|
, [ Para [ Str "Six" ]
|
|
, OrderedList
|
|
( 1 , UpperAlpha , Period )
|
|
[ [ Para [ Str "Seven" ] ]
|
|
, [ Para [ Str "Eight" ]
|
|
, OrderedList
|
|
( 1 , UpperRoman , Period )
|
|
[ [ Para [ Str "Nine" ] ]
|
|
, [ Para [ Str "Ten" ]
|
|
, BulletList
|
|
[ [ Para [ Str "Eleven" ] ]
|
|
, [ Para [ Str "Twelve" ] ]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
, Para
|
|
[ Str "Out" , Space , Str "of" , Space , Str "list!" ]
|
|
, Para [ Str "Start" , Space , Str "with" ]
|
|
, OrderedList
|
|
( 7 , Decimal , Period )
|
|
[ [ Para [ Str "Seven" , Space , Str "Start" ] ]
|
|
, [ Para [ Str "Eight" , Space , Str "Continue" ] ]
|
|
]
|
|
]
|