-
Is it possible to modify the default HTML template on-the-fly, without using a file? Specifically, I need to strip out this line:
Is it possible to do using something like the example below?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Okay, to answer my own question. To store contents of the default template in a variable and strip the
or, if using Zsh,
But then we need to pass the resulting string as a |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
@tarleb Hello, Albert. I know this is an old thread, and this is not related to Pandoc directly, but could you explain why you have used Another example, from #9697. Your code:
Why you have used One another example, from #9514. Here you use
Asking such silly questions is my regular way to grok into something new to me, like a new programming language. :) |
Beta Was this translation helpful? Give feedback.
Alternative approach: use a custom Lua writer and remove the title line in Lua.