document lib API
This commit is contained in:
parent
5efb700c9b
commit
477eadde1c
2 changed files with 89 additions and 0 deletions
20
src/html.rs
20
src/html.rs
|
|
@ -1,4 +1,24 @@
|
|||
//! An HTML renderer that takes an iterator of [`Event`]s and emits HTML.
|
||||
//!
|
||||
//! The HTML can be written to either a [`std::fmt::Write`] or a [`std::io::Write`] object.
|
||||
//!
|
||||
//! # Examples
|
||||
//!
|
||||
//! Push to a [`String`] (implements [`std::fmt::Write`]):
|
||||
//!
|
||||
//! ```
|
||||
//! # let events = std::iter::empty();
|
||||
//! let mut html = String::new();
|
||||
//! jotdown::html::push(events, &mut html);
|
||||
//! ```
|
||||
//!
|
||||
//! Write to standard output with buffering ([`std::io::Stdout`] implements [`std::io::Write`]):
|
||||
//!
|
||||
//! ```
|
||||
//! # let events = std::iter::empty();
|
||||
//! let mut out = std::io::BufWriter::new(std::io::stdout());
|
||||
//! jotdown::html::write(events, &mut out).unwrap();
|
||||
//! ```
|
||||
|
||||
use crate::Alignment;
|
||||
use crate::Container;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue