summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseancarroll <seanc28@gmail.com>2021-01-10 21:09:57 -0600
committerseancarroll <seanc28@gmail.com>2021-01-10 21:09:57 -0600
commit499713a1d63564be320030dc98b3879b66390bb8 (patch)
treed064f1b6fd8615d5d44354774c88ec3396e0f017
parent97fe1b73ee60eb85f93f391d4aafe90fa4d1c02b (diff)
downloaddotavious-499713a1d63564be320030dc98b3879b66390bb8.zip
improve rust docs
-rw-r--r--src/lib.rs36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 575e4cf..2b64b9d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,18 +3,16 @@
//! Dotavious provides bindings to generate [DOT](https://graphviz.org/doc/info/lang.html)
//! code used by the Graphviz (http://graphviz.org/) for visualising graphs.
+//! Provides strongly typed attribute functions and offers almost complete
+//! coverage of all Graphviz attributes and syntax
//!
-//! Main features of the graphviz library include:
-//! * Almost complete coverage of all Graphviz attributes and syntax.
+//! # Examples
//!
-//! # Example
+//! First example provides a basic directed graph:
+//! 2 nodes connected by a single edge
//!
//! ```rust
-//! use dotavious::attributes::{AttributeText, GraphAttributeStatementBuilder, GraphAttributes};
-//! use dotavious::{
-//! Dot, Edge, EdgeAttributeStatementBuilder, EdgeAttributes, EdgeBuilder, Graph,
-//! GraphBuilder, Node, NodeAttributeStatementBuilder, NodeAttributes, NodeBuilder,
-//! };
+//! use dotavious::{Dot, Edge, Graph, GraphBuilder, Node};
//! use std::io;
//! use std::io::Read;
//!
@@ -41,6 +39,28 @@
//! N0 -> N1;
//! }
//! ```
+//!
+//! Second example provides a more complex graph showcasing
+//! Dotavious' various builders and strongly typed attribute
+//! functions.
+//!
+//! ```rust
+//! use dotavious::attributes::{
+//! AttributeText, Color, CompassPoint, EdgeStyle, GraphAttributeStatementBuilder,
+//! GraphAttributes, NodeStyle, PortPosition, RankDir, Shape,
+//! };
+//! use dotavious::{
+//! Dot, Edge, EdgeAttributeStatementBuilder, EdgeAttributes, EdgeBuilder, Graph,
+//! GraphBuilder, Node, NodeAttributeStatementBuilder, NodeAttributes, NodeBuilder,
+//! };
+//! use std::io;
+//! use std::io::Read;
+//! ```
+//!
+//! Produces
+//! ```dot
+//!
+//! ```
pub mod attributes;
pub mod dot;