From 994c881538f86757f7b1193f7dfa52a67e480805 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 7 Jul 2012 15:51:11 -0700 Subject: [PATCH] tutorial: Use blockquotes for asides. Add styling --- doc/rust.css | 7 +++++++ doc/tutorial.md | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/doc/rust.css b/doc/rust.css index db45c0e5426..d68f0b851c2 100644 --- a/doc/rust.css +++ b/doc/rust.css @@ -57,3 +57,10 @@ h1.title { background-repeat: no-repeat; background-position: right; } + +blockquote { + color: black; + background-color: lavender; + margin: 1em; + padding: 0.5em 1em 0.5em 1em; +} \ No newline at end of file diff --git a/doc/tutorial.md b/doc/tutorial.md index cce8fed220e..fc0d3fbec27 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1553,8 +1553,8 @@ let y = x; // Copy the pointer, increase refcount // When x and y go out of scope, refcount goes to 0, box is freed ~~~~ -***Note:*** We will in the future switch to garbage collection, rather -than reference counting, for shared boxes. +> ***Note:*** We will in the future switch to garbage collection, +> rather than reference counting, for shared boxes. Shared boxes never cross task boundaries. @@ -1642,8 +1642,8 @@ Rust vectors are always heap-allocated and unique. A value of type `~[T]` is represented by a pointer to a section of heap memory containing any number of values of type `T`. -***Note:*** This uniqueness is turning out to be quite awkward in -practice, and might change in the future. +> ***Note:*** This uniqueness is turning out to be quite awkward in +> practice, and might change in the future. Vector literals are enclosed in square brackets. Dereferencing is done with square brackets (zero-based): @@ -1676,10 +1676,10 @@ logarithmically, so the above code generates about the same amount of copying and reallocation as `push` implementations in most other languages. -***Note:*** Actually, currently, growing a vector is *exactly* as -inefficient as it looks, since vector `+` has been moved to the -libraries and Rust's operator overloading support is insufficient to -allow this optimization. Try using `vec::push`. +> ***Note:*** Actually, currently, growing a vector is *exactly* as +> inefficient as it looks, since vector `+` has been moved to the +> libraries and Rust's operator overloading support is insufficient to +> allow this optimization. Try using `vec::push`. ## Strings @@ -1946,8 +1946,8 @@ fn plus1(&&x: int) -> int { x + 1 } vec::map(~[1, 2, 3], plus1); ~~~~ -***Note:***: This is inconvenient, and we are hoping to get rid of this -restriction in the future. +> ***Note:*** This is inconvenient, and we are hoping to get rid of +> this restriction in the future. # Modules and crates @@ -2222,8 +2222,8 @@ object-oriented languages tend to solve with methods and inheritance. For example, writing a function that can operate on multiple types of collections. -***Note:***: This feature is very new, and will need a few extensions to be -applicable to more advanced use cases. +> ***Note:*** This feature is very new, and will need a few extensions to be +> applicable to more advanced use cases. ## Declaration @@ -2663,8 +2663,8 @@ copying it by making use of [unique boxes](#unique-boxes), which allow the sending task to release ownership of a value, so that the receiving task can keep on using it. -***Note:***: As Rust evolves, we expect the task API to grow and change -somewhat. The tutorial documents the API as it exists today. +> ***Note:*** As Rust evolves, we expect the task API to grow and +> change somewhat. The tutorial documents the API as it exists today. ## Spawning a task