1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #28641 from diazruy/anchors

Add anchor links to all headers
This commit is contained in:
Matthew Draper 2017-04-02 18:10:52 +09:30 committed by GitHub
commit 2458e07818
2 changed files with 7 additions and 0 deletions

View file

@ -294,6 +294,9 @@ a, a:link, a:visited {
#mainCol a, #subCol a, #feature a {color: #980905;}
#mainCol a code, #subCol a code, #feature a code {color: #980905;}
#mainCol a.anchorlink { text-decoration: none; }
#mainCol a.anchorlink:hover { text-decoration: underline; }
/* Navigation
--------------------------------------- */

View file

@ -105,6 +105,10 @@ module RailsGuides
node.inner_html = "#{node_index(hierarchy)} #{node.inner_html}"
end
end
doc.css('h3, h4, h5, h6').each do |node|
node.inner_html = "<a class='anchorlink' href='##{node[:id]}'>#{node.inner_html}</a>"
end
end.to_html
end
end