Skip to content

Commit

Permalink
Add section anchors for easier linking to individual sections. (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetron authored and mr-c committed Mar 8, 2019
1 parent f1a3537 commit 41a30b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion schema_salad/makedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self): # type: () -> None
self.options = {}

def header(self, text, level, raw=None): # type: (Text, int, Any) -> Text
return """<h%i id="%s">%s</h%i>""" % (level, to_id(text), text, level)
return """<h%i id="%s" class="section">%s <a href="#%s">&sect;</a></h%i>""" % (level, to_id(text), text, to_id(text), level)

def table(self, header, body): # type: (Text, Text) -> Text
return (
Expand Down Expand Up @@ -483,6 +483,13 @@ def avrold_doc(j, # type: List[Dict[Text, Any]]
margin-left: 2em;
margin-right: 2em;
}
.section a {
visibility: hidden;
}
.section:hover a {
visibility: visible;
color: rgb(201, 201, 201);
}
.responsive-table-header {
text-align: left;
padding: 8px;
Expand Down

0 comments on commit 41a30b6

Please sign in to comment.