NLdoc.Conversion.Reader.Docx (NLdoc.Conversion.Reader.Docx v1.1.2)
View SourceThe NLdoc.Conversion.Reader.Docx
struct represents an opened Docx file.
This module provides functions for opening, converting and reading from Docx files.
Note: after opening a Docx file with open!/1
, it is highly recommended to call close!/1
to clean up the temporary directory in which the Docx file was extracted.
Package Structure
The NLdoc.Conversion.Reader.Docx
package is structured as follows:
NLdoc.Conversion.Reader.Docx
: contains the mainDocx
struct and functions for opening and closing Docx files.`convert!/1` is delegated to `NLdoc.Conversion.Reader.Docx.Convert`.
NLdoc.Conversion.Reader.Docx.AST
: implements structures that represent the information contained in the files of a Docx document.This is our Abstract Syntax Tree (AST), our internal representation of the contents of everything in a Docx document.
NLdoc.Conversion.Reader.Docx.Files
: implements everything related to what files are in a Docx document:`[Content_Types].xml`, `docProps/core.xml`, `document.xml`, `numbering.xml`, `styles.xml`, `.rels` files etc.
NLdoc.Conversion.Reader.Docx.Convert
: implements the actual conversion of AST to NLdoc spec.
Summary
Functions
Close a Docx
struct, removing the temporary directory in which the Docx file was extracted.
After this, the Docx
struct can no longer be used as input to any functions in this module.
Open a Docx file and extract its contents to a temporary directory, raising errors when any of these steps fail.
Returns a Docx
struct that can be used with the rest of the functions in this module.
When you're done with the Docx
struct, you should call close!/1
to clean up the temporary directory.
Types
@type t() :: %NLdoc.Conversion.Reader.Docx{ core_properties: NLdoc.Conversion.Reader.Docx.Files.CoreProperties.t(), document: NLdoc.Conversion.Reader.Docx.Files.Document.t(), files: NLdoc.Conversion.Reader.Docx.Files.t(), numberings: NLdoc.Conversion.Reader.Docx.Files.Numberings.t(), styles: NLdoc.Conversion.Reader.Docx.Files.Styles.t() }
Functions
@spec close!(t()) :: :ok
Close a Docx
struct, removing the temporary directory in which the Docx file was extracted.
After this, the Docx
struct can no longer be used as input to any functions in this module.
Open a Docx file and extract its contents to a temporary directory, raising errors when any of these steps fail.
Returns a Docx
struct that can be used with the rest of the functions in this module.
When you're done with the Docx
struct, you should call close!/1
to clean up the temporary directory.