docs: clean up comments
This commit is contained in:
1 parent
64ae976ecf
commit
20eb94d7c0
9 files changed
+49
-79
No files matched your search
@@ -6,10 +6,9 @@ import { PX_PER_CM, cmToPx, type PageMargins } from '../storage/pageMargins';
|
||||
import type { Orientation } from '../storage/pageOrientation';
|
||||
import { languageFromOdf, NO_LANGUAGE, type DocumentLanguage } from '../storage/documentLanguage';
|
||||
|
||||
// .odt → TipTap JSON, inverting export/odt.ts. Anything the editor can express
|
||||
// becomes its native node/mark/attr; values matching the editor's defaults are
|
||||
// suppressed so a round trip (editor → LibreOffice → editor) doesn't accrete
|
||||
// explicit attrs. Unsupported content degrades gracefully and is reported.
|
||||
// .odt → TipTap JSON, inverting export/odt.ts. Editor-expressible content becomes its
|
||||
// native node/mark/attr; values matching the editor's defaults are suppressed so round
|
||||
// trips don't accrete explicit attrs. Unsupported content degrades gracefully (reported).
|
||||
|
||||
type Mark = { type: string; attrs?: Record<string, unknown> };
|
||||
type Node = {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import type { PageMargins } from '../storage/pageMargins';
|
||||
import type { Orientation } from '../storage/pageOrientation';
|
||||
|
||||
// Resolves ODF style indirection for the importer: every producer (our export,
|
||||
// LibreOffice re-saves, Word) spreads formatting across named styles, automatic
|
||||
// styles, and parent-style-name chains. This module flattens those chains into
|
||||
// per-style property maps so import/odt.ts can read effective values directly.
|
||||
// Resolves ODF style indirection for the importer: producers (our export, LibreOffice,
|
||||
// Word) spread formatting across named/automatic styles and parent-style-name chains.
|
||||
// This flattens those into per-style property maps so import/odt.ts reads effective values.
|
||||
|
||||
export const NS = {
|
||||
office: 'urn:oasis:names:tc:opendocument:xmlns:office:1.0',
|
||||
@@ -304,10 +303,9 @@ export class StyleResolver {
|
||||
};
|
||||
}
|
||||
|
||||
// Page margins + orientation from the master page's layout. With a header/footer,
|
||||
// ODF's vertical margin ends at the zone — the editor's body margin is margin +
|
||||
// zone height + spacing (inverse of the export's Word-style mapping). Page *size*
|
||||
// is intentionally ignored — the editor is A4-only.
|
||||
// Page margins + orientation from the master page's layout. With a header/footer the
|
||||
// body margin is page margin + zone height + spacing (inverse of the export mapping).
|
||||
// Page size is intentionally ignored — the editor is A4-only.
|
||||
pageGeometry(): { margins: PageMargins; orientation: Orientation } | null {
|
||||
const props = this.pageLayoutEl()?.getElementsByTagNameNS(NS.style, 'page-layout-properties')[0] ?? null;
|
||||
if (!props) return null;
|
||||
|
||||
Reference in new issue
Block a user