summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 924d75e4..b09a6335 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,24 @@
//! Typeset is a library for compiling documents written in the
//! corresponding typesetting language into a typesetted document in an
//! output format like _PDF_.
+//!
+//! # Example
+//! This is an example of compiling a _really_ simple document into _PDF_.
+//! ```
+//! use typeset::{parsing::{Tokenize, Parse}, doc::Generate, export::WritePdf};
+//!
+//! let path = "hello-typeset.pdf";
+//! # let path = "../target/hello-typeset.pdf";
+//! let mut file = std::fs::File::create(path).unwrap();
+//!
+//! // Tokenize, parse and then generate the document.
+//! let src = "Hello World from Typeset!";
+//! let doc = src.tokenize()
+//! .parse().unwrap()
+//! .generate().unwrap();
+//!
+//! file.write_pdf(&doc).unwrap();
+//! ```
mod pdf;
mod utility;