mirror of
https://github.com/golang/go
synced 2024-11-18 18:14:43 -07:00
4fc6323385
Start of moving globals into those types. R=golang-dev, adg CC=golang-dev https://golang.org/cl/11484043
40 lines
772 B
Go
40 lines
772 B
Go
// Copyright 2013 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package godoc
|
|
|
|
import (
|
|
"text/template"
|
|
)
|
|
|
|
// Presentation generates output from a corpus.
|
|
type Presentation struct {
|
|
Corpus *Corpus
|
|
|
|
// TabWidth optionally specifies the tab width.
|
|
TabWidth int
|
|
|
|
ShowTimestamps bool
|
|
ShowPlayground bool
|
|
ShowExamples bool
|
|
DeclLinks bool
|
|
}
|
|
|
|
// NewPresentation returns a new Presentation from a corpus.
|
|
func NewPresentation(c *Corpus) *Presentation {
|
|
if c == nil {
|
|
panic("nil Corpus")
|
|
}
|
|
return &Presentation{
|
|
Corpus: c,
|
|
TabWidth: 4,
|
|
ShowExamples: true,
|
|
DeclLinks: true,
|
|
}
|
|
}
|
|
|
|
func (p *Presentation) FuncMap() template.FuncMap {
|
|
panic("")
|
|
}
|