package main
import (
"fmt"
"log"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
)
// WikiDir is a rooted path to the wiki storage directory.
var WikiDir string
// HyphaPattern is a pattern which all hyphae must match. Not used currently.
var HyphaPattern = regexp.MustCompile(`[^?!:#@><*|"\'&%]+`)
// HyphaStorage is a mapping between canonical hypha names and their meta information.
var HyphaStorage = make(map[string]*HyphaData)
// HttpErr is used by many handlers to signal errors in a compact way.
func HttpErr(w http.ResponseWriter, status int, name, title, errMsg string) {
log.Println(errMsg, "for", name)
w.Header().Set("Content-Type", "text/html;charset=utf-8")
w.WriteHeader(status)
fmt.Fprint(w, base(title, fmt.Sprintf(
`