Documentation ¶
Overview ¶
Package content2html implements a very simple HTML templating system for documents. It applies an html/template and fills it with the body text from an input file, discovering the document's <title> from its 1st <h1>. This way, you can write plain HTML, and generate complete documents with templatized boilerplate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDocument ¶
GenerateDocument executes template t with the document content, writing to w. It completes [Document.Title] by scanning content for the 1st <h1> tag.
func GenerateHTMLFile ¶
GenerateHTMLFile executes template t with the document contentPathname, writing the minified result to a new file in outputDirname. (See GetHTMLPathname, GenerateDocument, and Minify.)
func GetHTMLPathname ¶
GetHTMLPathname returns a pathname whose basename ends in .html and which resides in outputDirname, given an input pathname. If outputDirname is empty, returns a pathname that is a sibling of pathname. If the result is equal to pathname, returns an error.