Skip to main content

MarkdownExportOptions

Struct MarkdownExportOptions 

Source
pub struct MarkdownExportOptions {
    pub image_mode: ImageMode,
    pub artifacts_dir: String,
    pub layers: ContentLayers,
    pub traverse_pictures: bool,
    pub escape_html: bool,
    pub escape_underscores: bool,
    pub image_placeholder: String,
}
Expand description

Options of the Markdown export (DoclingDocument::export_to_markdown_with_options, #599): the docling-core MarkdownParams the port honours beyond the image mode. Default is upstream’s default export — placeholder images, artifacts as the referenced-image directory, the body layer only, no picture traversal, HTML and underscore escaping on, <!-- image --> — so a document exported with it is byte-identical to DoclingDocument::export_to_markdown.

Fields§

§image_mode: ImageMode

How pictures render (MarkdownParams.image_mode): the placeholder, data: URIs when embedded, ![Image](<artifacts_dir>/image_NNNNNN.<ext>) when referenced (the bytes come back for the caller to write).

§artifacts_dir: String

The directory referenced images are named under.

§layers: ContentLayers

The content layers rendered (MarkdownParams.layers, export_to_markdown(included_content_layers=…)): an item on a layer outside the set is skipped, its children still walked. The default body-only set drops page headers/footers (furniture), reviewer comments (notes) and hidden sheets (invisible), as upstream does; a scanned form’s running header reads out with ContentLayers::BODY.with(ContentLayer::Furniture). The extra items render through the body’s serializers — a page header is a paragraph.

§traverse_pictures: bool

CommonParams.traverse_pictures: render the text items nested in a picture (the PDF pipeline’s picture children — a bordered form laid out as one picture holds every field as a child) after the picture’s own caption and image, as upstream yields them. Off, a picture prints only its caption and image.

§escape_html: bool

MarkdownParams.escape_html: &, < and > in text as &amp;, &lt;, &gt; (Python’s html.escape(quote=False)). Off, R&D stays R&D.

§escape_underscores: bool

MarkdownParams.escape_underscores: _ in text as \_. Off, the text keeps its underscores.

§image_placeholder: String

MarkdownParams.image_placeholder: what a picture prints as when it renders no image data (the placeholder mode, or a picture without a payload); upstream’s <!-- image -->.

Trait Implementations§

Source§

impl Clone for MarkdownExportOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MarkdownExportOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MarkdownExportOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MarkdownExportOptions

Source§

impl PartialEq for MarkdownExportOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MarkdownExportOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.