File tree Expand file tree Collapse file tree
tests/docs/smoke-all/lua/format Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,4 +239,13 @@ Returns an object with the format name and variants as would be interpreted by P
239239]]
240240--- @param raw_format string The format ' s string
241241--- @return quarto.format.ParseFormatResult
242- function quarto .format .parse_format (raw_format ) end
242+ function quarto .format .parse_format (raw_format ) end
243+
244+ --[[
245+ Returns a table with the format identifier information, including:
246+ - `target-format`: The full target format name, e.g. `html+variant`
247+ - `base-format`: The base format name, e.g. `html`
248+ - `display-name`: A human-readable display name for the format, e.g. `HTML`
249+ - `extension`: The name of the extension that exposes the format, if present
250+ ]]
251+ function quarto .format .format_identifier () end
Original file line number Diff line number Diff line change @@ -288,6 +288,9 @@ local function _main()
288288 end
289289
290290 return {
291+ format_identifier = function ()
292+ return param (" format-identifier" , {})
293+ end ,
291294 isAsciiDocOutput = isAsciiDocOutput ,
292295 is_asciidoc_output = isAsciiDocOutput ,
293296 isRawHtml = isRawHtml ,
Original file line number Diff line number Diff line change 1+ function Pandoc (doc )
2+ local identifier = quarto .format .format_identifier ()
3+ assert (identifier [" target-format" ] == " html+test" )
4+ assert (identifier [" base-format" ] == " html" )
5+ assert (identifier [" display-name" ] == " HTML" )
6+ return doc
7+ end
Original file line number Diff line number Diff line change 1+ ---
2+ format : html+test
3+ filters :
4+ - format-identifier.lua
5+ ---
6+
You can’t perform that action at this time.
0 commit comments