Add clickable anchors to docs headers

Closes #434
This commit is contained in:
Cheng Lou 2013-10-17 10:36:07 -04:00 committed by Paul O’Shannessy
parent 58b3ae3136
commit 99dcdb87e3
2 changed files with 11 additions and 1 deletions

View File

@ -391,6 +391,16 @@ section.black content {
font-size: 24px;
}
h1, h2, h3, h4, h5, h6 {
a {
color: $darkTextColor;
&:hover {
text-decoration: underline;
}
}
}
// H2s form documentation topic dividers. Extra space helps.
h2 {
margin-top: 30px;

View File

@ -11,7 +11,7 @@ class Redcarpet::Render::HTML
.gsub(/\s+/, "-")
.gsub(/[^A-Za-z0-9\-_.]/, "")
return "<h#{level} id=\"#{clean_title}\">#{title}</h#{level}>"
return "<h#{level} id=\"#{clean_title}\"><a href=\"##{clean_title}\">#{title}</a></h#{level}>"
end
end