func init() { … } // dirHandler serves a directory listing for the requested path, rooted at *contentPath. func dirHandler(w http.ResponseWriter, r *http.Request) { … } func isDoc(path string) bool { … } var dirListTemplate … var contentTemplate … func initTemplates(fsys fs.FS) error { … } // renderDoc reads the present file, gets its template representation, // and executes the template, sending output to w. func renderDoc(w io.Writer, docFile string) error { … } func parse(name string, mode present.ParseMode) (*present.Doc, error) { … } // dirList scans the given path and writes a directory listing to w. // It parses the first part of each .slide file it encounters to display the // presentation title in the listing. // If the given path is not a directory, it returns (isDir == false, err == nil) // and writes nothing to w. func dirList(w io.Writer, name string) (isDir bool, err error) { … } // showFile reports whether the given file should be displayed in the list. func showFile(n string) bool { … } // showDir reports whether the given directory should be displayed in the list. func showDir(n string) bool { … } type dirListData … type dirEntry … type dirEntrySlice … func (s dirEntrySlice) Len() int { … } func (s dirEntrySlice) Swap(i, j int) { … } func (s dirEntrySlice) Less(i, j int) bool { … }