Skip to content

To modify default HTML template on-the-fly #9788

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

You must be logged in to vote

Alternative approach: use a custom Lua writer and remove the title line in Lua.

Extensions = pandoc.format.extensions 'html5'
Template = pandoc.template.default('html5'):gsub('\n<title>[^\n]*', '')
Writer = function (doc, opts)
  return pandoc.write(doc, {format='html5', extensions=opts.extensions}, opts)
end

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@jsx97
Comment options

@jsx97
Comment options

@jsx97
Comment options

@tarleb
Comment options

Answer selected by jsx97
Comment options

You must be logged in to vote
1 reply
@tarleb
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
2 participants