docs-parse-support-md: Prepare for coping with pandoc versions
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 9 Jun 2020 11:21:48 +0000 (12:21 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 9 Jun 2020 13:05:49 +0000 (14:05 +0100)
commit31a714d54f902aa89f8934593fe90771ef02b727
tree082f46499b5662f1c646d4f0e2b9f2cd04a286e8
parentf7039ee41b3d3448775a1623f230037fd0455104
docs-parse-support-md: Prepare for coping with pandoc versions

Different pandoc versions generate, and expect, a different toplevel
structure for their json output and inpout.  Newer pandoc's toplevel
is a hash.  We are going to want to support this.  We can tell what
kind of output we should produce by looking at the input we got (which
itself came from pandoc).  So:

 * Make space for code to read toplevel objects which are not arrays.
   Currently this code is absent and we just die explicitly (rather
   than dying because we tried to use a hashref as an array ref).

 * Move generation of the toplevel json structure out of
   pandoc2html_inline, and abstract it away through a subref which is
   set up when we read the input file.

This is just prep work.  No functional change other than a change to
an error message.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Paul Durrant <paul@xen.org>
docs/parse-support-md