JavaScript API
Exported members
Functions
buildcreatecreateBuiltinCmykConversioncreateBuiltinCmykConversionReplacementcreateBuiltinGrayConversioncreateBuiltinGrayConversionReplacementcreateBuiltinRgbConversionReplacementcreateIccConversioncreateIccConversionReplacementcreateThemecreateVitePlugindefineConfigpreviewvalidateThemeVFM
Interfaces
Type Aliases
Variables
Functions
build()
build(
options):Promise<void>
Build publication file(s) from the given configuration.
import { build } from '@vivliostyle/cli';
build({
configPath: './vivliostyle.config.js',
logLevel: 'silent',
});
Parameters
options
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<void>
create()
create(
options):Promise<void>
Scaffold a new Vivliostyle project.
Parameters
options
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<void>
createBuiltinCmykConversion()
createBuiltinCmykConversion(
options?):CmykConversion
Creates a conversion for cmyk.fallback that converts RGB colors to CMYK using MuPDF's DeviceCMYK color space.
Parameters
options?
Returns
createBuiltinCmykConversionReplacement()
createBuiltinCmykConversionReplacement(
options?):ImageConversionReplacement
Creates a replacement that converts images to DeviceCMYK.
Parameters
options?
Returns
createBuiltinGrayConversion()
createBuiltinGrayConversion(
options?):CmykConversion
Creates a conversion for cmyk.fallback that converts RGB colors to grayscale and maps the result to the K channel.
Parameters
options?
Returns
createBuiltinGrayConversionReplacement()
createBuiltinGrayConversionReplacement(
options?):ImageConversionReplacement
Creates a replacement that converts images to DeviceGray.
Parameters
options?
Returns
createBuiltinRgbConversionReplacement()
createBuiltinRgbConversionReplacement(
options?):ImageConversionReplacement
Creates a replacement that converts images to DeviceRGB.
Parameters
options?
Returns
createIccConversion()
createIccConversion(
options):CmykConversion
Creates a conversion for cmyk.fallback that converts RGB colors through an ICC profile. CMYK profiles return all four channels; grayscale profiles map to the K channel.
Parameters
options
Returns
createIccConversionReplacement()
createIccConversionReplacement(
options):ImageConversionReplacement
Creates a replacement that converts images using a destination ICC profile and returns an image in the corresponding Device color space.
Parameters
options
Returns
createTheme()
createTheme(
options):Promise<void>
Scaffold a new Vivliostyle theme package.
Parameters
options
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<void>
createVitePlugin()
createVitePlugin(
inlineConfig?):Promise<Plugin<any>[]>
Parameters
inlineConfig?
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<Plugin<any>[]>
defineConfig()
defineConfig(
config):VivliostyleConfigSchema
Define the configuration for Vivliostyle CLI.
Parameters
config
Returns
preview()
preview(
options):Promise<ViteDevServer>
Open a browser for previewing the publication.
Parameters
options
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<ViteDevServer>
validateTheme()
validateTheme(
options):Promise<ThemeValidationResult[]>
Validate a Vivliostyle theme package.
Parameters
options
author?
string = ...
bleed?
string = ...
browser?
string = ...
category?
"novel" | "magazine" | "journal" | "report" | "misc" = ...
cmyk?
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } = CmykSchema
config?
string = ...
configData?
VivliostyleConfigSchema | null = ...
createConfigFileOnly?
boolean = ...
cropMarks?
boolean = ...
cropOffset?
string = ...
css?
string = ...
cwd?
string = ...
description?
string = ...
disableServerStartup?
boolean = ...
enableStaticServe?
boolean = ...
enableViewerStartPage?
boolean = ...
executableBrowser?
string = ...
host?
string | boolean = ...
ignoreHttpsErrors?
boolean = ...
image?
string = ...
input?
string = ...
installDependencies?
boolean = ...
language?
string = ...
license?
string = ...
logger?
LoggerInterface = ...
logLevel?
"silent" | "info" | "verbose" | "debug" = ...
name?
string = ...
openViewer?
boolean = ...
output?
string | object & object | (string | object & object)[] = ...
port?
number = ...
preflight?
"press-ready" | "press-ready-local" = ...
preflightOption?
string | string[] = ...
pressReady?
boolean = ...
projectPath?
string = ...
proxyBypass?
string = ...
proxyPass?
string = ...
proxyServer?
string = ...
proxyUser?
string = ...
quick?
boolean = ...
readingProgression?
"ltr" | "rtl" = ...
renderMode?
"local" | "docker" = ...
sandbox?
boolean = ...
signal?
AbortSignal = ...
singleDoc?
boolean = ...
size?
string = ...
stderr?
Writable = ...
stdin?
Readable = ...
stdout?
Writable = ...
style?
string = ...
template?
string = ...
theme?
string | false | object & object | (string | object & object)[] = ...
themePath?
string = ...
timeout?
number = ...
title?
string = ...
userStyle?
string = ...
viewer?
string = ...
viewerParam?
string = ...
vite?
UserConfig = ...
viteConfigFile?
string | boolean = ...
Returns
Promise<ThemeValidationResult[]>
Validation results. The package is valid if no result has the type error.
VFM()
VFM(
options?,metadata?):Processor
Create Unified processor for Markdown AST and Hypertext AST.
Parameters
options?
Options.
metadata?
Returns
Processor
Unified processor.
Interfaces
CMYKValue
Properties
| Property | Type |
|---|---|
c |
number |
k |
number |
m |
number |
y |
number |
ColorConversionOptions
Options shared by color conversions and image conversion replacements.
Extended by
Properties
IccConversionOptions
Options for conversion using a caller-provided destination ICC profile.
Extends
Properties
ReplaceFunctionContext
Values available while a replacement function is running.
Properties
StringifyMarkdownOptions
Option for convert Markdown to a stringify (HTML).
Declared as interface so that downstream consumers (e.g.
vivliostyle-cli) see a stable nominal name instead of
v.InferInput<typeof StringifyMarkdownOptionsSchema>. The latter form
causes TypeScript to expand the schema's structural shape during
declaration emit and pulls non-portable .pnpm/... paths through pnpm
isolated installs (TS2742). The compile-time check below pins this
interface to the schema, so a drift in either direction is rejected.
Extends
InferInput<typeof_stringifyMarkdownOptionsSchema>
Properties
TemplateVariable
Extends
Omit<ParsedVivliostyleInlineConfig,"theme">
Properties
| Property | Type |
|---|---|
author |
string |
bleed? |
string |
browser? |
object |
browser.tag? |
string |
browser.type |
"chrome" | "chromium" | "firefox" |
category? |
"novel" | "magazine" | "journal" | "report" | "misc" |
cliVersion |
string |
cmyk? |
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } |
config? |
string |
configData? |
VivliostyleConfigSchema | null |
coreVersion |
string |
createConfigFileOnly? |
boolean |
cropMarks? |
boolean |
cropOffset? |
string |
css? |
string |
cwd? |
string |
description? |
string |
disableServerStartup? |
boolean |
enableStaticServe? |
boolean |
enableViewerStartPage? |
boolean |
executableBrowser? |
string |
host? |
string | boolean |
ignoreHttpsErrors? |
boolean |
image? |
string |
input? |
object |
input.entry |
string |
input.format |
InputFormat |
installDependencies? |
boolean |
language |
string |
license? |
string |
logger? |
LoggerInterface |
logLevel? |
"silent" | "info" | "verbose" | "debug" |
name? |
string |
openViewer? |
boolean |
output? |
object & object & object[] |
port? |
number |
preflight? |
"press-ready" | "press-ready-local" |
preflightOption? |
string[] |
pressReady? |
boolean |
projectPath |
string |
proxyBypass? |
string |
proxyPass? |
string |
proxyServer? |
string |
proxyUser? |
string |
quick? |
boolean |
readingProgression? |
"ltr" | "rtl" |
renderMode? |
"local" | "docker" |
sandbox? |
boolean |
signal? |
AbortSignal |
singleDoc? |
boolean |
size? |
string |
stderr? |
Writable |
stdin? |
Readable |
stdout? |
Writable |
style? |
string |
template? |
string |
theme? |
string | object & object | (string | object & object)[] |
themePackage? |
VivliostylePackageJson |
themePath? |
string |
timeout? |
number |
title |
string |
userStyle? |
string |
viewer? |
string |
viewerParam? |
string |
vite? |
UserConfig |
viteConfigFile? |
string | boolean |
ThemeTemplateVariable
Extends
ParsedVivliostyleInlineConfig
Properties
| Property | Type |
|---|---|
author |
string |
bleed? |
string |
browser? |
object |
browser.tag? |
string |
browser.type |
"chrome" | "chromium" | "firefox" |
category |
"novel" | "magazine" | "journal" | "report" | "misc" |
cliVersion |
string |
cmyk? |
boolean | { fallback?: CmykConversion | CmykConvertFunction; ifIncompatibleImagesFound?: "warn" | "error" | "ignore"; ifUnmappedColorsFound?: "warn" | "error" | "ignore"; mapOutput?: string; overrideMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; reserveMap?: [string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }][]; warnUnmapped?: boolean; } |
config? |
string |
configData? |
VivliostyleConfigSchema | null |
coreVersion |
string |
createConfigFileOnly? |
boolean |
cropMarks? |
boolean |
cropOffset? |
string |
css? |
string |
cwd? |
string |
description |
string |
disableServerStartup? |
boolean |
enableStaticServe? |
boolean |
enableViewerStartPage? |
boolean |
executableBrowser? |
string |
host? |
string | boolean |
ignoreHttpsErrors? |
boolean |
image? |
string |
input? |
object |
input.entry |
string |
input.format |
InputFormat |
installDependencies |
boolean |
language? |
string |
license |
string |
logger? |
LoggerInterface |
logLevel? |
"silent" | "info" | "verbose" | "debug" |
name |
string |
openViewer? |
boolean |
output? |
object & object & object[] |
port? |
number |
preflight? |
"press-ready" | "press-ready-local" |
preflightOption? |
string[] |
pressReady? |
boolean |
projectPath |
string |
proxyBypass? |
string |
proxyPass? |
string |
proxyServer? |
string |
proxyUser? |
string |
quick? |
boolean |
readingProgression? |
"ltr" | "rtl" |
renderMode? |
"local" | "docker" |
sandbox? |
boolean |
signal? |
AbortSignal |
singleDoc? |
boolean |
size? |
string |
stderr? |
Writable |
stdin? |
Readable |
stdout? |
Writable |
style? |
string |
template |
string |
theme? |
false | object & object[] |
themeName |
string |
themePath? |
string |
timeout? |
number |
title? |
string |
userStyle? |
string |
viewer? |
string |
viewerParam? |
string |
vite? |
UserConfig |
viteConfigFile? |
string | boolean |
ThemeValidationResult
Properties
| Property | Type |
|---|---|
message |
string |
type |
"error" | "warning" |
Type Aliases
CmykConversion
CmykConversion =
Readonly<v.InferInput<typeofCmykConversionSchema>>
CmykConvertFunction
CmykConvertFunction = (
rgb) =>CMYKValue|null|Promise<CMYKValue|null>
Converts an unmapped RGB color on a 0-10000 scale to CMYK, or returns null
to leave it unmapped.
Parameters
rgb
b
number
g
number
r
number
Returns
CMYKValue | null | Promise<CMYKValue | null>
ImageConversionReplacement
ImageConversionReplacement =
Readonly<v.InferInput<typeofImageConversionReplacementSchema>>
Metadata
Metadata =
object
Metadata from Frontmatter.
Properties
base?
optionalbase?:Attribute[]
Attributes of <base>.
body?
optionalbody?:Attribute[]
Attributes of <body>.
class?
optionalclass?:string
Value of <html class="...">.
custom?
optionalcustom?:object
A set of key-value pairs that are specified in readMetadata not to be processed as <meta>.
The data types converted from Frontmatter's YAML are retained.
Use this if want to add custom metadata with a third party tool.
Index Signature
[key: string]: any
dir?
optionaldir?:string
Value of <html dir="...">. e.g. ltr, rtl, auto.
head?
optionalhead?:string
<head>...</head>, reserved for future use.
html?
optionalhtml?:Attribute[]
Attributes of <html>.
The id, lang, dir, and class specified in the root take precedence over the value of this property.
id?
optionalid?:string
Value of <html id="...">.
lang?
optionallang?:string
Value of <html lang="...">.
link?
optionallink?:Attribute[][]
Attribute collection of <link>.
meta?
optionalmeta?:Attribute[][]
Attribute collection of <meta>.
script?
optionalscript?:Attribute[][]
Attribute collection of <script>.
style?
optionalstyle?:string
<style>...</style>, reserved for future use.
title?
optionaltitle?:string
Value of <title>...</title>.
vfm?
optionalvfm?:VFMSettings
VFM settings.
ReplaceFunction
ReplaceFunction = (
context) =>mupdfType.Image|null|Promise<mupdfType.Image|null>
Returns an owned replacement image, transferring its ownership to
Vivliostyle CLI, or null to decline the current match and continue to the
next replacement candidate. The returned image must be created with the
supplied mupdf module and must not be used or destroyed after it is
returned. The current image may be returned directly to use it as the
replacement.
Parameters
context
Returns
mupdfType.Image | null | Promise<mupdfType.Image | null>
StructuredDocument
StructuredDocument =
object
See
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
Properties
children
children:
StructuredDocument[]
href
href:
string
sections?
optionalsections?:StructuredDocumentSection[]
title
title:
string
StructuredDocumentSection
StructuredDocumentSection =
object
See
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
Properties
children
children:
StructuredDocumentSection[]
headingHtml
headingHtml:
string
headingText
headingText:
string
href?
optionalhref?:string
id?
optionalid?:string
level
level:
number
TocCompose
TocCompose = (
{ h }) => ({ heading, content, }) =>ElementContent[]
Parameters
{ h }
h
h
Returns
({ heading, content, }) => ElementContent[]
VivliostyleConfigSchema
VivliostyleConfigSchema =
BuildTask[] |BuildTask
See
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
VivliostylePackageMetadata
VivliostylePackageMetadata =
SchemaWithPipe<readonly [Omit<ObjectSchema<{template:SchemaWithPipe<readonly [RecordSchema<SchemaWithPipe<readonly [..., ..., ...]>,ObjectSchema<{description: ...;name: ...;prompt: ...;source: ...; },undefined>,undefined>,TitleAction<{[key:string]:object; },"VivliostyleTemplateMetadata">]>;theme:SchemaWithPipe<readonly [ObjectSchema<{author:SchemaWithPipe<...>;category:SchemaWithPipe<...>;name:SchemaWithPipe<...>;style:SchemaWithPipe<...>;topics:SchemaWithPipe<...>; },undefined>,TitleAction<{author?: ... | ...;category?: ... | ...;name?: ... | ...;style?: ... | ...;topics?: ... | ...; },"VivliostyleThemeMetadata">]>; },undefined>,"entries"|"~types"|"~run"|"~standard"> &object,TitleAction<{template?: {[key:string]:object; };theme?: {author?:string;category?:string;name?:string;style?:string;topics?:string[]; }; },"VivliostylePackageMetadata">]>
VivliostylePackageMetadata
VivliostylePackageMetadata =
v.InferInput<typeofVivliostylePackageMetadata>
Variables
readMetadata
constreadMetadata: (md,customKeys?) =>Metadata
Read metadata from Markdown frontmatter.
Keys that are not defined as VFM are treated as meta. If you specify a key name in customKeys, the key and its data type will be preserved and stored in custom instead of meta.
Parameters
md
string
Markdown.
customKeys?
string[]
A collection of key names to be ignored by meta processing.
Returns
Metadata.