more style tweaks

This commit is contained in:
Mark McGranaghan 2012-10-01 11:07:12 -07:00
parent 8774894291
commit 610c4a9c20
2 changed files with 15 additions and 7 deletions

View File

@ -35,8 +35,8 @@ table td {
outline: 0; outline: 0;
} }
td.docs { td.docs {
max-width: 400px; max-width: 375px;
min-width: 400px; min-width: 375px;
min-height: 5px; min-height: 5px;
padding: 10px 15px 1px 30px; padding: 10px 15px 1px 30px;
overflow-x: hidden; overflow-x: hidden;
@ -44,6 +44,8 @@ td.docs {
text-align: left; text-align: left;
} }
td.code { td.code {
max-width: 375px;
min-width: 375px;
padding: 14px 30px 16px 15px; padding: 14px 30px 16px 15px;
vertical-align: top; vertical-align: top;
background: #f0f0f0; background: #f0f0f0;

View File

@ -35,7 +35,7 @@ var docsPat = regexp.MustCompile("^\\s*\\/\\/\\s")
var headerPat = regexp.MustCompile("^\\s*\\/\\/\\s#+\\s") var headerPat = regexp.MustCompile("^\\s*\\/\\/\\s#+\\s")
type seg struct { type seg struct {
docs, code, docsRendered, codeRendered string docs, code, docsRendered, codeRendered, codeClasses string
} }
func main() { func main() {
@ -99,7 +99,13 @@ func main() {
for _, seg := range segs { for _, seg := range segs {
seg.docsRendered = pipe(markdownPath, []string{}, seg.docs) seg.docsRendered = pipe(markdownPath, []string{}, seg.docs)
if seg.code == "" {
seg.codeRendered = ""
seg.codeClasses = "code empty"
} else {
seg.codeRendered = pipe(pygmentizePath, []string{"-l", "go", "-f", "html"}, seg.code+" ") seg.codeRendered = pipe(pygmentizePath, []string{"-l", "go", "-f", "html"}, seg.code+" ")
seg.codeClasses = "code"
}
} }
fmt.Printf(`<!DOCTYPE html> fmt.Printf(`<!DOCTYPE html>
@ -119,8 +125,8 @@ func main() {
fmt.Printf( fmt.Printf(
`<tr> `<tr>
<td class=docs>%s</td> <td class=docs>%s</td>
<td class=code>%s</td> <td class="%s">%s</td>
</tr>`, seg.docsRendered, seg.codeRendered) </tr>`, seg.docsRendered, seg.codeClasses, seg.codeRendered)
} }
fmt.Print(`</tbody></table></div></body></html>`) fmt.Print(`</tbody></table></div></body></html>`)