htmlconv

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(wr io.Writer, doc gopher.MapDocument, overrides *template.Template) error

Convert writes html to a writer from the provided gophermap document.

Templates can be provided to override the output for different line types. The supported templates are:

  • "header' is called before any lines and is passed the full document.
  • "footer" is called after all lines and is passed the full document.
  • "message" is called for every group of consecutive info-message lines. It is passed a string of all the display components of the included lines, joined by newline characters.
  • "image" is called for all lines of any of the following types: GifFileType, ImageFileType, BitmapType, PngImageFileType. It is passed the gopher.MapItem.
  • "link" is called for all lines of any other type not yet mentioned, and is passed the gopher.MapItem.

There are already default implementations of each of these templates, so the "overrides" argument can be nil or include just a subset of the supported templates.

Types

This section is empty.

Jump to

Keyboard shortcuts

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