Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/mod.ts>Section

TypeScript (component) library for building and parsing a DOCX file
Latest
class Section
extends Component<SectionProps, SectionChild>
import { Section } from "https://deno.land/x/docxml@5.15.3/mod.ts";

A component that represents a DOCX section, which could have its own page sizing options and so on.

In normal OOXML this information belongs at either the end of the document, or inside the formatting options of the last paragraph belonging to that section. This component will smooth that over in such a way that you can simply put <Paragraph> (etc.) inside <Section>.

Methods

toNode(ancestry: ComponentAncestor[]): Promise<ComponentNodes>

Creates an XML DOM node for this component instance.

Static Properties

readonly
children: string[]
readonly
mixed: boolean

Static Methods

fromNode(node: Node, context: ComponentContext): Section

Instantiate this component from the XML in an existing DOCX file.

matchesNode(node: Node): boolean

Asserts whether or not a given XML node correlates with this component.