Class: TransformationApplicationService
Defined in: application/services/core/TransformationApplicationService.ts:43
Facade over the document export transformers (Markdown, HTML, PDF and RDF/JSON-LD).
Constructors
Constructor
new TransformationApplicationService(): TransformationApplicationService;Returns
TransformationApplicationService
Properties
defaultHtmlCss
readonly defaultHtmlCss: "\n@page {\n size: A4;\n margin: 18mm 16mm;\n}\n:root {\n color-scheme: light;\n --sd-accent: #605afe;\n --sd-accent-soft: #eef0ff;\n --sd-ink: #1f2933;\n --sd-ink-strong: #0f172a;\n --sd-muted: #64748b;\n --sd-line: #e6e9f2;\n --sd-link-line: #c3c0fd;\n}\n* { box-sizing: border-box; }\nbody {\n margin: 0;\n font-family: Inter, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n color: var(--sd-ink);\n background: #eef1f7;\n line-height: 1.6;\n -webkit-font-smoothing: antialiased;\n}\n.datasheet {\n max-width: 820px;\n margin: 28px auto;\n padding: 56px 60px 40px;\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);\n}\n@media print {\n body { background: #ffffff; }\n .datasheet { margin: 0 auto; padding: 0; box-shadow: none; border-radius: 0; max-width: none; }\n}\n.md-body { font-size: 15.5px; }\n/* Document title */\n.md-body h1 {\n margin: 0 0 0.9rem;\n padding-bottom: 0.7rem;\n font-size: 2.05rem;\n line-height: 1.2;\n font-weight: 800;\n letter-spacing: -0.01em;\n color: var(--sd-ink-strong);\n border-bottom: 3px solid var(--sd-accent);\n break-after: avoid-page;\n page-break-after: avoid;\n}\n/* Section headings */\n.md-body h2 {\n margin: 2.1rem 0 0.75rem;\n padding-left: 0.7rem;\n font-size: 1.32rem;\n font-weight: 700;\n color: var(--sd-ink-strong);\n border-left: 4px solid var(--sd-accent);\n break-after: avoid-page;\n page-break-after: avoid;\n}\n.md-body h3 {\n margin: 1.4rem 0 0.5rem;\n font-size: 1.08rem;\n font-weight: 700;\n color: #334155;\n break-after: avoid-page;\n page-break-after: avoid;\n}\n.md-body h4 {\n margin: 1.1rem 0 0.4rem;\n font-size: 1rem;\n font-weight: 700;\n color: #475569;\n break-after: avoid-page;\n page-break-after: avoid;\n}\n.md-body p {\n margin: 0.55rem 0 0.9rem;\n orphans: 3;\n widows: 3;\n}\n.md-body strong { color: var(--sd-ink-strong); font-weight: 700; }\n.md-body em { color: #334155; }\n.md-body ul, .md-body ol {\n margin: 0.4rem 0 1rem 1.35rem;\n padding: 0;\n break-inside: avoid-page;\n page-break-inside: avoid;\n}\n.md-body li { margin: 0.28rem 0; padding-left: 0.2rem; }\n.md-body li::marker { color: var(--sd-accent); }\n/* Crisp, consistent separation between repeated structured blocks (agents, source-data\n entries, …) — a top-level list item that itself contains a nested list. Simple value\n lists (each item a plain leaf, no nested list) are left untouched. */\n.md-body > ul > li:has(> ul):not(:first-child) {\n margin-top: 0.75rem;\n padding-top: 0.75rem;\n border-top: 1px solid var(--sd-line);\n}\n.md-body > ul > li:has(> ul) > ul { margin-bottom: 0.35rem; }\n.md-body blockquote {\n margin: 0.9rem 0;\n padding: 0.5rem 1.1rem;\n border-left: 3px solid var(--sd-line);\n background: #f8fafc;\n color: var(--sd-muted);\n border-radius: 0 8px 8px 0;\n}\n.md-body code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.88em;\n background: var(--sd-accent-soft);\n color: #4338ca;\n padding: 0.1rem 0.35rem;\n border-radius: 5px;\n}\n.md-body pre {\n background: #0f172a;\n color: #e2e8f0;\n padding: 0.9rem 1.1rem;\n border-radius: 10px;\n overflow: auto;\n}\n.md-body pre code { background: none; color: inherit; padding: 0; }\n.md-body table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.8rem 0 1.1rem;\n font-size: 0.95em;\n}\n.md-body th, .md-body td {\n border: 1px solid var(--sd-line);\n padding: 0.5rem 0.7rem;\n text-align: left;\n}\n.md-body th { background: var(--sd-accent-soft); color: var(--sd-ink-strong); }\n.md-body hr { border: none; border-top: 1px solid var(--sd-line); margin: 1.6rem 0; }\n.md-body a, .value-link {\n color: var(--sd-accent);\n text-decoration: none;\n border-bottom: 1px solid var(--sd-link-line);\n}\n.md-body a:hover { border-bottom-color: var(--sd-accent); }\n.md-body h1 + p, .md-body h1 + ul, .md-body h1 + ol,\n.md-body h2 + p, .md-body h2 + ul, .md-body h2 + ol,\n.md-body h3 + p, .md-body h3 + ul, .md-body h3 + ol,\n.md-body h4 + p, .md-body h4 + ul, .md-body h4 + ol {\n break-before: avoid-page;\n page-break-before: avoid;\n}\n.sidedoc-export-attribution {\n display: flex;\n align-items: center;\n gap: 0.7rem;\n margin-top: 2.6rem;\n padding-top: 1rem;\n border-top: 1px solid var(--sd-line);\n color: var(--sd-muted);\n font-size: 0.9rem;\n}\n.sidedoc-export-attribution a { color: var(--sd-accent); text-decoration: none; border: none; }\n.sidedoc-export-attribution img {\n display: block;\n width: 30px;\n height: 19px;\n margin: 0;\n}\n.sidedoc-export-attribution p { margin: 0; }\n" = DEFAULT_DOCUMENT_EXPORT_CSS;Defined in: application/services/core/TransformationApplicationService.ts:45
The default stylesheet embedded in HTML exports.
Methods
documentLinkTarget()
documentLinkTarget(documentData, profileId?): DocumentLinkTarget | null;Defined in: application/services/core/TransformationApplicationService.ts:97
The dataset or catalog a document describes, for offering it in a link field of another document, per its native mapping's rootIdSource, rootLabelSource and rootType. Null when the document has no IRI yet or describes something else.
Parameters
| Parameter | Type |
|---|---|
documentData | any |
profileId? | string |
Returns
DocumentLinkTarget | null
documentToHtml()
documentToHtml(documentData, options?): string;Defined in: application/services/core/TransformationApplicationService.ts:53
Renders document data as a standalone HTML page. See documentToHtml.
Parameters
| Parameter | Type |
|---|---|
documentData | any |
options? | HtmlTransformOptions |
Returns
string
documentToJsonLd()
documentToJsonLd(
documentData,
profileId?,
options?
): object;Defined in: application/services/core/TransformationApplicationService.ts:69
Converts document data to JSON-LD using the RDF mapping registered for the pair (source profile, options.targetModelId). The target defaults to the source's native one (defaultRdfTarget).
Parameters
| Parameter | Type | Description |
|---|---|---|
documentData | any | - |
profileId? | string | Profile id of the source document; used to pick the mapping by prefix. |
options? | ( | JsonLdExportOptions | RdfMappingOptions) & LinkedDocumentsOption | - |
Returns
object
Throws
Error if no mapping is registered for the profile and target model.
documentToMarkdown()
documentToMarkdown(documentData, options?): string;Defined in: application/services/core/TransformationApplicationService.ts:48
Renders document data as Markdown. See documentToMarkdown.
Parameters
| Parameter | Type |
|---|---|
documentData | any |
options? | DocumentTransformOptions |
Returns
string
htmlToPdfBlob()
htmlToPdfBlob(html, options?): Promise<Blob>;Defined in: application/services/core/TransformationApplicationService.ts:58
Converts an HTML export into a PDF blob. See htmlToPdfBlob.
Parameters
| Parameter | Type |
|---|---|
html | string |
options? | PdfTransformOptions |
Returns
Promise<Blob>