diff --git a/src/renderer/html_handlebars.rs b/src/renderer/html_handlebars.rs index 40cb92eb..86d517a7 100644 --- a/src/renderer/html_handlebars.rs +++ b/src/renderer/html_handlebars.rs @@ -230,12 +230,29 @@ impl HelperDef for RenderToc { else { try!(rc.writer.write("
  • ".as_bytes())); } - try!(rc.writer.write("".as_bytes())); + + // Link + let path_exists = if let Some(path) = item.get("path") { + if path.len() > 0 { + try!(rc.writer.write("".as_bytes())); + true + } else { + false + } + }else { + false + }; + try!(rc.writer.write("".as_bytes())); try!(rc.writer.write(item.get("section").expect("Error: section should be Some(_)").as_bytes())); - try!(rc.writer.write("".as_bytes())); + try!(rc.writer.write(" ".as_bytes())); try!(rc.writer.write(item.get("name").expect("Error: name should be Some(_)").as_bytes())); - try!(rc.writer.write("".as_bytes())); + + if path_exists { + try!(rc.writer.write("".as_bytes())); + } try!(rc.writer.write("
  • ".as_bytes())); diff --git a/src/theme/book.css b/src/theme/book.css index ddf48caa..cc973d3a 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -74,6 +74,10 @@ html, body { white-space: nowrap; } +.chapter li { + color: #AAA; +} + .chapter li a { color: #333; padding: 5px 0;