From 1e92a28fcff2e9aae129a6ed45c2a75f8d9d54f8 Mon Sep 17 00:00:00 2001 From: Tim Ryan Date: Mon, 17 Dec 2018 15:40:18 -0500 Subject: [PATCH] Updating docs for working-with-documents.md --- docs/src/working-with-documents.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/src/working-with-documents.md b/docs/src/working-with-documents.md index 687b85c9..ea9fa742 100644 --- a/docs/src/working-with-documents.md +++ b/docs/src/working-with-documents.md @@ -1,24 +1,19 @@ # Documents -The contents of a page is represented as a **Document**. For example, the following "Hello world!" document: +The contents of a page is stored as a **Document** object. For example, the following "Hello world!" document: image -May be represeted with the following `DocSpan` in Rust: +May be created and manipulated in Rust: ```rust,noplaypen -doc_span![ +let document = doc_span![ DocGroup({"tag": "h1"}, ["Hello world!"]), DocGroup({"tag": "p"}, ["This is a document."]), -] -``` - -And can also be exported as Markdown: - -```markdown -# Hello world! +]; -This is a document. +// Convert this document to Markdown. +let markdown = edit_common::markdown::doc_to_markdown(&document)?; ``` ## Text and Groups