From 46c4c6bd6a51309dbcbd5ebb8d5c7cedafe69e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Fri, 14 Mar 2025 20:48:42 +0100 Subject: [PATCH 1/2] docs: add "version" shortcode Fixes quarto-dev/quarto-cli#11379 --- docs/authoring/_shortcodes.qmd | 1 + docs/authoring/version.qmd | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/authoring/version.qmd diff --git a/docs/authoring/_shortcodes.qmd b/docs/authoring/_shortcodes.qmd index 9fc8c884bb..148867e161 100644 --- a/docs/authoring/_shortcodes.qmd +++ b/docs/authoring/_shortcodes.qmd @@ -14,6 +14,7 @@ Quarto supports several shortcodes natively: | Shortcode | Description | |---------------------------------------------------------------|------------------------------------------| +| [version](/docs/authoring/version.qmd) | Print Quarto CLI version | | [var](/docs/authoring/variables.qmd#var) | Print value from `_variables.yml` file | | [meta](/docs/authoring/variables.qmd#meta) | Print value from document metadata | | [env](/docs/authoring/variables.qmd#url) | Print system environment variable | diff --git a/docs/authoring/version.qmd b/docs/authoring/version.qmd new file mode 100644 index 0000000000..5df0e98f91 --- /dev/null +++ b/docs/authoring/version.qmd @@ -0,0 +1,24 @@ +--- +title: Displaying Quarto CLI Version +--- + +## Overview + +The `version` shortcode prints the version of the Quarto CLI that is being used to build the document as part of the document content. + +## Example + +Here's an example of the `version` shortcode in action: + +> Quarto CLI {{< version >}} is being used to build this document. + +## Usage + +::: {layout-ncol=2} +```markdown +Quarto CLI {{{< version >}}} is amazing. +``` +:::: {.border} +Quarto CLI {{< version >}} is amazing. +:::: +::: From 2cdf723586db9006081dc330f89d80eaf61193c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 27 Mar 2025 10:41:14 +0100 Subject: [PATCH 2/2] refactor: use the escaped shortcode instead of only the name --- docs/authoring/version.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/authoring/version.qmd b/docs/authoring/version.qmd index 5df0e98f91..1e2591bd9a 100644 --- a/docs/authoring/version.qmd +++ b/docs/authoring/version.qmd @@ -8,7 +8,7 @@ The `version` shortcode prints the version of the Quarto CLI that is being used ## Example -Here's an example of the `version` shortcode in action: +Here's an example of the `{{{< version >}}}` shortcode in action: > Quarto CLI {{< version >}} is being used to build this document.