mark_indentation

class atlas_doc_parser.marks.mark_indentation.MarkIndentationAttrs(level: int = REQ)[source]

Attributes for MarkIndentation.

Parameters:

level – Required. The indentation level, an integer from 1 to 6.

class atlas_doc_parser.marks.mark_indentation.MarkIndentation(type: str = 'indentation', attrs: MarkIndentationAttrs = REQ)[source]

Applies indentation to block-level content.

The indentation mark controls the left margin indentation of paragraphs and other block elements. The level attribute specifies the depth of indentation, ranging from 1 (minimal) to 6 (maximum).

to_markdown(text: str) str[source]

Apply this mark’s formatting to text.

The default implementation returns the input text unchanged. This design reflects the library’s philosophy:

  1. Content extraction over formatting. In the AI era, we convert ADF to Markdown primarily to extract textual content for LLMs, RAG systems, and knowledge bases. Preserving formatting is secondary to preserving content.

  2. When in doubt, preserve content without formatting. If a mark type doesn’t have a standard Markdown equivalent (e.g., background color), we return the raw text rather than inventing custom syntax or losing the content entirely.

  3. Use native Markdown only. We prefer standard Markdown syntax (**bold**, *italic*). Dialect-specific extensions are avoided.

Subclasses override this method to apply formatting. For example, MarkStrong.to_markdown("text") returns "**text**".

Parameters:

text – The text content to format.

Returns:

The formatted text. Default returns text unchanged.