提交 b5c56090 编写于 作者: R Ruy Diaz

Add anchor links to all headers

To allow easy linking at all levels and not just from index
上级 56014880
......@@ -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
--------------------------------------- */
......
......@@ -105,6 +105,10 @@ def generate_structure
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册