gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 497HTML 254C 19JavaScript 81329 Definitions

update landing page

82d5dfbb7ef47281091f425ad7bb1294d10c557c · by Emil Sjölander · (7 years ago) · parent 8e33969d2 · browse the tree at this commit

Semantic delta

No definition changed: this change is text, documentation or data.

1 files · +9 −6

diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js
index 0df103153..204f61fb7 100644
--- a/docs/src/pages/index.js
+++ b/docs/src/pages/index.js
@@ -26,23 +26,26 @@ const Code = ({file, lang, children}) => {
 }
 
 const rustSnippet = `
-use stretch::{style::*, node::Node, geometry::Size};
+use stretch::{style::*, node::{Node, Stretch}, geometry::Size};
 
-let node = Node::new(Style {
+let stretch = Stretch::new();
+
+let node = stretch.new_node(Style {
     size: Size { 
         width: Dimension::Points(100.0), 
         height: Dimension::Points(100.0),
     },
     ..Default::default()
-}, vec![]);
+}, vec![]).unwrap();
 
-let layout = node.compute_layout(Size::undefined());
+stretch.compute_layout(node, Size::undefined());
 `.trim();
 
 const jsSnippet = `
-import { Node } from 'stretch-layout';
+import { Allocator, Node } from 'stretch-layout';
 
-const node = new Node({
+const allocator = new Allocator();
+const node = new Node(allocator, {
     width: 100, 
     height: 100, 
 });