Skip to content

Custom writers: Adding a file header with pandoc.scaffolding #9708

Closed Answered by tarleb
bpj asked this question in Q&A
Discussion options

You must be logged in to vote

Exactly. The default implementation for Pandoc basically does the equivalent to

Writer = pandoc.scaffolding.Writer
function Writer.Pandoc (doc, opts)
  return Writer.Blocks(doc.blocks)
end

So something like this should work:

function Writer.Pandoc (doc, opts)
  return {'=encoding UTF-8\n', Writer.Blocks(doc.blocks)
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tarleb
Comment options

Answer selected by bpj
@bpj
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants