NLdoc.Conversion.Reader.Docx.Files.Styles (NLdoc.Conversion.Reader.Docx v1.1.2)

View Source

This module parses the styles (e.g. word/styles.xml) files in a Docx document into a map mapping style IDs to NLdoc.Conversion.Reader.Docx.AST.Style structs.

Summary

Functions

Get a style by its ID from a parsed map of styles.

Parses the styles from a word/styles.xml file into a map mapping style IDs to NLdoc.Conversion.Reader.Docx.AST.Style structs.

Reads a (list of) Docx styles.xml file(s) at the given path(s) and parses it/them into a single map of all the styles., as returned by parse/1.

Types

t()

@type t() :: %{
  required(style_id :: String.t()) =>
    style :: NLdoc.Conversion.Reader.Docx.AST.Style.t()
}

Functions

get(styles, id, default \\ nil)

@spec get(t(), id :: String.t(), default :: default) ::
  NLdoc.Conversion.Reader.Docx.AST.Style.t() | default
when default: var

Get a style by its ID from a parsed map of styles.

parse(arg1)

@spec parse(Saxy.XML.element()) :: t()

Parses the styles from a word/styles.xml file into a map mapping style IDs to NLdoc.Conversion.Reader.Docx.AST.Style structs.

read!(filepath)

@spec read!(filepath :: String.t()) :: t()
@spec read!(filepaths :: [String.t()]) :: t()

Reads a (list of) Docx styles.xml file(s) at the given path(s) and parses it/them into a single map of all the styles., as returned by parse/1.