${infoTooltip(
gettext(
"Applies all tracked changes so the PDF shows the document as if every change had already been accepted."
),
"pdf-track-resolve-help"
)}
${infoTooltip(
gettext(
"Prints the tracked changes so reviewers can see what was added, removed or altered."
),
"pdf-track-include-help"
)}
${infoTooltip(
gettext(
"Embeds the editable Fidus Writer document inside the PDF so it can be reopened for editing."
),
"pdf-embed-fidus-help"
)}
${gettext("Figures and tables")}
${infoTooltip(
gettext(
"Moves figures to the top of the page instead of interrupting the text flow. A custom document style can override this."
),
"pdf-figure-page-floats-help"
)}
${infoTooltip(
gettext(
"Moves tables to the top of the page instead of interrupting the text flow. A custom document style can override this."
),
"pdf-table-page-floats-help"
)}
${gettext("Print production")}
${infoTooltip(
gettext("Small lines at the corners of the page that show printers where to cut the paper."),
"pdf-crop-marks-help"
)}
${infoTooltip(
gettext("Marks the final size of the page after it has been cut."),
"pdf-trim-box-help"
)}
${infoTooltip(
gettext("Marks the area beyond the final page size where images and colors must extend so no white edges appear after cutting."),
"pdf-bleed-box-help"
)}
${infoTooltip(
gettext("How far, in millimeters, images and colors extend beyond the edge of the page."),
"pdf-bleed-mm-help"
)}
${infoTooltip(
gettext("Draws a visible border around hyperlinks in the PDF so they are easier to find."),
"pdf-link-borders-help"
)}
${infoTooltip(
gettext("Converts SVG images to bitmap images in the PDF, which can help when PDF viewers or printers do not render SVG images correctly."),
"pdf-rasterize-svgs-help"
)}
`
/**
* Radio group for choosing whether tracked changes are resolved (accepted) or
* kept in the exported file. `name` must be unique per dialog; the chosen value
* is read back with {@link getExportTrackChangesValue}.
*/
export const exportTrackChangesTemplate = (name: string): string => `
${gettext("Tracked changes")}
${infoTooltip(
gettext(
"Applies all tracked changes so the exported file shows the document as if every change had already been accepted."
),
`${name}-resolve-help`
)}
${infoTooltip(
gettext(
"Keeps the tracked changes so reviewers can see what was added, removed or altered."
),
`${name}-include-help`
)}
`
/** Read the tracked-changes radio group value ("resolve" or "include"). */
export const getExportTrackChangesValue = (
dialogEl: Element,
name: string
): string => {
return (
dialogEl.querySelector(
`input[name="${name}"]:checked`
) as HTMLInputElement | null
)?.value || "resolve"
}
export const htmlExportDialogTemplate = (): string => `
${exportTrackChangesTemplate("html-track-changes")}
${infoTooltip(
gettext(
"SVG renders consistently across browsers; MathML keeps formulas as text that can be searched and copied, but only newer browsers support it."
),
"html-svg-math-help"
)}
${infoTooltip(
gettext(
"SVG renders consistently across browsers; MathML keeps formulas as text that can be searched and copied, but only newer browsers support it."
),
"epub-svg-math-help"
)}
`
/** A template to configure the display of a figure in the editor. */
export const configureFigureTemplate = ({language}: {language: string}): string =>
`
${gettext("Alignment")}
${gettext("Width")}
${gettext("Listed as")}
${gettext("Caption")}
`
/** A template to configure citations in the editor */
export const configureCitationTemplate = ({
citedItemsHTML,
citeFormat
}: {
citedItemsHTML: string
citeFormat: string
}): string =>
`
${gettext("My sources")}
${gettext("Citation format")}
${gettext("Title")}
${gettext("Author")}
${gettext("Year")}
${gettext("Order")}
${gettext("Remove")}
${citedItemsHTML}
`
/** A template for each selected citation item inside the citation configuration
dialog of the editor. */
export const selectedCitationTemplate = ({
title,
author,
year,
id,
db,
prefix,
locator
}: {
title: string
author: string
year: string
id: number | string
db: string
prefix: string
locator: string
}): string =>
`