postext 1.22.2 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/bundle.test.js +1 -1
- package/dist/__tests__/codeBlocks.test.d.ts +2 -0
- package/dist/__tests__/codeBlocks.test.d.ts.map +1 -0
- package/dist/__tests__/codeBlocks.test.js +550 -0
- package/dist/__tests__/codeBlocks.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +19 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/hardBreaks.test.d.ts +2 -0
- package/dist/__tests__/hardBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/hardBreaks.test.js +226 -0
- package/dist/__tests__/hardBreaks.test.js.map +1 -0
- package/dist/__tests__/headingInlineMarks.test.js +1 -1
- package/dist/__tests__/headingLetterSpacing.test.js +1 -1
- package/dist/__tests__/headingLetterSpacing.test.js.map +1 -1
- package/dist/__tests__/lineNumbers.test.d.ts +2 -0
- package/dist/__tests__/lineNumbers.test.d.ts.map +1 -0
- package/dist/__tests__/lineNumbers.test.js +304 -0
- package/dist/__tests__/lineNumbers.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +2 -2
- package/dist/__tests__/paragraphDropCap.test.d.ts +2 -0
- package/dist/__tests__/paragraphDropCap.test.d.ts.map +1 -0
- package/dist/__tests__/paragraphDropCap.test.js +442 -0
- package/dist/__tests__/paragraphDropCap.test.js.map +1 -0
- package/dist/__tests__/paragraphStyleIndent.test.js +26 -2
- package/dist/__tests__/paragraphStyleIndent.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +7 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
- package/dist/__tests__/tabStops.test.d.ts +2 -0
- package/dist/__tests__/tabStops.test.d.ts.map +1 -0
- package/dist/__tests__/tabStops.test.js +394 -0
- package/dist/__tests__/tabStops.test.js.map +1 -0
- package/dist/__tests__/verseLines.test.d.ts +2 -0
- package/dist/__tests__/verseLines.test.d.ts.map +1 -0
- package/dist/__tests__/verseLines.test.js +375 -0
- package/dist/__tests__/verseLines.test.js.map +1 -0
- package/dist/bundle/configVersion.d.ts +77 -7
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +239 -5
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/bundle/index.d.ts +1 -1
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/index.js.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +39 -5
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +3 -0
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/cjkMarks.js +1 -1
- package/dist/cjkMarks.js.map +1 -1
- package/dist/code/highlight.d.ts +34 -0
- package/dist/code/highlight.d.ts.map +1 -0
- package/dist/code/highlight.js +406 -0
- package/dist/code/highlight.js.map +1 -0
- package/dist/configWarnings.d.ts.map +1 -1
- package/dist/configWarnings.js +192 -3
- package/dist/configWarnings.js.map +1 -1
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +25 -0
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/calloutStyles.js +7 -0
- package/dist/defaults/calloutStyles.js.map +1 -1
- package/dist/defaults/codeStyle.d.ts +29 -0
- package/dist/defaults/codeStyle.d.ts.map +1 -0
- package/dist/defaults/codeStyle.js +284 -0
- package/dist/defaults/codeStyle.js.map +1 -0
- package/dist/defaults/dropCap.d.ts +49 -0
- package/dist/defaults/dropCap.d.ts.map +1 -0
- package/dist/defaults/dropCap.js +66 -0
- package/dist/defaults/dropCap.js.map +1 -0
- package/dist/defaults/headings.d.ts +1 -1
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +11 -0
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +3 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +19 -0
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/lineNumbers.d.ts +19 -0
- package/dist/defaults/lineNumbers.d.ts.map +1 -0
- package/dist/defaults/lineNumbers.js +101 -0
- package/dist/defaults/lineNumbers.js.map +1 -0
- package/dist/defaults/paragraphStyles.d.ts.map +1 -1
- package/dist/defaults/paragraphStyles.js +20 -0
- package/dist/defaults/paragraphStyles.js.map +1 -1
- package/dist/defaults/tabStops.d.ts +29 -0
- package/dist/defaults/tabStops.d.ts.map +1 -0
- package/dist/defaults/tabStops.js +94 -0
- package/dist/defaults/tabStops.js.map +1 -0
- package/dist/defaults/verse.d.ts +10 -0
- package/dist/defaults/verse.d.ts.map +1 -0
- package/dist/defaults/verse.js +52 -0
- package/dist/defaults/verse.js.map +1 -0
- package/dist/fonts/usage.d.ts +7 -0
- package/dist/fonts/usage.d.ts.map +1 -1
- package/dist/fonts/usage.js +71 -0
- package/dist/fonts/usage.js.map +1 -1
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +85 -11
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/measure/bidiLines.js +2 -2
- package/dist/measure/bidiLines.js.map +1 -1
- package/dist/measure/cache.js +2 -2
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/cjkCompose.d.ts.map +1 -1
- package/dist/measure/cjkCompose.js +5 -5
- package/dist/measure/cjkCompose.js.map +1 -1
- package/dist/measure/hardBreaks.d.ts +46 -0
- package/dist/measure/hardBreaks.d.ts.map +1 -0
- package/dist/measure/hardBreaks.js +216 -0
- package/dist/measure/hardBreaks.js.map +1 -0
- package/dist/measure/index.d.ts +1 -0
- package/dist/measure/index.d.ts.map +1 -1
- package/dist/measure/index.js +1 -0
- package/dist/measure/index.js.map +1 -1
- package/dist/measure/leader.d.ts +20 -0
- package/dist/measure/leader.d.ts.map +1 -0
- package/dist/measure/leader.js +46 -0
- package/dist/measure/leader.js.map +1 -0
- package/dist/measure/links.js +1 -1
- package/dist/measure/links.js.map +1 -1
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +18 -25
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/rich.d.ts +19 -0
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +211 -38
- package/dist/measure/rich.js.map +1 -1
- package/dist/measure/tabs.d.ts +103 -0
- package/dist/measure/tabs.d.ts.map +1 -0
- package/dist/measure/tabs.js +123 -0
- package/dist/measure/tabs.js.map +1 -0
- package/dist/measure/types.d.ts +26 -2
- package/dist/measure/types.d.ts.map +1 -1
- package/dist/measure/types.js +23 -3
- package/dist/measure/types.js.map +1 -1
- package/dist/parse/blockParser.d.ts +13 -6
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +457 -87
- package/dist/parse/blockParser.js.map +1 -1
- package/dist/parse/codeFence.d.ts +18 -0
- package/dist/parse/codeFence.d.ts.map +1 -0
- package/dist/parse/codeFence.js +52 -0
- package/dist/parse/codeFence.js.map +1 -0
- package/dist/parse/index.d.ts +1 -1
- package/dist/parse/index.d.ts.map +1 -1
- package/dist/parse/index.js.map +1 -1
- package/dist/parse/indexMarks.d.ts +3 -1
- package/dist/parse/indexMarks.d.ts.map +1 -1
- package/dist/parse/indexMarks.js +22 -2
- package/dist/parse/indexMarks.js.map +1 -1
- package/dist/parse/inlineFormatting.d.ts +50 -0
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +94 -0
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +65 -1
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +144 -9
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +143 -18
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
- package/dist/pipeline/buildBlockKind.js +60 -1
- package/dist/pipeline/buildBlockKind.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts +3 -0
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +7 -2
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +33 -2
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/chips.d.ts.map +1 -1
- package/dist/pipeline/chips.js +4 -0
- package/dist/pipeline/chips.js.map +1 -1
- package/dist/pipeline/codeBlocks.d.ts +38 -0
- package/dist/pipeline/codeBlocks.d.ts.map +1 -0
- package/dist/pipeline/codeBlocks.js +146 -0
- package/dist/pipeline/codeBlocks.js.map +1 -0
- package/dist/pipeline/codeInline.d.ts +22 -0
- package/dist/pipeline/codeInline.d.ts.map +1 -0
- package/dist/pipeline/codeInline.js +93 -0
- package/dist/pipeline/codeInline.js.map +1 -0
- package/dist/pipeline/codeLines.d.ts +91 -0
- package/dist/pipeline/codeLines.d.ts.map +1 -0
- package/dist/pipeline/codeLines.js +399 -0
- package/dist/pipeline/codeLines.js.map +1 -0
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +8 -1
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts +9 -0
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +60 -2
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/continuation.d.ts.map +1 -1
- package/dist/pipeline/continuation.js +9 -2
- package/dist/pipeline/continuation.js.map +1 -1
- package/dist/pipeline/dropCap.d.ts +128 -0
- package/dist/pipeline/dropCap.d.ts.map +1 -0
- package/dist/pipeline/dropCap.js +412 -0
- package/dist/pipeline/dropCap.js.map +1 -0
- package/dist/pipeline/hardBreaks.d.ts +19 -0
- package/dist/pipeline/hardBreaks.d.ts.map +1 -0
- package/dist/pipeline/hardBreaks.js +36 -0
- package/dist/pipeline/hardBreaks.js.map +1 -0
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +4 -1
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/lineNumbers.d.ts +37 -0
- package/dist/pipeline/lineNumbers.d.ts.map +1 -0
- package/dist/pipeline/lineNumbers.js +441 -0
- package/dist/pipeline/lineNumbers.js.map +1 -0
- package/dist/pipeline/measureContentBlock.d.ts +31 -5
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +274 -68
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/partPalette.d.ts +1 -1
- package/dist/pipeline/partPalette.d.ts.map +1 -1
- package/dist/pipeline/partPalette.js +24 -2
- package/dist/pipeline/partPalette.js.map +1 -1
- package/dist/pipeline/styles.d.ts +18 -2
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +15 -3
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/pipeline/tabs.d.ts +35 -0
- package/dist/pipeline/tabs.d.ts.map +1 -0
- package/dist/pipeline/tabs.js +99 -0
- package/dist/pipeline/tabs.js.map +1 -0
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +3 -38
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/pipeline/verseLines.d.ts +78 -0
- package/dist/pipeline/verseLines.d.ts.map +1 -0
- package/dist/pipeline/verseLines.js +245 -0
- package/dist/pipeline/verseLines.js.map +1 -0
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +1 -0
- package/dist/preflight.js.map +1 -1
- package/dist/types.d.ts +560 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +240 -7
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js +6 -0
- package/dist/vdt.js.map +1 -1
- package/dist/word/docxRead.d.ts.map +1 -1
- package/dist/word/docxRead.js +15 -0
- package/dist/word/docxRead.js.map +1 -1
- package/dist/word/inline.d.ts +6 -1
- package/dist/word/inline.d.ts.map +1 -1
- package/dist/word/inline.js +35 -1
- package/dist/word/inline.js.map +1 -1
- package/dist/word/model.d.ts +14 -0
- package/dist/word/model.d.ts.map +1 -1
- package/dist/word/model.js.map +1 -1
- package/dist/word/template.d.ts +12 -3
- package/dist/word/template.d.ts.map +1 -1
- package/dist/word/template.js +13 -3
- package/dist/word/template.js.map +1 -1
- package/dist/word/toDocx.d.ts.map +1 -1
- package/dist/word/toDocx.js +52 -8
- package/dist/word/toDocx.js.map +1 -1
- package/dist/word/toMarkdown.d.ts +5 -1
- package/dist/word/toMarkdown.d.ts.map +1 -1
- package/dist/word/toMarkdown.js +117 -6
- package/dist/word/toMarkdown.js.map +1 -1
- package/dist/word/word.test.js +124 -2
- package/dist/word/word.test.js.map +1 -1
- package/dist/worker/fonts.d.ts +2 -1
- package/dist/worker/fonts.d.ts.map +1 -1
- package/dist/worker/fonts.js +6 -2
- package/dist/worker/fonts.js.map +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -604,6 +604,13 @@ export interface LayoutContinuation {
|
|
|
604
604
|
* numbered through the book (`footnotes.numbering: 'document'`) go on
|
|
605
605
|
* from it. */
|
|
606
606
|
footnoteNumber?: number;
|
|
607
|
+
/** The number of the last line the preceding content counted (#621), so
|
|
608
|
+
* line numbers counted through the book (`lineNumbers.restart:
|
|
609
|
+
* 'document'`) go on from it. `continuationAfter` counts the lines of
|
|
610
|
+
* verse from the text; a count of every line (`count: 'all'`) depends
|
|
611
|
+
* on the layout, and the host takes it from the previous chapter's
|
|
612
|
+
* `VDTDocument.lastLineNumber`. */
|
|
613
|
+
lineNumber?: number;
|
|
607
614
|
/** The `:::part` in effect at the end of the preceding content — the last
|
|
608
615
|
* part opened, whether or not its fence has closed — so a chapter laid
|
|
609
616
|
* out on its own keeps `{partTitle}` / `{partNumber}` and the part's
|
|
@@ -1154,6 +1161,28 @@ export interface BodyTextConfig {
|
|
|
1154
1161
|
* `pinLegacyHyphenBreaks`). Applies to the running text, headings, lists,
|
|
1155
1162
|
* blockquotes and boxes. */
|
|
1156
1163
|
breakAfterHyphens?: boolean;
|
|
1164
|
+
/** Read a backslash at the end of a source line, and `\\` before a space,
|
|
1165
|
+
* as a forced line break inside a paragraph, a quotation or a list item
|
|
1166
|
+
* (CommonMark's hard break, #620): the next words start a new line
|
|
1167
|
+
* of the same paragraph, and the line before the break is set at its
|
|
1168
|
+
* natural width, as a paragraph's last line is. A backslash that ends
|
|
1169
|
+
* the paragraph prints. Two trailing spaces are no break (they are
|
|
1170
|
+
* invisible, and editors leave them behind). Default `true`. `false`
|
|
1171
|
+
* keeps postext 1.22's reading: the backslashes print and the lines
|
|
1172
|
+
* join with a space (configurations stored before `configVersion` 9
|
|
1173
|
+
* whose text has such a backslash read with it, see
|
|
1174
|
+
* `pinLegacyHardBreaks`). Titles (`\\` in a heading), captions, notes
|
|
1175
|
+
* and table cells break at `\\` either way. */
|
|
1176
|
+
hardLineBreaks?: boolean;
|
|
1177
|
+
/** Tab stops of every paragraph, list item and quotation (#622): where a
|
|
1178
|
+
* tab (`:tab`, or a tab character in the text) sends the words after
|
|
1179
|
+
* it. A paragraph style or a callout body that sets its own replaces
|
|
1180
|
+
* them. Unset: none; a tab character is then a word space, as before. */
|
|
1181
|
+
tabStops?: TabStop[];
|
|
1182
|
+
/** Default stops every `tabInterval` past the last of {@link tabStops}
|
|
1183
|
+
* (#622), from the start of the measure. Unset: a tab past the last stop
|
|
1184
|
+
* is a word space. */
|
|
1185
|
+
tabInterval?: Dimension;
|
|
1157
1186
|
/** Start the line after a break at a compound's hyphen with a hyphen too:
|
|
1158
1187
|
* "vencer-" | "-se", as Portuguese spelling and the Spanish Academy's
|
|
1159
1188
|
* 2010 rules ask ("léxico-" | "-semántico"), so the reader knows the
|
|
@@ -1170,6 +1199,9 @@ export interface BodyTextConfig {
|
|
|
1170
1199
|
* postext 1.4 gave them: grey (`#666666`), italic, the body's first-line
|
|
1171
1200
|
* indent and no side indent. */
|
|
1172
1201
|
blockquote?: BlockquoteConfig;
|
|
1202
|
+
/** How `:::verse` poems in the line layout are set (#620): each fence
|
|
1203
|
+
* attribute of the same name overrides the setting for its poem. */
|
|
1204
|
+
verse?: VerseConfig;
|
|
1173
1205
|
/** When true, discourage a paragraph from ending with fewer than `orphanMinLines`
|
|
1174
1206
|
* lines at the top of the next column. Soft (penalty-based). Default true. */
|
|
1175
1207
|
avoidOrphans?: boolean;
|
|
@@ -1357,6 +1389,351 @@ export interface BlockquoteConfig {
|
|
|
1357
1389
|
* the body's `firstLineIndent`. */
|
|
1358
1390
|
firstLineIndent?: Dimension;
|
|
1359
1391
|
}
|
|
1392
|
+
/** How a turnover of verse is set (#620): `'hang'` on a line of its own,
|
|
1393
|
+
* indented from the line's start; `'right'` flush with the end side,
|
|
1394
|
+
* behind an opening bracket (`turnoverMark`), the custom of English and
|
|
1395
|
+
* Spanish editions of poetry. */
|
|
1396
|
+
export type VerseTurnover = 'hang' | 'right';
|
|
1397
|
+
/** The defaults of `:::verse` poems (#620). A poem's fence names any of
|
|
1398
|
+
* them for itself (`:::verse{indentStep=1em turnover=right}`). */
|
|
1399
|
+
export interface VerseConfig {
|
|
1400
|
+
/** How a poem whose fence names no `layout` is set. `'auto'` (default):
|
|
1401
|
+
* as bayts (#378) when a line carries a hemistich separator (`||`, a
|
|
1402
|
+
* spaced `\\`), line by line otherwise. `'bayt'`: as bayts always, a
|
|
1403
|
+
* poem with no separator as centred single hemistichs, as postext 1.22
|
|
1404
|
+
* set it (configurations stored before #620 are read with it when they
|
|
1405
|
+
* hold such a poem). */
|
|
1406
|
+
layout?: 'auto' | 'bayt';
|
|
1407
|
+
/** The width of one leading space of a line of verse (a tab counts four,
|
|
1408
|
+
* an ideographic space two); `em` is the poem's size. Default `0.5em`:
|
|
1409
|
+
* two spaces indent a line one em. */
|
|
1410
|
+
indentStep?: Dimension;
|
|
1411
|
+
/** How a line wider than the measure turns over. Default `'hang'`. */
|
|
1412
|
+
turnover?: VerseTurnover;
|
|
1413
|
+
/** The indent of a hanging turnover, from its line's own start, when
|
|
1414
|
+
* the poem's paragraph style sets no `hangingIndent`; `em` is the
|
|
1415
|
+
* poem's size. Default `2em`. */
|
|
1416
|
+
hang?: Dimension;
|
|
1417
|
+
/** The mark before a turnover set flush right (`turnover: 'right'`).
|
|
1418
|
+
* Default `[`. */
|
|
1419
|
+
turnoverMark?: string;
|
|
1420
|
+
/** The space between two stanzas, in lines of the poem's leading. On
|
|
1421
|
+
* the baseline grid it comes out a whole number of grid lines (a
|
|
1422
|
+
* paragraph style with `snapToGrid: false` keeps it exact). Default
|
|
1423
|
+
* `1`. */
|
|
1424
|
+
stanzaSpace?: number;
|
|
1425
|
+
/** Keep any stanza of this many lines of verse or fewer whole in one
|
|
1426
|
+
* column (a haiku, a tanka): it moves on whole when it does not fit.
|
|
1427
|
+
* Default `0`, off. */
|
|
1428
|
+
keepStanzas?: number;
|
|
1429
|
+
}
|
|
1430
|
+
export interface ResolvedVerseConfig {
|
|
1431
|
+
layout: 'auto' | 'bayt';
|
|
1432
|
+
indentStep: Dimension;
|
|
1433
|
+
turnover: VerseTurnover;
|
|
1434
|
+
hang: Dimension;
|
|
1435
|
+
turnoverMark: string;
|
|
1436
|
+
stanzaSpace: number;
|
|
1437
|
+
keepStanzas: number;
|
|
1438
|
+
}
|
|
1439
|
+
/** What `lineNumbers` counts (#621): `'verse'`, the lines of `:::verse`
|
|
1440
|
+
* poems (a turnover takes no number); `'all'`, every laid-out line of the
|
|
1441
|
+
* body text — paragraphs, list items, quotations and verse. */
|
|
1442
|
+
export type LineNumbersCount = 'verse' | 'all';
|
|
1443
|
+
/** Where the line count starts again (#621): never (`'document'`, which
|
|
1444
|
+
* runs on through the chapters of a book), at every level-1 heading
|
|
1445
|
+
* (`'chapter'`), at every level-1 or level-2 heading (`'section'`), on
|
|
1446
|
+
* every page (`'page'`) or at every `:::verse` poem (`'poem'`). */
|
|
1447
|
+
export type LineNumbersRestart = 'document' | 'chapter' | 'section' | 'page' | 'poem';
|
|
1448
|
+
/** The side of the text the numbers stand on (#621): the outer margin
|
|
1449
|
+
* (away from the spine: right on a recto, left on a verso), the inner
|
|
1450
|
+
* one, the physical `'left'` or `'right'`, the start or end side of the
|
|
1451
|
+
* document's direction (`'start'` is the right of a right-to-left
|
|
1452
|
+
* book), or the side column of a one-and-a-half layout (`'side'`, set
|
|
1453
|
+
* flush with its edge next to the text). */
|
|
1454
|
+
export type LineNumbersPosition = 'outer' | 'inner' | 'left' | 'right' | 'start' | 'end' | 'side';
|
|
1455
|
+
/** Where the numbers of a page of two or more text columns go (#621):
|
|
1456
|
+
* beside every column on the {@link LineNumbersPosition} side (`'each'`),
|
|
1457
|
+
* in the gutters (`'gutter'`: the first column's on its right, the
|
|
1458
|
+
* others' on their left) or on the outer edges of the first and last
|
|
1459
|
+
* columns (`'outer-edges'`, columns between them as `'each'`). */
|
|
1460
|
+
export type LineNumbersMultiColumn = 'each' | 'gutter' | 'outer-edges';
|
|
1461
|
+
/** Line numbers in the margin (#621): every Nth line of the text gets its
|
|
1462
|
+
* number beside it, as critical editions, poetry, legal texts and
|
|
1463
|
+
* line-referenced school texts print them. The numbers are painted on
|
|
1464
|
+
* the line's baseline and never move a line. Off unless `enabled`. */
|
|
1465
|
+
export interface LineNumbersConfig {
|
|
1466
|
+
/** Default `false`. */
|
|
1467
|
+
enabled?: boolean;
|
|
1468
|
+
/** What is counted. Default `'verse'`. */
|
|
1469
|
+
count?: LineNumbersCount;
|
|
1470
|
+
/** Print the number of every Nth line (the multiples of N). Default
|
|
1471
|
+
* `5`; a `:::verse` fence sets its own with `interval=N`. */
|
|
1472
|
+
interval?: number;
|
|
1473
|
+
/** Also print the number of the first line after each restart. Default
|
|
1474
|
+
* `false`. */
|
|
1475
|
+
numberFirst?: boolean;
|
|
1476
|
+
/** Where the count starts again. Default `'poem'` when {@link count} is
|
|
1477
|
+
* `'verse'`, `'page'` when it is `'all'`. `:::numbering{lines=N}`
|
|
1478
|
+
* restarts it anywhere. */
|
|
1479
|
+
restart?: LineNumbersRestart;
|
|
1480
|
+
/** The number of the first line after a restart. Default `1`. */
|
|
1481
|
+
startAt?: number;
|
|
1482
|
+
/** Default `'outer'`. */
|
|
1483
|
+
position?: LineNumbersPosition;
|
|
1484
|
+
/** Pages of two or more text columns. Default `'outer-edges'`. */
|
|
1485
|
+
multiColumn?: LineNumbersMultiColumn;
|
|
1486
|
+
/** The distance from the column's edge to the number; `em` is the
|
|
1487
|
+
* number's size. Default `1em`. Not used with `position: 'side'`, where
|
|
1488
|
+
* the number stands flush with the side column's edge. */
|
|
1489
|
+
gap?: Dimension;
|
|
1490
|
+
/** How a number aligns: `'auto'` flush toward the text (right-aligned
|
|
1491
|
+
* in a left margin, left-aligned in a right one), `'left'` or
|
|
1492
|
+
* `'right'` within the width of the widest number of the page. Default
|
|
1493
|
+
* `'auto'`. */
|
|
1494
|
+
align?: 'auto' | 'left' | 'right';
|
|
1495
|
+
/** Default: the body font family. */
|
|
1496
|
+
fontFamily?: string;
|
|
1497
|
+
/** Default: 0.8 of the body font size. */
|
|
1498
|
+
fontSize?: Dimension;
|
|
1499
|
+
/** Default: the body font weight. */
|
|
1500
|
+
fontWeight?: number;
|
|
1501
|
+
/** Default `false`. */
|
|
1502
|
+
italic?: boolean;
|
|
1503
|
+
/** Default: the body text colour. A palette-linked colour follows part
|
|
1504
|
+
* and section palettes. */
|
|
1505
|
+
color?: ColorValue;
|
|
1506
|
+
/** The numbering format, in any spelling a list or a page number takes
|
|
1507
|
+
* (`decimal`, `lower-roman`, `arabic-indic`, `一`…). Default decimal,
|
|
1508
|
+
* in the document's digits (`numerals`). */
|
|
1509
|
+
format?: string;
|
|
1510
|
+
}
|
|
1511
|
+
export interface ResolvedLineNumbersConfig {
|
|
1512
|
+
enabled: boolean;
|
|
1513
|
+
count: LineNumbersCount;
|
|
1514
|
+
interval: number;
|
|
1515
|
+
numberFirst: boolean;
|
|
1516
|
+
restart: LineNumbersRestart;
|
|
1517
|
+
startAt: number;
|
|
1518
|
+
position: LineNumbersPosition;
|
|
1519
|
+
multiColumn: LineNumbersMultiColumn;
|
|
1520
|
+
gap: Dimension;
|
|
1521
|
+
align: 'auto' | 'left' | 'right';
|
|
1522
|
+
fontFamily: string;
|
|
1523
|
+
fontSize: Dimension;
|
|
1524
|
+
fontWeight: number;
|
|
1525
|
+
italic: boolean;
|
|
1526
|
+
color: ColorValue;
|
|
1527
|
+
/** As written; unset for decimal. */
|
|
1528
|
+
format?: string;
|
|
1529
|
+
}
|
|
1530
|
+
/** The kinds of token a code listing is coloured by (#624): what the
|
|
1531
|
+
* built-in tokenizer and a registered highlighter
|
|
1532
|
+
* (`registerCodeHighlighter`) name, and what `codeStyle.tokens` colours.
|
|
1533
|
+
* `prompt` and `output` are a shell session's (`console`): the prompt and
|
|
1534
|
+
* what the program prints. */
|
|
1535
|
+
export type CodeTokenKind = 'keyword' | 'string' | 'number' | 'comment' | 'function' | 'type' | 'operator' | 'punctuation' | 'variable' | 'meta' | 'prompt' | 'output';
|
|
1536
|
+
/** How a code line wider than its box is set (#624): `'wrap'` turns it
|
|
1537
|
+
* over, `'shrink'` sets the whole listing smaller, `'clip'` cuts it at the
|
|
1538
|
+
* box's inner edge. */
|
|
1539
|
+
export type CodeOverflow = 'wrap' | 'shrink' | 'clip';
|
|
1540
|
+
/** The look of one kind of token. Unset fields keep the listing's own. */
|
|
1541
|
+
export interface CodeTokenStyle {
|
|
1542
|
+
color?: ColorValue;
|
|
1543
|
+
bold?: boolean;
|
|
1544
|
+
italic?: boolean;
|
|
1545
|
+
}
|
|
1546
|
+
/** Inline code (`` `x` ``) set in a code face (#624). The span is set as
|
|
1547
|
+
* one unit, as a chip is: it never breaks across lines. */
|
|
1548
|
+
export interface InlineCodeStyleConfig {
|
|
1549
|
+
/** Default: `codeStyle.fontFamily`. */
|
|
1550
|
+
fontFamily?: string;
|
|
1551
|
+
/** Size; `em` is the surrounding text's. Default `0.9em`. */
|
|
1552
|
+
fontSize?: Dimension;
|
|
1553
|
+
/** Default: the surrounding text's colour. */
|
|
1554
|
+
color?: ColorValue;
|
|
1555
|
+
bold?: boolean;
|
|
1556
|
+
italic?: boolean;
|
|
1557
|
+
/** A fill behind the span. Default none. */
|
|
1558
|
+
background?: ColorValue;
|
|
1559
|
+
/** Outline colour. Default none. */
|
|
1560
|
+
borderColor?: ColorValue;
|
|
1561
|
+
/** Outline width. Default `0.5pt` when a border colour is set. */
|
|
1562
|
+
borderWidth?: Dimension;
|
|
1563
|
+
/** Corner radius; `em` is the span's size. Default `0.2em`. */
|
|
1564
|
+
borderRadius?: Dimension;
|
|
1565
|
+
/** Room left and right of the text inside the fill; `em` is the span's
|
|
1566
|
+
* size. Default `0.2em` with a fill or a border, `0` without. */
|
|
1567
|
+
paddingX?: Dimension;
|
|
1568
|
+
/** Room above and below the text band; paints outside the line box.
|
|
1569
|
+
* Default `0.1em`. */
|
|
1570
|
+
paddingY?: Dimension;
|
|
1571
|
+
}
|
|
1572
|
+
/** Code listings (#624): ```` ``` ```` and `~~~` fences, and indented code
|
|
1573
|
+
* behind {@link indentedCode}, set line by line in a box. */
|
|
1574
|
+
export interface CodeStyleConfig {
|
|
1575
|
+
/** Read fences as code blocks. Default `true`; `false` reads a fence's
|
|
1576
|
+
* lines as Markdown, as postext 1.22 did (stored documents written
|
|
1577
|
+
* before #624 get it, see `pinLegacyCodeBlocks`). */
|
|
1578
|
+
blocks?: boolean;
|
|
1579
|
+
/** Read a run of lines indented by four spaces (or a tab) after a blank
|
|
1580
|
+
* line as a code block. Default `false`: Postext text often indents
|
|
1581
|
+
* with spaces, and nested lists read leading spaces. */
|
|
1582
|
+
indentedCode?: boolean;
|
|
1583
|
+
/** Default `'Source Code Pro'`. */
|
|
1584
|
+
fontFamily?: string;
|
|
1585
|
+
/** `em` is the body's size. Default `0.85em`. */
|
|
1586
|
+
fontSize?: Dimension;
|
|
1587
|
+
fontWeight?: number;
|
|
1588
|
+
/** Weight of bold tokens. Default `700`. */
|
|
1589
|
+
boldFontWeight?: number;
|
|
1590
|
+
/** Leading of the code lines; `em` is the code's size. Default: the
|
|
1591
|
+
* body's baseline grid line. */
|
|
1592
|
+
lineHeight?: Dimension;
|
|
1593
|
+
/** The text after a listing goes back to the baseline grid. Default
|
|
1594
|
+
* `true`; `false` keeps the exact `marginBottom`. */
|
|
1595
|
+
snapToGrid?: boolean;
|
|
1596
|
+
/** Default: the body text colour. */
|
|
1597
|
+
color?: ColorValue;
|
|
1598
|
+
/** Default `true`. */
|
|
1599
|
+
backgroundEnabled?: boolean;
|
|
1600
|
+
/** Default `#f4f4f4`. */
|
|
1601
|
+
background?: ColorValue;
|
|
1602
|
+
/** Default `0.6em` on every side. */
|
|
1603
|
+
padding?: CalloutPaddingConfig;
|
|
1604
|
+
/** Default off, `#cccccc`, `0.5pt`. */
|
|
1605
|
+
border?: CalloutBorderConfig;
|
|
1606
|
+
/** Default `0`. */
|
|
1607
|
+
borderRadius?: Dimension;
|
|
1608
|
+
/** Default `0.75em`. */
|
|
1609
|
+
marginTop?: Dimension;
|
|
1610
|
+
/** Default `0.75em`. */
|
|
1611
|
+
marginBottom?: Dimension;
|
|
1612
|
+
/** Default `'column'`; a fence sets its own with `span=page`. */
|
|
1613
|
+
span?: 'column' | 'page';
|
|
1614
|
+
/** Columns a tab advances to. Default `4`. */
|
|
1615
|
+
tabSize?: number;
|
|
1616
|
+
/** Default `'wrap'`. */
|
|
1617
|
+
overflow?: CodeOverflow;
|
|
1618
|
+
/** Indent of a wrapped line's continuations, in character cells.
|
|
1619
|
+
* Default `2`. */
|
|
1620
|
+
wrapIndent?: number;
|
|
1621
|
+
/** Set in the indent of a continuation line. Default `'»'` (a mark
|
|
1622
|
+
* every Latin face carries; `'↪'` is missing from most code faces);
|
|
1623
|
+
* `''` sets none. */
|
|
1624
|
+
wrapMarker?: string;
|
|
1625
|
+
/** `'shrink'`: the smallest size the listing is set at, as a share of
|
|
1626
|
+
* `fontSize`; past it the lines wrap. Default `0.8`. */
|
|
1627
|
+
minFontScale?: number;
|
|
1628
|
+
/** Number the lines of every listing. Default `false`; a fence sets its
|
|
1629
|
+
* own with `lineNumbers` / `lineNumbers=false` and `start=N`. */
|
|
1630
|
+
lineNumbers?: boolean;
|
|
1631
|
+
/** Default `#8a8a8a`. */
|
|
1632
|
+
lineNumberColor?: ColorValue;
|
|
1633
|
+
/** Room between the numbers and the code; `em` is the code's size.
|
|
1634
|
+
* Default `1em`. */
|
|
1635
|
+
lineNumberGap?: Dimension;
|
|
1636
|
+
/** The tint behind the lines a fence's `highlight="3,5-7"` names.
|
|
1637
|
+
* Default `#fff4c2`. */
|
|
1638
|
+
highlightBackground?: ColorValue;
|
|
1639
|
+
/** Default `false`: a listing splits between lines across columns and
|
|
1640
|
+
* pages. */
|
|
1641
|
+
keepTogether?: boolean;
|
|
1642
|
+
/** Fewest lines on each side of a split. Default `2`. */
|
|
1643
|
+
splitMinLines?: number;
|
|
1644
|
+
/** Repeat the title on each continuation. Default `false`. */
|
|
1645
|
+
repeatTitle?: boolean;
|
|
1646
|
+
/** Mark a part that goes on ("Continued"). Default `false`. */
|
|
1647
|
+
continuesMarkerEnabled?: boolean;
|
|
1648
|
+
/** Default `"Continued"` in the document language. */
|
|
1649
|
+
continuesMarker?: string;
|
|
1650
|
+
/** The title row a fence's `title` prints. Default: the code face at
|
|
1651
|
+
* 0.85 of the code size, bold. */
|
|
1652
|
+
titleStyle?: CalloutTitleStyleConfig;
|
|
1653
|
+
/** When set, the fence's `title` prints in a label tab on the box's top
|
|
1654
|
+
* edge (a callout label) instead of a title row. */
|
|
1655
|
+
label?: CalloutLabelConfig;
|
|
1656
|
+
/** Default `'builtin'`: the built-in tokenizer colours `js`/`ts`,
|
|
1657
|
+
* `json`, `python`, `bash`/`sh`/`zsh`, `console`, `css`, `html`/`xml`,
|
|
1658
|
+
* `markdown` and `sql`; a registered highlighter takes precedence.
|
|
1659
|
+
* `'none'` sets every listing plain. */
|
|
1660
|
+
highlight?: 'builtin' | 'none';
|
|
1661
|
+
/** The look of each kind of token. Defaults: a muted palette (see
|
|
1662
|
+
* `DEFAULT_CODE_TOKENS`). */
|
|
1663
|
+
tokens?: Partial<Record<CodeTokenKind, CodeTokenStyle>>;
|
|
1664
|
+
/** Inline code in a code face. Unset: inline code is set in the body
|
|
1665
|
+
* face, as before #624. */
|
|
1666
|
+
inline?: InlineCodeStyleConfig;
|
|
1667
|
+
}
|
|
1668
|
+
export interface ResolvedInlineCodeStyleConfig {
|
|
1669
|
+
fontFamily: string;
|
|
1670
|
+
fontSize: Dimension;
|
|
1671
|
+
color?: ColorValue;
|
|
1672
|
+
bold: boolean;
|
|
1673
|
+
italic: boolean;
|
|
1674
|
+
background?: ColorValue;
|
|
1675
|
+
borderColor?: ColorValue;
|
|
1676
|
+
borderWidth: Dimension;
|
|
1677
|
+
borderRadius: Dimension;
|
|
1678
|
+
paddingX: Dimension;
|
|
1679
|
+
paddingY: Dimension;
|
|
1680
|
+
}
|
|
1681
|
+
export interface ResolvedCodeStyleConfig {
|
|
1682
|
+
blocks: boolean;
|
|
1683
|
+
indentedCode: boolean;
|
|
1684
|
+
fontFamily: string;
|
|
1685
|
+
fontSize: Dimension;
|
|
1686
|
+
fontWeight: number;
|
|
1687
|
+
boldFontWeight: number;
|
|
1688
|
+
/** Absent: the body's baseline grid line. */
|
|
1689
|
+
lineHeight?: Dimension;
|
|
1690
|
+
snapToGrid: boolean;
|
|
1691
|
+
color: ColorValue;
|
|
1692
|
+
backgroundEnabled: boolean;
|
|
1693
|
+
background: ColorValue;
|
|
1694
|
+
padding: {
|
|
1695
|
+
top: Dimension;
|
|
1696
|
+
right: Dimension;
|
|
1697
|
+
bottom: Dimension;
|
|
1698
|
+
left: Dimension;
|
|
1699
|
+
};
|
|
1700
|
+
border: {
|
|
1701
|
+
enabled: boolean;
|
|
1702
|
+
color: ColorValue;
|
|
1703
|
+
width: Dimension;
|
|
1704
|
+
};
|
|
1705
|
+
borderRadius: Dimension;
|
|
1706
|
+
marginTop: Dimension;
|
|
1707
|
+
marginBottom: Dimension;
|
|
1708
|
+
span: 'column' | 'page';
|
|
1709
|
+
tabSize: number;
|
|
1710
|
+
overflow: CodeOverflow;
|
|
1711
|
+
wrapIndent: number;
|
|
1712
|
+
wrapMarker: string;
|
|
1713
|
+
minFontScale: number;
|
|
1714
|
+
lineNumbers: boolean;
|
|
1715
|
+
lineNumberColor: ColorValue;
|
|
1716
|
+
lineNumberGap: Dimension;
|
|
1717
|
+
highlightBackground: ColorValue;
|
|
1718
|
+
keepTogether: boolean;
|
|
1719
|
+
splitMinLines: number;
|
|
1720
|
+
repeatTitle: boolean;
|
|
1721
|
+
continuesMarkerEnabled: boolean;
|
|
1722
|
+
/** Absent: the document language's. */
|
|
1723
|
+
continuesMarker?: string;
|
|
1724
|
+
/** As written; absent: the default title row. */
|
|
1725
|
+
titleStyle?: CalloutTitleStyleConfig;
|
|
1726
|
+
/** As written; absent: no label tab. */
|
|
1727
|
+
label?: CalloutLabelConfig;
|
|
1728
|
+
highlight: 'builtin' | 'none';
|
|
1729
|
+
tokens: Record<CodeTokenKind, {
|
|
1730
|
+
color?: ColorValue;
|
|
1731
|
+
bold: boolean;
|
|
1732
|
+
italic: boolean;
|
|
1733
|
+
}>;
|
|
1734
|
+
/** Absent: inline code in the body face. */
|
|
1735
|
+
inline?: ResolvedInlineCodeStyleConfig;
|
|
1736
|
+
}
|
|
1360
1737
|
export interface ResolvedBlockquoteConfig {
|
|
1361
1738
|
color: ColorValue;
|
|
1362
1739
|
italic: boolean;
|
|
@@ -1400,8 +1777,14 @@ export interface ResolvedBodyTextConfig {
|
|
|
1400
1777
|
optimalRagged: boolean;
|
|
1401
1778
|
breakAfterDashes: boolean;
|
|
1402
1779
|
breakAfterHyphens: boolean;
|
|
1780
|
+
hardLineBreaks: boolean;
|
|
1781
|
+
/** Absent when unset (see {@link BodyTextConfig.tabStops}). */
|
|
1782
|
+
tabStops?: TabStop[];
|
|
1783
|
+
/** Absent when unset (see {@link BodyTextConfig.tabInterval}). */
|
|
1784
|
+
tabInterval?: Dimension;
|
|
1403
1785
|
repeatHyphen: boolean;
|
|
1404
1786
|
blockquote: ResolvedBlockquoteConfig;
|
|
1787
|
+
verse: ResolvedVerseConfig;
|
|
1405
1788
|
avoidOrphans: boolean;
|
|
1406
1789
|
orphanMinLines: number;
|
|
1407
1790
|
orphanPenalty: number;
|
|
@@ -1768,6 +2151,86 @@ export interface ResolvedVideoStyleConfig {
|
|
|
1768
2151
|
* optional and inherits the body text when unset, so a style only needs to
|
|
1769
2152
|
* spell out what differs from running text. See
|
|
1770
2153
|
* {@link ResolvedParagraphStyleConfig}. */
|
|
2154
|
+
/** How a drop cap treats an opening quote, `¿`, `¡` or bracket before
|
|
2155
|
+
* the letter (#623; see {@link ParagraphDropCap.punctuation}). */
|
|
2156
|
+
export type DropCapPunctuation = 'with-cap' | 'hang' | 'text';
|
|
2157
|
+
/** What a drop cap does in a paragraph of fewer lines than it sinks
|
|
2158
|
+
* (#623; see {@link ParagraphDropCap.shortParagraph}). */
|
|
2159
|
+
export type DropCapShortParagraph = 'reserve' | 'shrink' | 'skip';
|
|
2160
|
+
/** The first words after a drop cap set in small capitals or capitals
|
|
2161
|
+
* (#623; see {@link ParagraphDropCap.leadIn}). */
|
|
2162
|
+
export interface DropCapLeadIn {
|
|
2163
|
+
/** How many words, or `'line'` for the whole first line. */
|
|
2164
|
+
words?: number | 'line';
|
|
2165
|
+
/** Small capitals (as `:smallcaps[…]`). Default `true` unless
|
|
2166
|
+
* {@link uppercase} is set. */
|
|
2167
|
+
smallCaps?: boolean;
|
|
2168
|
+
/** Capitals. Default `false`. */
|
|
2169
|
+
uppercase?: boolean;
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* A drop cap (or a raised initial) opening a body paragraph (#623): the
|
|
2173
|
+
* first letter set large at the start of the paragraph, its first
|
|
2174
|
+
* {@link sink} lines shortened around it on the start side (the left in
|
|
2175
|
+
* Latin text, the right in Arabic and Hebrew). The paragraph is broken,
|
|
2176
|
+
* justified and hyphenated as any other, and it never breaks before its
|
|
2177
|
+
* line {@link sink}, so the letter keeps its lines across columns and
|
|
2178
|
+
* pages. Set by a paragraph style (the first paragraph of a
|
|
2179
|
+
* `:::paragraphs{style=…}` group, or every one with {@link each}) or a
|
|
2180
|
+
* heading level or style (the first body paragraph after the heading);
|
|
2181
|
+
* `{dropcap}`, `{dropcap=false}` and `{dropcap=N}` on the group's fence or
|
|
2182
|
+
* the heading line switch it on, off or set its lines.
|
|
2183
|
+
*/
|
|
2184
|
+
export interface ParagraphDropCap {
|
|
2185
|
+
/** Lines the initial spans, from the top of its capitals to its
|
|
2186
|
+
* baseline. Default `3`; `1` with a larger {@link fontSize} is a raised
|
|
2187
|
+
* initial standing on the first baseline. */
|
|
2188
|
+
lines?: number;
|
|
2189
|
+
/** Lines the initial drops into the text: it stands on the baseline of
|
|
2190
|
+
* line `sink`, and those lines are shortened. Fewer than {@link lines}
|
|
2191
|
+
* raises the initial above the first line, and the paragraph keeps that
|
|
2192
|
+
* rise clear above it (whole grid lines). Default {@link lines} (a true
|
|
2193
|
+
* drop cap). */
|
|
2194
|
+
sink?: number;
|
|
2195
|
+
/** Grapheme clusters set large: `É`, a letter with a combining mark, a
|
|
2196
|
+
* surrogate pair each count one. Default `1`. */
|
|
2197
|
+
characters?: number;
|
|
2198
|
+
/** Face of the initial. Default the paragraph's. */
|
|
2199
|
+
fontFamily?: string;
|
|
2200
|
+
/** Default the paragraph's weight. */
|
|
2201
|
+
fontWeight?: number;
|
|
2202
|
+
/** Default `false`. */
|
|
2203
|
+
italic?: boolean;
|
|
2204
|
+
/** Size of the initial. Default: the size that sets the top of its
|
|
2205
|
+
* capitals level with the capitals of the first line while it stands
|
|
2206
|
+
* {@link lines} lines down, both cap heights measured from the faces
|
|
2207
|
+
* (0.72 of the size when a face gives none). */
|
|
2208
|
+
fontSize?: Dimension;
|
|
2209
|
+
/** Default the paragraph's colour; a palette-linked colour follows part
|
|
2210
|
+
* and section palettes. */
|
|
2211
|
+
color?: ColorValue;
|
|
2212
|
+
/** Space between the initial and the shortened lines. Default `0.15em`
|
|
2213
|
+
* of the text size. */
|
|
2214
|
+
gap?: Dimension;
|
|
2215
|
+
/** An opening quote, `¿`, `¡` or bracket before the letter:
|
|
2216
|
+
* `'with-cap'` sets it at the initial's size as part of it, `'hang'`
|
|
2217
|
+
* at text size outside the measure before the initial, `'text'` at text
|
|
2218
|
+
* size at the start of the first line, after the initial. Default
|
|
2219
|
+
* `'with-cap'`. */
|
|
2220
|
+
punctuation?: DropCapPunctuation;
|
|
2221
|
+
/** The first words after the initial in small capitals or capitals. */
|
|
2222
|
+
leadIn?: DropCapLeadIn;
|
|
2223
|
+
/** A paragraph of fewer lines than {@link sink}: `'reserve'` keeps the
|
|
2224
|
+
* block {@link sink} lines tall so the next block clears the initial,
|
|
2225
|
+
* `'shrink'` sets the initial over the paragraph's own lines, `'skip'`
|
|
2226
|
+
* sets the paragraph without one. A content warning says so in each
|
|
2227
|
+
* case. Default `'reserve'`. */
|
|
2228
|
+
shortParagraph?: DropCapShortParagraph;
|
|
2229
|
+
/** A paragraph style's drop cap opens every paragraph of its group (a
|
|
2230
|
+
* catalogue of entries), not the first only. Read on paragraph styles
|
|
2231
|
+
* alone. Default `false`. */
|
|
2232
|
+
each?: boolean;
|
|
2233
|
+
}
|
|
1771
2234
|
export interface ParagraphStyleConfig {
|
|
1772
2235
|
/** Identifier referenced from `:::paragraphs{style="…"}`. */
|
|
1773
2236
|
id: string;
|
|
@@ -1822,12 +2285,19 @@ export interface ParagraphStyleConfig {
|
|
|
1822
2285
|
* N字上げ) is `textAlign: 'end'` with `endIndent: 'Nem'`; 地付き is the
|
|
1823
2286
|
* same at `0`. Default `0`; a negative value counts as `0`. */
|
|
1824
2287
|
endIndent?: Dimension;
|
|
1825
|
-
/**
|
|
1826
|
-
* {@link hangingIndent}
|
|
2288
|
+
/** Indent of the first line, from {@link indent}. Defaults to the body
|
|
2289
|
+
* first-line indent. With a non-zero {@link hangingIndent} it applies
|
|
2290
|
+
* only when the style sets it itself: the first line starts at
|
|
2291
|
+
* `indent + firstLineIndent` and its turnovers at `indent +
|
|
2292
|
+
* hangingIndent` (a line of verse indented one em that hangs its
|
|
2293
|
+
* turnover three, #620); inherited from the body it gives way, and the
|
|
2294
|
+
* first line starts at `indent`. */
|
|
1827
2295
|
firstLineIndent?: Dimension;
|
|
1828
2296
|
/** Indent applied to every line except the first (bibliographies,
|
|
1829
|
-
* glossaries), from {@link indent}.
|
|
1830
|
-
* {@link
|
|
2297
|
+
* glossaries, the turnover of a line of verse), from {@link indent}.
|
|
2298
|
+
* The first line starts at {@link indent}, or at `indent +
|
|
2299
|
+
* firstLineIndent` when the style sets {@link firstLineIndent} itself.
|
|
2300
|
+
* Default `0`. */
|
|
1831
2301
|
hangingIndent?: Dimension;
|
|
1832
2302
|
/** Vertical gap between consecutive paragraphs in the container. Default
|
|
1833
2303
|
* `0` — entries abut, off the baseline grid until the container closes. */
|
|
@@ -1857,6 +2327,53 @@ export interface ParagraphStyleConfig {
|
|
|
1857
2327
|
* punctuation (phrase-spaced kana text, 分かち書き), `'normal'` between
|
|
1858
2328
|
* any two characters. Unset: the document's `cjk.wordBreak`. */
|
|
1859
2329
|
wordBreak?: CjkWordBreak;
|
|
2330
|
+
/** Whether line numbers (`lineNumbers`, #621) count the lines of the
|
|
2331
|
+
* style's paragraphs. Unset: counted when `lineNumbers.count` is
|
|
2332
|
+
* `'all'` (or, in a poem set in the style, when it counts verse);
|
|
2333
|
+
* `true` counts them under `'verse'` too, and inside a callout, whose
|
|
2334
|
+
* text is otherwise never counted; `false` never. */
|
|
2335
|
+
lineNumbers?: boolean;
|
|
2336
|
+
/** Tab stops of the style's paragraphs (#622; see {@link TabStop}). A
|
|
2337
|
+
* tab character in their text is then a tab, and `:tab` goes to them.
|
|
2338
|
+
* Unset: the body's (`bodyText.tabStops`). An empty list sets none. */
|
|
2339
|
+
tabStops?: TabStop[];
|
|
2340
|
+
/** Default stops past the last of {@link tabStops}. Unset: the body's. */
|
|
2341
|
+
tabInterval?: Dimension;
|
|
2342
|
+
/** A drop cap opening the first paragraph of each `:::paragraphs` group
|
|
2343
|
+
* in the style (#623; every paragraph with `each: true`). Unset: none. */
|
|
2344
|
+
dropCap?: ParagraphDropCap;
|
|
2345
|
+
}
|
|
2346
|
+
/** Where a tab stop stands (#622): a length from the start edge of the
|
|
2347
|
+
* paragraph's measure (after a paragraph style's `indent`; `em` being the
|
|
2348
|
+
* paragraph's own size), `'end'` for the measure's end edge, or a share of
|
|
2349
|
+
* the measure (`'50%'`). */
|
|
2350
|
+
export type TabStopPosition = Dimension | 'end' | `${number}%`;
|
|
2351
|
+
/** How the text after a tab sits at its stop (#622): `'start'` starts
|
|
2352
|
+
* there, `'end'` ends there, `'center'` is centred on it and `'decimal'`
|
|
2353
|
+
* puts its decimal separator on it (a run with none ends there). */
|
|
2354
|
+
export type TabStopAlign = 'start' | 'end' | 'center' | 'decimal';
|
|
2355
|
+
/**
|
|
2356
|
+
* A tab stop of body text (#622): a menu's prices flush right, a cast
|
|
2357
|
+
* list's actors after a dot leader, an exam's marks at the margin. A tab
|
|
2358
|
+
* goes to the first stop past the text before it; a line holding a tab is
|
|
2359
|
+
* set by the line-by-line breaker (never Knuth–Plass), and in justified
|
|
2360
|
+
* text only its word spaces after the last tab take the slack.
|
|
2361
|
+
*/
|
|
2362
|
+
export interface TabStop {
|
|
2363
|
+
position: TabStopPosition;
|
|
2364
|
+
/** Default `'start'`. */
|
|
2365
|
+
align?: TabStopAlign;
|
|
2366
|
+
/** Repeated over the room before the stop, flush with its end so the
|
|
2367
|
+
* leaders of several lines line up: `'.'`, `'. '`, `'·'`, `'_'`, `'-'`
|
|
2368
|
+
* or any short text in the paragraph's face; `'rule'` draws a line on
|
|
2369
|
+
* the baseline (a form's blank). Default none. */
|
|
2370
|
+
leader?: string;
|
|
2371
|
+
/** Room kept between the text and the leader, and between the leader and
|
|
2372
|
+
* the text at the stop. Default `0.5em` (the contents' `leader.gap`). */
|
|
2373
|
+
leaderGap?: Dimension;
|
|
2374
|
+
/** `'decimal'` stops: the separator. Default the document language's
|
|
2375
|
+
* (`.` in English, `,` in Spanish, Catalan, Portuguese…). */
|
|
2376
|
+
decimalChar?: string;
|
|
1860
2377
|
}
|
|
1861
2378
|
export type ParagraphTextTransform = 'none' | 'uppercase';
|
|
1862
2379
|
export interface ResolvedParagraphStyleConfig {
|
|
@@ -1875,10 +2392,17 @@ export interface ResolvedParagraphStyleConfig {
|
|
|
1875
2392
|
italic: boolean;
|
|
1876
2393
|
smallCaps: boolean;
|
|
1877
2394
|
hyphenation: boolean;
|
|
2395
|
+
/** The style sets {@link hyphenation} itself: a poem in the style
|
|
2396
|
+
* hyphenates its turnovers only then (#620). Absent when inherited. */
|
|
2397
|
+
ownHyphenation?: true;
|
|
1878
2398
|
indent: Dimension;
|
|
1879
2399
|
/** Absent when the style sets none (or `0`). */
|
|
1880
2400
|
endIndent?: Dimension;
|
|
1881
2401
|
firstLineIndent: Dimension;
|
|
2402
|
+
/** The style sets {@link firstLineIndent} itself (it is not the body's):
|
|
2403
|
+
* with a non-zero {@link hangingIndent} the two pair up (#620). Absent
|
|
2404
|
+
* when inherited. */
|
|
2405
|
+
ownFirstLineIndent?: true;
|
|
1882
2406
|
hangingIndent: Dimension;
|
|
1883
2407
|
spaceBetween: Dimension;
|
|
1884
2408
|
marginTop: Dimension;
|
|
@@ -1887,6 +2411,15 @@ export interface ResolvedParagraphStyleConfig {
|
|
|
1887
2411
|
textTransform: ParagraphTextTransform;
|
|
1888
2412
|
/** Absent when the style sets none (the document's `cjk.wordBreak`). */
|
|
1889
2413
|
wordBreak?: CjkWordBreak;
|
|
2414
|
+
/** Absent when the style sets none (see
|
|
2415
|
+
* {@link ParagraphStyleConfig.lineNumbers}). */
|
|
2416
|
+
lineNumbers?: boolean;
|
|
2417
|
+
/** Absent when the style sets none: its paragraphs take the body's. */
|
|
2418
|
+
tabStops?: TabStop[];
|
|
2419
|
+
/** Absent when the style sets none. */
|
|
2420
|
+
tabInterval?: Dimension;
|
|
2421
|
+
/** Absent when the style sets none (#623). */
|
|
2422
|
+
dropCap?: ParagraphDropCap;
|
|
1890
2423
|
}
|
|
1891
2424
|
/** Horizontal extent of a callout: its column, or the full content width. */
|
|
1892
2425
|
/** `'side'` sets the box in the float-only side column of a `oneAndHalf`
|
|
@@ -2108,6 +2641,11 @@ export interface CalloutBodyStyleConfig {
|
|
|
2108
2641
|
hyphenation?: boolean;
|
|
2109
2642
|
paragraphSpacing?: boolean;
|
|
2110
2643
|
firstLineIndent?: Dimension;
|
|
2644
|
+
/** Tab stops of the box's paragraphs and list items (#622). Unset: the
|
|
2645
|
+
* body's (`bodyText.tabStops`). */
|
|
2646
|
+
tabStops?: TabStop[];
|
|
2647
|
+
/** Default stops past the last of {@link tabStops}. Unset: the body's. */
|
|
2648
|
+
tabInterval?: Dimension;
|
|
2111
2649
|
}
|
|
2112
2650
|
/** List typography inside the callout. Every field inherits
|
|
2113
2651
|
* `unorderedLists` (`color`, `indent`, `gap`, `itemSpacing` also apply to
|
|
@@ -2429,6 +2967,9 @@ export interface ResolvedCalloutStyleConfig {
|
|
|
2429
2967
|
hyphenation: boolean;
|
|
2430
2968
|
paragraphSpacing: boolean;
|
|
2431
2969
|
firstLineIndent: Dimension;
|
|
2970
|
+
/** Absent when the style sets none. */
|
|
2971
|
+
tabStops?: TabStop[];
|
|
2972
|
+
tabInterval?: Dimension;
|
|
2432
2973
|
};
|
|
2433
2974
|
lists: {
|
|
2434
2975
|
bulletChar: string;
|
|
@@ -2724,6 +3265,12 @@ export interface HeadingLevelConfig {
|
|
|
2724
3265
|
* `{jidori=N}` (`{jidori=0}` turns it off). Unset (default): no
|
|
2725
3266
|
* spacing. */
|
|
2726
3267
|
jidori?: number;
|
|
3268
|
+
/** A drop cap opening the first body paragraph after a heading of this
|
|
3269
|
+
* level or style (#623), found past markers, boxes that left the flow
|
|
3270
|
+
* and floated figures; never a paragraph inside a box. A heading turns
|
|
3271
|
+
* it off with `{dropcap=false}` or sets its lines with `{dropcap=N}`; a
|
|
3272
|
+
* heading style turns its level's off with `false`. Unset: none. */
|
|
3273
|
+
dropCap?: ParagraphDropCap | false;
|
|
2727
3274
|
}
|
|
2728
3275
|
export type HeadingTextTransform = 'none' | 'uppercase';
|
|
2729
3276
|
export interface ResolvedHeadingLevelConfig {
|
|
@@ -2762,6 +3309,9 @@ export interface ResolvedHeadingLevelConfig {
|
|
|
2762
3309
|
indent?: Dimension;
|
|
2763
3310
|
/** Absent unless set (see {@link HeadingLevelConfig.jidori}). */
|
|
2764
3311
|
jidori?: number;
|
|
3312
|
+
/** Absent unless set (see {@link HeadingLevelConfig.dropCap}); a heading
|
|
3313
|
+
* style's `false` lays an explicit `undefined` over its level's. */
|
|
3314
|
+
dropCap?: ParagraphDropCap;
|
|
2765
3315
|
}
|
|
2766
3316
|
export interface HeadingsConfig {
|
|
2767
3317
|
fontFamily?: string;
|
|
@@ -5599,6 +6149,12 @@ export interface PostextConfig {
|
|
|
5599
6149
|
/** East Asian typography: line breaking and justification of Chinese,
|
|
5600
6150
|
* Japanese and Korean text (see {@link CjkConfig}). */
|
|
5601
6151
|
cjk?: CjkConfig;
|
|
6152
|
+
/** Line numbers in the margin, for verse or for every line of the text
|
|
6153
|
+
* (#621). Off by default. */
|
|
6154
|
+
lineNumbers?: LineNumbersConfig;
|
|
6155
|
+
/** Code listings (fenced and indented code blocks) and inline code
|
|
6156
|
+
* (#624). */
|
|
6157
|
+
codeStyle?: CodeStyleConfig;
|
|
5602
6158
|
header?: HeaderFooterSlot;
|
|
5603
6159
|
footer?: HeaderFooterSlot;
|
|
5604
6160
|
/** Document language, a BCP 47 tag (see {@link LocaleTag}). The fallback
|