Skip to main content

MdDoc

Struct MdDoc 

Source
pub struct MdDoc { /* private fields */ }
Expand description

the document (see the module header)

Implementations§

Source§

impl MdDoc

Source

pub fn markdown(s: &str) -> MdDoc

a document from Markdown (see the module header)

Source

pub fn html(s: &str) -> MdDoc

a document from HTML: what the rich-text editor reads (paragraphs, headings h1 .. h6, lists, block quotes, formats, links, colours) and rules, images, preformatted blocks (

), tables and forms (see the module header)

Source

pub fn update(&mut self) -> bool

derive the blocks (fields, forms, links …) again after changes of the element tree (md_dom.rs; the view does it every frame) -> there were changes. In place when every change lies inside block elements that show one paragraph of plain formatted text by themselves (O(those paragraphs)), else all of them (linear in the document).

the addresses the document’s elements name, as written, each once, in document order (media other than screen / all left out); the view reads nothing by itself: the app fetches them and answers with set_sheet

Source

pub fn set_sheet(&mut self, href: &str, css: Option<&str>)

the text of a linked style sheet (None: it could not be had, its rules go): it counts where its stands among the