NLdoc.Conversion.Reader.Docx.PostProcess (NLdoc.Conversion.Reader.Docx v1.1.2)

View Source

This module performs post-processing on the intermediate result of a Docx conversion to an NLdoc spec document with NLdoc.Conversion.Reader.Docx.Convert.

This post-processing essentially does the following:

  • Recursively reverse the order of the children of every spec object in the document. This is done because NLdoc.Conversion.Reader.Docx.Convert accumulates all resources in reverse order, as Elixir implements lists as linked lists and prepending to such a list is O(1), while appending to a linked list is O(n).
  • If the Docx document had a Title element, increment the level of every heading in the document by 1. Title elements are converted to a Heading with level 0, so in order to result in a valid NLdoc document, if a document had a title heading, all headings must be incremented by 1.

Summary

Types

conversion()

Functions