@@ -16,6 +16,7 @@ import {
1616 kCodeTools ,
1717 kDefaultImageExtension ,
1818 kDfPrint ,
19+ kDisplayName ,
1920 kEcho ,
2021 kError ,
2122 kEval ,
@@ -74,9 +75,13 @@ import { Format } from "../config/types.ts";
7475import { formatResourcePath } from "../core/resources.ts" ;
7576import { quartoConfig } from "../core/quarto.ts" ;
7677
77- export function createFormat ( ext : string , ...formats : Array < unknown > ) : Format {
78+ export function createFormat (
79+ displayName : string ,
80+ ext : string ,
81+ ...formats : Array < unknown >
82+ ) : Format {
7883 return mergeConfigs (
79- defaultFormat ( ) ,
84+ defaultFormat ( displayName ) ,
8085 ...formats ,
8186 {
8287 render : {
@@ -87,10 +92,11 @@ export function createFormat(ext: string, ...formats: Array<unknown>): Format {
8792}
8893
8994export function createHtmlFormat (
95+ displayName : string ,
9096 figwidth : number ,
9197 figheight : number ,
9298) {
93- return createFormat ( "html" , {
99+ return createFormat ( displayName , "html" , {
94100 metadata : {
95101 [ kLang ] : "en" ,
96102 [ kFigResponsive ] : true ,
@@ -113,11 +119,12 @@ export function createHtmlFormat(
113119}
114120
115121export function createHtmlPresentationFormat (
122+ displayName : string ,
116123 figwidth : number ,
117124 figheight : number ,
118125) : Format {
119126 return mergeConfigs (
120- createHtmlFormat ( figwidth , figheight ) ,
127+ createHtmlFormat ( displayName , figwidth , figheight ) ,
121128 {
122129 metadata : {
123130 [ kFigResponsive ] : false ,
@@ -130,8 +137,8 @@ export function createHtmlPresentationFormat(
130137 ) ;
131138}
132139
133- export function createEbookFormat ( ext : string ) : Format {
134- return createFormat ( ext , {
140+ export function createEbookFormat ( displayName : string , ext : string ) : Format {
141+ return createFormat ( displayName , ext , {
135142 formatExtras : ( ) => {
136143 return {
137144 [ kIncludeInHeader ] : [
@@ -153,8 +160,11 @@ export function createEbookFormat(ext: string): Format {
153160 } ) ;
154161}
155162
156- export function createWordprocessorFormat ( ext : string ) : Format {
157- return createFormat ( ext , {
163+ export function createWordprocessorFormat (
164+ displayName : string ,
165+ ext : string ,
166+ ) : Format {
167+ return createFormat ( displayName , ext , {
158168 render : {
159169 [ kPageWidth ] : 6.5 ,
160170 } ,
@@ -168,17 +178,18 @@ export function createWordprocessorFormat(ext: string): Format {
168178 } ) ;
169179}
170180
171- export function plaintextFormat ( ext : string ) : Format {
172- return createFormat ( ext , {
181+ export function plaintextFormat ( displayName : string , ext : string ) : Format {
182+ return createFormat ( displayName , ext , {
173183 pandoc : {
174184 standalone : true ,
175185 [ kDefaultImageExtension ] : "png" ,
176186 } ,
177187 } ) ;
178188}
179189
180- function defaultFormat ( ) : Format {
190+ function defaultFormat ( displayName : string ) : Format {
181191 return {
192+ [ kDisplayName ] : displayName ,
182193 execute : {
183194 [ kFigWidth ] : 7 ,
184195 [ kFigHeight ] : 5 ,
0 commit comments