Fixed rust example in doc + some tweaks for html validation

This commit is contained in:
Mathieu David 2015-08-06 14:09:55 +02:00
parent 05ab31d882
commit a0040733e9
3 changed files with 9 additions and 8 deletions

View File

@ -8,13 +8,14 @@ integrate it in current projects. Here is a short example:
extern crate mdBook;
use mdBook::MDBook;
use std::path::Path;
fn main() {
let book = MDBook::new("my-book") // Path to root
.set_src("src") // Path from root to source directory
.set_dest("book") // Path from root to output directory
.read_config() // Parse book.json file for configuration
let book = MDBook::new(Path::new("my-book")) // Path to root
.set_src(Path::new("src")) // Path from root to source directory
.set_dest(Path::new("book")) // Path from root to output directory
.read_config() // Parse book.json file for configuration
book.build().unwrap(); // Render the book
book.build().unwrap(); // Render the book
}
```

View File

@ -66,7 +66,7 @@ impl HelperDef for RenderToc {
try!(rc.writer.write("\"".as_bytes()));
if path == &current {
try!(rc.writer.write("class=\"active\"".as_bytes()));
try!(rc.writer.write(" class=\"active\"".as_bytes()));
}
try!(rc.writer.write(">".as_bytes()));

View File

@ -7,10 +7,10 @@
<meta name="description" content="{% block description %}{% endblock %}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ path_to_root }}book.css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="{{ path_to_root }}book.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="{{ path_to_root }}highlight.css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="{{ path_to_root }}highlight.css">
</head>
<body>