mirror of
https://github.com/golang/go
synced 2024-11-26 22:01:27 -07:00
af1ae438b9
This CL introduces the go.Example type and go.Examples functions that are used to represent and extract code samples from Go source. They should be of the form: // Output of this function. func ExampleFoo() { fmt.Println("Output of this function.") } It also modifies godoc to read example code from _test.go files, and include them in the HTML output with JavaScript-driven toggles. It also implements testing of example functions with gotest. The stdout/stderr is compared against the output comment on the function. This CL includes examples for the sort.Ints function and the sort.SortInts type. After patching this CL in and re-building go/doc and godoc, try godoc -http=localhost:6060 and visit http://localhost:6060/pkg/sort/ R=gri, r, rsc CC=golang-dev https://golang.org/cl/5137041
214 lines
3.4 KiB
CSS
214 lines
3.4 KiB
CSS
/* General Styles */
|
|
body {
|
|
font-family: "Bitstream Vera Sans", Verdana, sans-serif;
|
|
font-size: 81.25%;
|
|
line-height: 1.23em;
|
|
padding: 0;
|
|
margin: 1.23em;
|
|
background: white;
|
|
color: black;
|
|
}
|
|
a {
|
|
color: #04a;
|
|
text-decoration: none;
|
|
}
|
|
a:visited {
|
|
color: #04a;
|
|
}
|
|
a:hover {
|
|
color: #a40;
|
|
text-decoration: underline;
|
|
}
|
|
a:active {
|
|
color: #c00;
|
|
}
|
|
code, pre {
|
|
font-size: 1.2em;
|
|
}
|
|
pre {
|
|
background: #F0F0F0;
|
|
padding: 0.5em 1em;
|
|
}
|
|
|
|
/* Top bar */
|
|
#container {
|
|
width: 100%;
|
|
margin: auto;
|
|
}
|
|
#topnav {
|
|
height: 55px;
|
|
background: url(/doc/logo.png) no-repeat top left;
|
|
}
|
|
a#logo-box {
|
|
display: block;
|
|
height: 55px;
|
|
}
|
|
h1#title {
|
|
display: none;
|
|
}
|
|
#nav-main {
|
|
float: right;
|
|
width: 500px;
|
|
margin-top: -5px;
|
|
text-align: center;
|
|
}
|
|
#nav-main ul {
|
|
padding-left: 0;
|
|
margin-left: 0;
|
|
margin-bottom: 0.5em;
|
|
}
|
|
#nav-main li a {
|
|
display: inline;
|
|
display: inline-block;
|
|
padding: .46em .62em .38em .62em;
|
|
}
|
|
#nav-main li a:link,
|
|
#nav-main li a:visited {
|
|
color: #000;
|
|
}
|
|
#nav-main li {
|
|
display: inline;
|
|
display: inline-block;
|
|
background: #e6e6e6 url(/doc/button_background.png) repeat-x;
|
|
border: solid 1px #999;
|
|
margin-left: -1px;
|
|
text-shadow: #fff 0 1px 0;
|
|
box-shadow: 0 1px 1px #ccc;
|
|
-moz-box-shadow: 0 1px 1px #ccc;
|
|
-webkit-box-shadow: 0 1px 1px #ccc;
|
|
}
|
|
#nav-main li:first-child {
|
|
-moz-border-top-left-radius: 4px;
|
|
border-top-left-radius: 4px;
|
|
-moz-border-bottom-left-radius: 4px;
|
|
border-bottom-left-radius: 4px;
|
|
}
|
|
#nav-main li:last-child {
|
|
-moz-border-top-right-radius: 4px;
|
|
border-top-right-radius: 4px;
|
|
-moz-border-bottom-right-radius: 4px;
|
|
border-bottom-right-radius: 4px;
|
|
}
|
|
#nav-main .quickref {
|
|
color: #444;
|
|
}
|
|
#nav-main .quickref .sep {
|
|
color: #999;
|
|
}
|
|
#search {
|
|
width: 120px;
|
|
margin-left: 0.5em;
|
|
}
|
|
#search.inactive {
|
|
text-align: center;
|
|
color: #444;
|
|
}
|
|
|
|
/* Footer */
|
|
#site-info {
|
|
position: relative;
|
|
text-align: center;
|
|
}
|
|
#site-info, #site-info a:link, #site-info a:visited {
|
|
color: #aaa;
|
|
}
|
|
|
|
/* Content */
|
|
#content {
|
|
clear: both;
|
|
padding: 0;
|
|
position: relative;
|
|
margin-top: 1.5em;
|
|
margin-bottom: 1.5em;
|
|
border-top: solid 1px #aaa;
|
|
border-bottom: solid 1px #aaa;
|
|
}
|
|
.left-column {
|
|
width: 49%;
|
|
float: left;
|
|
}
|
|
.right-column {
|
|
width: 49%;
|
|
float: right;
|
|
}
|
|
.end-columns {
|
|
clear: both;
|
|
}
|
|
#content h1 {
|
|
padding: 0;
|
|
}
|
|
#content h2 {
|
|
border-top: 2px solid #ddd;
|
|
padding: 8px 0;
|
|
margin: 1.5em 0 0;
|
|
}
|
|
#content .subtitle {
|
|
margin-top: 1em;
|
|
display: block;
|
|
}
|
|
.navtop a {
|
|
font-weight: normal; font-size: 7pt;
|
|
float: right; color: #999;
|
|
}
|
|
|
|
/* Content and Code Highlighting */
|
|
pre.ebnf, pre.grammar {
|
|
background: #FFFFE0;
|
|
}
|
|
span.ln {
|
|
font-size: 80%;
|
|
color: #777777;
|
|
}
|
|
span.comment {
|
|
color: #002090;
|
|
}
|
|
span.highlight {
|
|
background: #FF9900;
|
|
font-weight: bold;
|
|
}
|
|
span.highlight-comment {
|
|
background: #FF9900;
|
|
font-weight: bold;
|
|
color: #002090;
|
|
}
|
|
span.selection {
|
|
background: #FFFF00
|
|
}
|
|
span.selection-comment {
|
|
color: #002090;
|
|
background: #FFFF00
|
|
}
|
|
span.selection-highlight {
|
|
background: #FF9900;
|
|
font-weight: bold;
|
|
}
|
|
span.selection-highlight-comment {
|
|
background: #FF9900;
|
|
font-weight: bold;
|
|
color: #002090;
|
|
}
|
|
span.alert {
|
|
color: #D00000;
|
|
}
|
|
#nav table {
|
|
width: 100%;
|
|
}
|
|
.detail {
|
|
padding: 0.25em 1em;
|
|
background: #F4F4F4;
|
|
}
|
|
sup.new {
|
|
color: red;
|
|
font-size: 8px;
|
|
line-height: 0;
|
|
}
|
|
.example .expanded {
|
|
display: none;
|
|
}
|
|
.exampleVisible .collapsed {
|
|
display: none;
|
|
}
|
|
.exampleHeading {
|
|
cursor: pointer;
|
|
}
|