@samitouri / QOS-React-2 / commits / 99dcdb87e3

Add clickable anchors to docs headers

Closes #434

Cheng Lou committed Oct 17, 2013 at 10:36 UTC 99dcdb87e3175d927392e46ad497550e60ce15a3
2 files changed +11 -1
docs/_css/react.scss
+10
@@ -391,6 +391,16 @@ section.black content {
391 font-size: 24px;
392 }
393
394 + h1, h2, h3, h4, h5, h6 {
395 + a {
396 + color: $darkTextColor;
397 +
398 + &:hover {
399 + text-decoration: underline;
400 + }
401 + }
402 + }
403 +
404 // H2s form documentation topic dividers. Extra space helps.
405 h2 {
406 margin-top: 30px;
docs/_plugins/header_links.rb
+1 -1
@@ -11,7 +11,7 @@ class Redcarpet::Render::HTML
11 .gsub(/\s+/, "-")
12 .gsub(/[^A-Za-z0-9\-_.]/, "")
13
14 - return "<h#{level} id=\"#{clean_title}\">#{title}</h#{level}>"
14 + return "<h#{level} id=\"#{clean_title}\"><a href=\"##{clean_title}\">#{title}</a></h#{level}>"
15 end
16 end
17