Expand description
AsciiDoc parser.
This module provides a parser for the AsciiDoc markup language. The parser is
implemented using the peg parser generator.
§Quick Start
The parser is implemented as a struct that implements the Parser trait. The
trait provides two methods for parsing AsciiDoc content:
parse: parses a string containingAsciiDoccontent.parse_file: parses the content of a file containingAsciiDoccontent.
use acdc_parser::{Document, parse};
let content = r#"= Document Title
This is a paragraph.
== Section Title
This is a subsection."#;
let options = acdc_parser::Options::default();
let document = parse(content, &options).unwrap();
println!("{:?}", document);Structs§
- Admonition
- An
Admonitionrepresents an admonition in a document. - Anchor
- An
Anchorrepresents an anchor in a document. - Audio
- An
Audiorepresents an audio block in a document. - Author
- An
Authorrepresents the author of a document. - Autolink
- An
Autolinkrepresents an inline autolink in a document. - Block
Metadata - A
BlockMetadatarepresents the metadata of a block in a document. - Bold
- A
Boldrepresents a bold section of text in a document. - Button
- A
Buttonrepresents an inline button in a document. - Callout
List - A
CalloutListrepresents a callout list in a document. - Callout
List Item - A
CalloutListItemrepresents an item in a callout list. - Callout
Ref - A
CalloutRefrepresents a callout reference marker within verbatim content. - Column
Format - Column format specification for table formatting
- Comment
- A single-line comment in a document.
- Cross
Reference - A
CrossReferencerepresents an inline cross-reference (xref) in a document. - Curved
Apostrophe - A
CurvedApostropherepresents a curved apostrophe section of text in a document. - Curved
Quotation - A
CurvedQuotationrepresents a curved quotation section of text in a document. - Delimited
Block - A
DelimitedBlockrepresents a delimited block in a document. - Description
List - A
DescriptionListrepresents a description list in a document. - Description
List Item - An item in a description list (term + description).
- Discrete
Header - A
DiscreteHeaderrepresents a discrete header in a document. - Document
- A
Documentrepresents the root of anAsciiDocdocument. - Document
Attribute - A
DocumentAttributerepresents a document attribute in a document. - Document
Attributes - Document-level attributes with universal defaults.
- Element
Attributes - Element-level attributes (for blocks, sections, etc.).
- Footnote
- A
Footnoterepresents an inline footnote in a document. - Header
- A
Headerrepresents the header of a document. - Highlight
- A
Highlightrepresents a highlighted section of text in a document. - Icon
- An
Iconrepresents an inline icon in a document. - Image
- An
Imagerepresents an image block in a document. - Index
Term - An
IndexTermrepresents an index term in a document. - Italic
- An
Italicrepresents an italic section of text in a document. - Keyboard
- A
Keyboardrepresents an inline keyboard shortcut in a document. - Line
Break - A
LineBreakrepresents a line break (inline). - Link
- A
Linkrepresents an inline link in a document. - List
Item - A
ListItemrepresents a list item in a document. - Location
- A
Locationrepresents a location in a document. - Mailto
- An
Mailtorepresents an inlinemailto:in a document. - Menu
- A
Menurepresents an inline menu in a document. - Monospace
- A
Monospacerepresents a monospace section of text in a document. - Options
- Options
Builder - Builder for
Optionsthat provides an API for configuration. - Ordered
List - An
OrderedListrepresents an ordered list in a document. - Page
Break - A
PageBreakrepresents a page break in a document. - Paragraph
- A
Paragraphrepresents a paragraph in a document. - Parser
- Type-based parser for
AsciiDoccontent. - Pass
- A
Passrepresents a passthrough macro in a document. - Plain
- A
Plainrepresents a plain text section in a document. - Position
- A
Positionrepresents a human-readable position in a document. - Raw
- A
Rawrepresents a raw text section in a document. - Section
- A
Sectionrepresents a section in a document. - Source
Location - Source location information combining file path and positioning
- Standalone
Curved Apostrophe - A
StandaloneCurvedApostropherepresents a standalone curved apostrophe character. - Stem
- A
Stemrepresents an inline mathematical expression. - Stem
Content - Content of a stem block with math notation.
- Subscript
- A
Subscriptrepresents a subscript section of text in a document. - Superscript
- A
Superscriptrepresents a superscript section of text in a document. - Table
- A
Tablerepresents a table in a document. - Table
Column - A
TableColumnrepresents a column/cell in a table row. - Table
OfContents - A
TableOfContentsrepresents a table of contents block. - Table
Row - A row in a table, containing one or more columns (cells).
- Thematic
Break - A
ThematicBreakrepresents a thematic break in a document. - Title
- A title in a document (section titles, block titles, document title, etc.).
- TocEntry
- A
TocEntryrepresents a table of contents entry. - Unordered
List - A
UnorderedListrepresents an unordered list in a document. - Url
- An
Urlrepresents an inline URL in a document. - Verbatim
- A
Verbatimrepresents verbatim text section in a document. - Video
- A
Videorepresents a video block in a document.
Enums§
- Admonition
Variant - The variant/type of an admonition block.
- Attribute
Value - An
AttributeValuerepresents the value of an attribute in a document. - Block
- A
Blockrepresents a block in a document. - Callout
RefKind - The kind of callout reference marker (how it was expressed in the source).
- Column
Style - Column content style
- Column
Width - Column width specification
- Delimited
Block Type - The inner content type of a delimited block.
- Error
- Form
- The form of an inline formatting element (how it was expressed in the source)
- Horizontal
Alignment - Horizontal alignment for table cells
- Index
Term Kind - The kind of index term, encoding both visibility and structure.
- Inline
Macro - An inline macro - a functional element that produces inline content.
- Inline
Node - An
InlineNoderepresents an inline node in a document. - List
Item Checked Status - A
ListItemCheckedStatusrepresents the checked status of a list item. - Passthrough
Kind - Positioning
- Positioning information - either a full Location with start/end or a single Position
- Safe
Mode - Safe mode to use when processing the document. This follows from what is described in https://docs.asciidoctor.org/asciidoctor/latest/safe-modes/ and is intended to provide similar functionality as Asciidoctor.
- Source
- The source location for media content (images, audio, video).
- Stem
Notation - Notation type for mathematical expressions.
- Substitution
- A
Substitutionrepresents a substitution in a passthrough macro. - Vertical
Alignment - Vertical alignment for table cells
Constants§
Functions§
- inlines_
to_ string - Extract plain text from inline nodes, recursively handling formatted text.
- parse
- Parse
AsciiDoccontent from a string. - parse_
file - Parse
AsciiDoccontent from a file. - parse_
from_ reader - Parse
AsciiDoccontent from a reader. - parse_
inline - Parse inline
AsciiDoccontent from a string.
Type Aliases§
- Attribute
Name - An
AttributeNamerepresents the name of an attribute in a document. - Role
- Subtitle