Skip to content

Commit 725b736

Browse files
committed
Listing support template-params
1 parent 1ed0346 commit 725b736

File tree

7 files changed

+24
-2
lines changed

7 files changed

+24
-2
lines changed

news/changelog-1.3.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11

2+
23
## Article Layout
34

45
- Improve the performance of extremely large documents with margin elements by improving the efficiency of positioning the elements.
56

7+
## Listings
8+
9+
- Listings now support `template-params`, which will be passed to custom EJS templates when a listing is rendered.
10+
611
## Miscellaneous
712

8-
- ensure `video` shortcode works with `embed-resources` and `self-contained` ([#3310](https://github.com/quarto-dev/quarto-cli/issues/3310))
13+
- ensure `video` shortcode works with `embed-resources` and `self-contained` ([#3310](https://github.com/quarto-dev/quarto-cli/issues/3310))

src/project/types/website/listing/website-listing-template.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export function templateMarkdownHandler(
150150
ejsParams.listing = reshapedListing;
151151
} else {
152152
ejsParams["metadataAttrs"] = reshapedListing.utilities.metadataAttrs;
153+
ejsParams["template-params"] = reshapedListing["template-params"];
153154
}
154155
return ejsParams;
155156
};

src/resources/editor/tools/vs-code.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10139,6 +10139,10 @@ var require_yaml_intelligence_resources = __commonJS({
1013910139
}
1014010140
}
1014110141
},
10142+
"template-params": {
10143+
schema: "object",
10144+
description: "Parameters that are passed to the custom template."
10145+
},
1014210146
fields: {
1014310147
arrayOf: "string",
1014410148
description: {

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,6 +3115,10 @@
31153115
}
31163116
}
31173117
},
3118+
"template-params": {
3119+
"schema": "object",
3120+
"description": "Parameters that are passed to the custom template."
3121+
},
31183122
"fields": {
31193123
"arrayOf": "string",
31203124
"description": {

src/resources/schema/definitions.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485
args:
486486
string:
487487
description: Additional command line arguments for preview command.
488-
env:
488+
env:
489489
object:
490490
description: Environment variables to set for preview command.
491491
ready:
@@ -1405,6 +1405,9 @@
14051405
short: "The path to a custom listing template."
14061406
long: |
14071407
The path to a custom listing template.
1408+
template-params:
1409+
schema: object
1410+
description: "Parameters that are passed to the custom template."
14081411
fields:
14091412
arrayOf: string
14101413
description:

src/resources/types/schema-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ Defaults to `false`. */;
731731
"table-hover"?:
732732
boolean /* In table type listings, highlight rows of the table when the user hovers the mouse over them.
733733
Defaults to false. */;
734+
"template-params"?: SchemaObject;
734735
"field-display-names"?:
735736
SchemaObject /* A mapping that provides display names for specific fields. For example, to display the title column as ‘Report’ in a table listing you would write:
736737

0 commit comments

Comments
 (0)