import { Docx } from "https://deno.land/x/docxml@3.0.1/src/Docx.ts";
Represents the DOCX file as a whole, and collates other responsibilities together. Provides access to DOCX content types (ContentTypes), relationships (Relationships), the document itself (OfficeDocument).
An instance of this class can access other classes that represent the various XML files in a
DOCX archive, such as ContentTypes.xml
, word/document.xml
, and _rels/.rels
.
Constructors
Properties
The XML renderer instance containing translation rules, going from your XML to this library's OOXML components.
The utility function dealing with the XML for recording content types. Every DOCX file has exactly one of these.
The utility function dealing with the top-level XML file for recording relationships. Other relationships may have their own relationship XMLs.
Methods
Clone a new instance of Docx including all existing relationships, media, and XML transformation rules.
Create a ZIP archive, which is the handler for .docx
files as a ZIP archive.
Add an XML translation rule, applied to an element that matches the given XPath test.
If an element matches multiple rules, the rule with the most specific XPath test wins.
Static Methods
Instantiate this class by giving it a .docx
file if it is already loaded as a ZipArchive instance.
Instantiate this class by pointing at a .docx
file location.
Create a new DOCX with contents composed by this library's components. Needs a single JSX component
as root, for example <Section>
or <Paragragh>
.
Create an empty DOCX, and populate it with the minimum viable contents to appease MS Word.