dochtml

package
v0.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package dochtml generates html for godochtml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTemplate added in v0.0.5

func DefaultTemplate() string

DefaultTemplate returns the default HTML template used by godochtml. nolint: lll, funlen

func Write

func Write(w io.Writer, p *doc.Package, fset *token.FileSet, tpl string, linker *FileLinker) error

Write generates the html for a specific package using the provided template. If no template is provided, the default template is chosen..

Types

type FileLinker added in v0.0.6

type FileLinker struct {
	// contains filtered or unexported fields
}

FileLinker linkifies source files.

func (*FileLinker) Set added in v0.0.6

func (f *FileLinker) Set(v string) error

Set parses a regexp=replacemennt pattern and appends to the list.

func (*FileLinker) String added in v0.0.6

func (f *FileLinker) String() string

String is not yet implemented.

func (*FileLinker) URL added in v0.0.6

func (f *FileLinker) URL(file string) (string, bool)

URL converts a file path to an url.

type Functions added in v0.0.5

type Functions struct {
	*doc.Package
	*token.FileSet
	*FileLinker
}

Functions builds out the standard functions needed by the html template.

func (*Functions) Map added in v0.0.5

func (f *Functions) Map() map[string]interface{}

Map returns the default function map

type Highlighter added in v0.0.5

type Highlighter struct {
}

Highlighter implements syntax highlighting.

func (*Highlighter) HTML added in v0.0.5

func (h *Highlighter) HTML(s string) string

HTML scans the HTML for `pre` tags, converting these to highlighted HTML.

func (*Highlighter) String added in v0.0.5

func (h *Highlighter) String(s string) string

Code converts a static into highlighted HTML.

func (*Highlighter) Styles added in v0.0.5

func (h *Highlighter) Styles() (template.CSS, error)

Styles returns a <style> node with appropriate classes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL