document lib API

This commit is contained in:
Noah Hellman 2023-02-04 20:07:20 +01:00
commit 477eadde1c
2 changed files with 89 additions and 0 deletions

View file

@ -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;