From 95d7edeb8d2d04cccecace939fed9e69707f9645 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 25 Feb 2019 18:44:55 +0100 Subject: [PATCH] =?UTF-8?q?Enhance=20content=20streams=20and=20pdf=20examp?= =?UTF-8?q?le=20=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7e875d3ee..2fa1f6c34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,18 +3,21 @@ //! output format like _PDF_. //! //! # Example -//! This is an example of compiling a _really_ simple document into _PDF_. +//! This is an example of compiling a really simple document into _PDF_. //! ``` //! use typeset::{parsing::ParseTree, doc::Generate, export::WritePdf}; //! -//! let path = "hello-typeset.pdf"; -//! # let path = "../target/hello-typeset.pdf"; -//! let mut file = std::fs::File::create(path).unwrap(); +//! // Create an output file. +//! # /* +//! let mut file = std::fs::File::create("hello-typeset.pdf").unwrap(); +//! # */ +//! # let mut file = std::fs::File::create("../target/hello-typeset.pdf").unwrap(); //! //! // Parse the source and then generate the document. //! let src = "Hello World from Typeset!"; //! let doc = src.parse_tree().unwrap().generate().unwrap(); //! +//! // Write the document into file as PDF. //! file.write_pdf(&doc).unwrap(); //! ```