NLdoc.Conversion.Reader.Docx.AST.Style (NLdoc.Conversion.Reader.Docx v1.1.2)
View SourceThis module defines a struct that represents a style in a Word document.
Summary
Functions
Get the heading level of a heading style from its name (case-insensitive)
The style must have type :heading
.
Types
@type style_type() ::
:title
| :heading
| :paragraph
| :blockquote
| :inline_quote
| :code
| :definition_term
| :definition
@type t() :: %NLdoc.Conversion.Reader.Docx.AST.Style{ based_on: String.t() | nil, id: String.t(), name: String.t(), type: style_type() }
Functions
Get the heading level of a heading style from its name (case-insensitive)
The style must have type :heading
.
Examples
iex> alias NLdoc.Conversion.Reader.Docx.AST.Style
iex> Style.heading_level(%Style{id: "test", based_on: nil, type: :heading, name: "heading 1"})
1
iex> Style.heading_level(%Style{id: "test", based_on: nil, type: :heading, name: "heading 2"})
2
iex> Style.heading_level(%Style{id: "test", based_on: nil, type: :heading, name: "HeAdInG 3"})
3
iex> Style.heading_level(%Style{id: "test", based_on: nil, type: :paragraph, name: "heading 1"})
nil