Skip to content

Commit

Permalink
Add clickable anchors to docs headers
Browse files Browse the repository at this point in the history
Closes #434
  • Loading branch information
chenglou authored and zpao committed Oct 21, 2013
1 parent 58b3ae3 commit 99dcdb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/_css/react.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/_plugins/header_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def header(title, level)
.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

0 comments on commit 99dcdb8

Please sign in to comment.