Documentation
¶
Overview ¶
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Document
- func (doc *Document) NewTemplate(name string, r io.Reader, funcs ...template.FuncMap) (*template.Template, error)
- func (doc *Document) RegisterTemplate(name string, r io.Reader, funcs ...template.FuncMap) error
- func (doc *Document) RegisterTemplatePath(path string) error
- func (doc *Document) RegisterTemplates(fileSystem fs.FS) error
- func (doc *Document) RenderHTML(w io.Writer) error
- func (doc *Document) RenderTemplates()
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
Templates map[string]*Template
TemplateOptions []string
// contains filtered or unexported fields
}
Document is a new HTML document
func (*Document) NewTemplate ¶
func (doc *Document) NewTemplate( name string, r io.Reader, funcs ...template.FuncMap, ) (*template.Template, error)
NewTemplate creates a new template without registering it
func (*Document) RegisterTemplate ¶
RegisterTemplate registers a single template
func (*Document) RegisterTemplatePath ¶
RegisterTemplatePath registers all templates in a folder
func (*Document) RegisterTemplates ¶
RegisterTemplates registers templates in a fs.FS filesystem
func (*Document) RenderHTML ¶
RenderHTML renders the HTML document
func (*Document) RenderTemplates ¶
func (doc *Document) RenderTemplates()
RenderTemplates pre-renders all templates