more nuanced code rendering
This commit is contained in:
@@ -18,16 +18,22 @@
|
||||
<body>
|
||||
<div class="chapter" id="{{.Id}}">
|
||||
<h2>{{.Name}}</h2>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
{{range .Segs}}
|
||||
<tr>
|
||||
<td class=docs>{{.DocsRendered}}</td>
|
||||
<td class="{{.CodeClasses}}">{{.CodeRendered}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{range .Segs}}
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
{{range .}}
|
||||
<tr>
|
||||
<td class="docs">
|
||||
{{.DocsRendered}}
|
||||
</td>
|
||||
<td class="code{{if .CodeEmpty}} empty{{end}}{{if .CodeLeading}} leading{{end}}">
|
||||
{{.CodeRendered}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -68,6 +68,9 @@ div.chapter {
|
||||
margin-right: auto;
|
||||
margin-bottom: 120px;
|
||||
}
|
||||
div.chapter table {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
div#intro {
|
||||
width: 420px;
|
||||
min-width: 420px;
|
||||
@@ -102,12 +105,14 @@ td.code {
|
||||
padding-top: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 11px;
|
||||
padding-bottom: 5px;
|
||||
vertical-align: top;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
td.code.leading {
|
||||
padding-bottom: 11px;
|
||||
}
|
||||
td.code.empty {
|
||||
border-left: none;
|
||||
background: #ffffff;
|
||||
}
|
||||
pre, code {
|
||||
|
||||
Reference in New Issue
Block a user