diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index 5150e648ee5..abbedc96ac4 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -78,6 +78,7 @@ All changes included in 1.7: - Fix `pandoc.mediabag` Lua typings so autocompletions work with the Lua LSP integration. - ([#11896](https://github.com/quarto-dev/quarto-cli/pull/11896)): fix `\f` (`{{< pagebreak >}}`) form feed character not valid in PowerPoint (`pptx`). - ([#11664](https://github.com/quarto-dev/quarto-cli/issues/11664)): `lipsum` shortcode is no longer randomly generated by default, use `{{< lipsum random=true >}}` to restore randomness. +- ([#11379](https://github.com/quarto-dev/quarto-cli/issues/11379)): Add `version` shortcode to display the current Quarto version. ## Engines diff --git a/src/resources/extensions/quarto/version/_extension.yml b/src/resources/extensions/quarto/version/_extension.yml new file mode 100644 index 00000000000..8f9b6b6f1c4 --- /dev/null +++ b/src/resources/extensions/quarto/version/_extension.yml @@ -0,0 +1,6 @@ +title: Version +author: Posit, PBC +organization: quarto +contributes: + shortcodes: + - version.lua diff --git a/src/resources/extensions/quarto/version/version.lua b/src/resources/extensions/quarto/version/version.lua new file mode 100644 index 00000000000..d957070c79d --- /dev/null +++ b/src/resources/extensions/quarto/version/version.lua @@ -0,0 +1,5 @@ +return { + ['version'] = function(args, kwargs, meta) + return table.concat(quarto.version, '.') + end +} diff --git a/tests/docs/smoke-all/2025/03/06/issue-12006.qmd b/tests/docs/smoke-all/2025/03/06/issue-12006.qmd new file mode 100644 index 00000000000..5056f707207 --- /dev/null +++ b/tests/docs/smoke-all/2025/03/06/issue-12006.qmd @@ -0,0 +1,10 @@ +--- +format: html +_quarto: + tests: + html: + ensureFileRegexMatches: + - ["Quarto [0-9]+\\.[0-9]+\\.[0-9]+ is amazing"] +--- + +Quarto {{< version >}} is amazing.