buildbuiltinCmykConversionbuiltinCmykReplacementbuiltinGrayConversionbuiltinGrayReplacementcreatecreateVitePlugindefineConfigpreviewVFM
CmykConvertFunctionMetadataReplaceFunctionStructuredDocumentStructuredDocumentSectionVivliostyleConfigSchemaVivliostylePackageMetadataVivliostylePackageMetadata
build(
options):Promise<void>
Build publication file(s) from the given configuration.
import { build } from '@vivliostyle/cli';
build({
configPath: './vivliostyle.config.js',
logLevel: 'silent',
});string = ...
string = ...
string = ...
boolean | { mapOutput?: string; overrideMap?: ([string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }] | (rgb) => { c: number; k: number; m: number; y: number; } | Promise<{ 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; warnUnreplacedImages?: boolean; } = CmykSchema
string = ...
VivliostyleConfigSchema | null = ...
boolean = ...
boolean = ...
string = ...
string = ...
string = ...
boolean = ...
boolean = ...
boolean = ...
string = ...
string | boolean = ...
boolean = ...
string = ...
string = ...
boolean = ...
string = ...
LoggerInterface = ...
"info" | "silent" | "verbose" | "debug" = ...
boolean = ...
string | object & object | (string | object & object)[] = ...
number = ...
"press-ready" | "press-ready-local" = ...
string | string[] = ...
boolean = ...
string = ...
string = ...
string = ...
string = ...
string = ...
boolean = ...
"ltr" | "rtl" = ...
"local" | "docker" = ...
boolean = ...
AbortSignal = ...
boolean = ...
string = ...
Writable = ...
Readable = ...
Writable = ...
string = ...
string = ...
string | false | object & object | (string | object & object)[] = ...
number = ...
string = ...
string = ...
string = ...
string = ...
UserConfig = ...
string | boolean = ...
Promise<void>
builtinCmykConversion(
options):CmykConvertFunction
Returns a CmykConvertFunction that converts RGB colors to CMYK. Internally creates a 1x1 RGB pixmap and delegates to builtinCmykReplacement for the actual conversion, reusing ICC profile support.
builtinCmykReplacement(
options):ReplaceFunction
Returns a ReplaceFunction that converts RGB images to CMYK. When called without arguments, uses mupdf's DeviceCMYK color space. An output ICC profile can be provided for profile-based conversion.
builtinGrayConversion(
options):CmykConvertFunction
Returns a CmykConvertFunction that converts RGB colors to grayscale (K only). Internally delegates to builtinGrayReplacement and maps the Gray value to K.
builtinGrayReplacement(
options):ReplaceFunction
Returns a ReplaceFunction that converts RGB images to grayscale. When called without arguments, uses mupdf's DeviceGray color space. An output ICC profile can be provided for profile-based conversion.
create(
options):Promise<void>
Scaffold a new Vivliostyle project.
string = ...
string = ...
string = ...
boolean | { mapOutput?: string; overrideMap?: ([string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }] | (rgb) => { c: number; k: number; m: number; y: number; } | Promise<{ 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; warnUnreplacedImages?: boolean; } = CmykSchema
string = ...
VivliostyleConfigSchema | null = ...
boolean = ...
boolean = ...
string = ...
string = ...
string = ...
boolean = ...
boolean = ...
boolean = ...
string = ...
string | boolean = ...
boolean = ...
string = ...
string = ...
boolean = ...
string = ...
LoggerInterface = ...
"info" | "silent" | "verbose" | "debug" = ...
boolean = ...
string | object & object | (string | object & object)[] = ...
number = ...
"press-ready" | "press-ready-local" = ...
string | string[] = ...
boolean = ...
string = ...
string = ...
string = ...
string = ...
string = ...
boolean = ...
"ltr" | "rtl" = ...
"local" | "docker" = ...
boolean = ...
AbortSignal = ...
boolean = ...
string = ...
Writable = ...
Readable = ...
Writable = ...
string = ...
string = ...
string | false | object & object | (string | object & object)[] = ...
number = ...
string = ...
string = ...
string = ...
string = ...
UserConfig = ...
string | boolean = ...
Promise<void>
createVitePlugin(
inlineConfig):Promise<Plugin<any>[]>
string = ...
string = ...
string = ...
boolean | { mapOutput?: string; overrideMap?: ([string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }] | (rgb) => { c: number; k: number; m: number; y: number; } | Promise<{ 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; warnUnreplacedImages?: boolean; } = CmykSchema
string = ...
VivliostyleConfigSchema | null = ...
boolean = ...
boolean = ...
string = ...
string = ...
string = ...
boolean = ...
boolean = ...
boolean = ...
string = ...
string | boolean = ...
boolean = ...
string = ...
string = ...
boolean = ...
string = ...
LoggerInterface = ...
"info" | "silent" | "verbose" | "debug" = ...
boolean = ...
string | object & object | (string | object & object)[] = ...
number = ...
"press-ready" | "press-ready-local" = ...
string | string[] = ...
boolean = ...
string = ...
string = ...
string = ...
string = ...
string = ...
boolean = ...
"ltr" | "rtl" = ...
"local" | "docker" = ...
boolean = ...
AbortSignal = ...
boolean = ...
string = ...
Writable = ...
Readable = ...
Writable = ...
string = ...
string = ...
string | false | object & object | (string | object & object)[] = ...
number = ...
string = ...
string = ...
string = ...
string = ...
UserConfig = ...
string | boolean = ...
Promise<Plugin<any>[]>
defineConfig(
config):VivliostyleConfigSchema
Define the configuration for Vivliostyle CLI.
preview(
options):Promise<ViteDevServer>
Open a browser for previewing the publication.
string = ...
string = ...
string = ...
boolean | { mapOutput?: string; overrideMap?: ([string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }] | (rgb) => { c: number; k: number; m: number; y: number; } | Promise<{ 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; warnUnreplacedImages?: boolean; } = CmykSchema
string = ...
VivliostyleConfigSchema | null = ...
boolean = ...
boolean = ...
string = ...
string = ...
string = ...
boolean = ...
boolean = ...
boolean = ...
string = ...
string | boolean = ...
boolean = ...
string = ...
string = ...
boolean = ...
string = ...
LoggerInterface = ...
"info" | "silent" | "verbose" | "debug" = ...
boolean = ...
string | object & object | (string | object & object)[] = ...
number = ...
"press-ready" | "press-ready-local" = ...
string | string[] = ...
boolean = ...
string = ...
string = ...
string = ...
string = ...
string = ...
boolean = ...
"ltr" | "rtl" = ...
"local" | "docker" = ...
boolean = ...
AbortSignal = ...
boolean = ...
string = ...
Writable = ...
Readable = ...
Writable = ...
string = ...
string = ...
string | false | object & object | (string | object & object)[] = ...
number = ...
string = ...
string = ...
string = ...
string = ...
UserConfig = ...
string | boolean = ...
Promise<ViteDevServer>
VFM(
options?,metadata?):Processor
Create Unified processor for Markdown AST and Hypertext AST.
Options.
Processor
Unified processor.
| Property | Type |
|---|---|
outputProfile? |
Uint8Array<ArrayBufferLike> |
asPNG():
Uint8Array
Uint8Array
Option for convert Markdown to a stringify (HTML).
Omit<ParsedVivliostyleInlineConfig,"theme">
| Property | Type |
|---|---|
author |
string |
bleed? |
string |
browser? |
object |
browser.tag? |
string |
browser.type |
"chrome" | "chromium" | "firefox" |
cliVersion |
string |
cmyk? |
boolean | { mapOutput?: string; overrideMap?: ([string | { b: number; g: number; r: number; }, { c: number; k: number; m: number; y: number; }] | (rgb) => { c: number; k: number; m: number; y: number; } | Promise<{ 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; warnUnreplacedImages?: boolean; } |
config? |
string |
configData? |
VivliostyleConfigSchema | null |
coreVersion |
string |
createConfigFileOnly? |
boolean |
cropMarks? |
boolean |
cropOffset? |
string |
css? |
string |
cwd? |
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 |
logger? |
LoggerInterface |
logLevel? |
"info" | "silent" | "verbose" | "debug" |
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 |
timeout? |
number |
title |
string |
userStyle? |
string |
viewer? |
string |
viewerParam? |
string |
vite? |
UserConfig |
viteConfigFile? |
string | boolean |
CmykConvertFunction = (
rgb) =>CMYKValue|Promise<CMYKValue>
RGBValue
CMYKValue | Promise<CMYKValue>
Metadata =
object
Metadata from Frontmatter.
optionalbase:Attribute[]
Attributes of <base>.
optionalbody:Attribute[]
Attributes of <body>.
optionalclass:string
Value of <html class="...">.
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.
[key: string]: any
optionaldir:string
Value of <html dir="...">. e.g. ltr, rtl, auto.
optionalhead:string
<head>...</head>, reserved for future use.
optionalhtml:Attribute[]
Attributes of <html>.
The id, lang, dir, and class specified in the root take precedence over the value of this property.
optionalid:string
Value of <html id="...">.
optionallang:string
Value of <html lang="...">.
optionallink:Attribute[][]
Attribute collection of <link>.
optionalmeta:Attribute[][]
Attribute collection of <meta>.
optionalscript:Attribute[][]
Attribute collection of <script>.
optionalstyle:string
<style>...</style>, reserved for future use.
optionaltitle:string
Value of <title>...</title>.
optionalvfm:VFMSettings
VFM settings.
ReplaceFunction = (
image) =>Uint8Array|Promise<Uint8Array>
Uint8Array | Promise<Uint8Array>
StructuredDocument =
object
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
children:
StructuredDocument[]
href:
string
optionalsections:StructuredDocumentSection[]
title:
string
StructuredDocumentSection =
object
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
children:
StructuredDocumentSection[]
headingHtml:
string
headingText:
string
optionalhref:string
optionalid:string
level:
number
VivliostyleConfigSchema =
BuildTask[] |BuildTask
https://github.com/vivliostyle/vivliostyle-cli/blob/main/docs/config.md
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 =
v.InferInput<typeofVivliostylePackageMetadata>
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.
string
Markdown.
string[]
A collection of key names to be ignored by meta processing.
Metadata.