Documentation ¶
Index ¶
Constants ¶
const NON_CASCADING = MAIN | FEED | ARCHIVE | ROOT
Which attributes are non-cascading.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attr ¶
type Attr int
Attr is the piccolo attributes for a file, i.e. verbatim, ignore, etc.
const ( NONE Attr = iota VERBATIM Attr = 1 << iota // Copy file w/o modification. INCLUDE // Add in header, footer and titlebar into HTML files. MAIN // The main index.html page goes in this directory. FEED // The index.atom feed goes in this directory. ARCHIVE // The archives goes in this directory. IGNORE // These files are not to be copied over. ROOT // The root of the publishing tree. )
type DocSet ¶
type DocSet struct { // The root of the tree. Root string // The directory where the main page goes. Main string // The directory where the archive pages go. Archive string // The directory where the Atom feed goes. Feed string // contains filtered or unexported fields }
DocSet keeps track of the attributes of all the directories and also tracks the important file locations.
func NewDocSet ¶
NewDocSet creates a new DocSet.
path is a diretory path at or below the .root directory.
type FileInfo ¶
type FileInfo struct { // Filesystem path to the source file. Path string // Parsed HTML of the file. Node *html.Node // The extracted title. Title string // Time the source file was created. Created time.Time // Time the source file was last updated. Updated time.Time }
FileInfo contains information about each file that has include processing done on it.
func CreationDate ¶
CreationDate returns the time an HTML document was created.
It also returns a FileInfo for the document, with the time added in the header if it was missing. The bool returned is true the meta creation element has been added to the header.
func CreationDateSaved ¶
CreationDateSaved gets the creation date of an HTML file, and also writes that HTML file back in place with an updated meta element with the creation time if that information doesn't already exist.