summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorseancarroll <seanc28@gmail.com>2021-01-08 21:35:19 -0600
committerseancarroll <seanc28@gmail.com>2021-01-08 21:35:19 -0600
commite1ff0f4992d896c9e5b47df079c1a3b33e49cd01 (patch)
tree19e22042dd54816fc565b91f5caefd7e21295517 /src/lib.rs
parent4eb06140d996b1a5a6ac15578089ef9f61f95663 (diff)
downloaddotavious-e1ff0f4992d896c9e5b47df079c1a3b33e49cd01.zip
improving docs
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d29e7ad..f1999fa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,8 +1,50 @@
-//! Simple graphviz dot file format output.
+#![doc(html_root_url = "https://docs.rs/dotavious/0.1.0")]
+#![cfg_attr(docsrs, deny(broken_intra_doc_links))]
+
+//! Dotavious provides bindings to generate [DOT](https://graphviz.org/doc/info/lang.html)
+//! code used by the Graphviz (http://graphviz.org/) for visualising graphs.
+//!
+//! Main features of the graphviz library include:
+//! * Almost complete coverage of all Graphviz attributes and syntax.
+//!
+//! # Example
+//!
+//! ```rust
+//! use dotavious::attributes::{AttributeText, GraphAttributeStatementBuilder, GraphAttributes};
+//! use dotavious::{
+//! Dot, Edge, EdgeAttributeStatementBuilder, EdgeAttributes, EdgeBuilder, Graph,
+//! GraphBuilder, Node, NodeAttributeStatementBuilder, NodeAttributes, NodeBuilder,
+//! };
+//! use std::io;
+//! use std::io::Read;
+//!
+//! let g = GraphBuilder::new_directed(Some("single_edge".to_string()))
+//! .add_node(Node::new("N0".to_string()))
+//! .add_node(Node::new("N1".to_string()))
+//! .add_edge(Edge::new("N0".to_string(), "N1".to_string()))
+//! .build();
+//!
+//! let mut writer= Vec::new();
+//! let dot = Dot { graph: g };
+//! dot.render(&mut writer).unwrap();
+//!
+//! // output to graphviz DOT formatted string
+//! let mut dot_string = String::new();
+//! Read::read_to_string(&mut &*writer, &mut dot_string).unwrap();
+//! println!("{}", dot_string);
+//!
+//! // digraph graph_attributes {
+//! // N0;
+//! // N1;
+//! // N0 -> N1;
+//! // }
+//! ```
+
pub mod attributes;
pub mod dot;
+#[doc(hidden)]
pub use crate::dot::{
Dot, DotString, Edge, EdgeAttributeStatementBuilder, EdgeAttributes, EdgeBuilder,
Graph, GraphBuilder, Node, NodeAttributeStatementBuilder, NodeAttributes,