File tree Expand file tree Collapse file tree 5 files changed +28
-2
lines changed
tests/docs/smoke-all/lua/format Expand file tree Collapse file tree 5 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ All changes included in 1.8:
8181- ([ #12727 ] ( https://github.com/quarto-dev/quarto-cli/issues/12727 ) ): Do not crash in the presence of malformed tabset contents.
8282- ([ #12806 ] ( https://github.com/quarto-dev/quarto-cli/pull/12806 ) ): Use pandoc APIs to handle codepage conversion on Windows.
8383- ([ #12811 ] ( https://github.com/quarto-dev/quarto-cli/pull/12811 ) ): Add support for YouTube Shorts in ` video ` shortcode.
84- - ([ #13128 ] ( https://github.com/quarto-dev/quarto-cli/issues/13128 ) ): Meta shortcode could crash on bad input.
84+ - ([ #13112 ] ( https://github.com/quarto-dev/quarto-cli/pull/13112 ) ): Add ` quarto.format.format_identifier() ` API entry.
85+ - ([ #13128 ] ( https://github.com/quarto-dev/quarto-cli/issues/13128 ) ): Avoid meta shortcode crash on bad input.
8586- ([ #13246 ] ( https://github.com/quarto-dev/quarto-cli/pull/13246 ) ): Add ` quarto.variables.get() ` and ` quarto.metadata.get() ` APIs.
8687
8788## Commands
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