Commits

Josh Rickmar committed b9c2dc8

style changes

  • Participants
  • Parent commits 9b36358

Comments (0)

Files changed (1)

 package main
 
 import (
-	//	"bufio"
+	//"bufio"
 	"flag"
 	"fmt"
-	//	"github.com/knieriem/markdown"
+	//"github.com/knieriem/markdown"
 	"html/template"
 	"io"
 	"os"
 )
 
 var (
-	titleFlag    = flag.String("title", "goswf", "site title")
-	subtitleFlag = flag.String("subtitle", "", "site subtitle")
-	dirFlag      = flag.String("in", "", "markdown file tree")
-	ignoreRegExp = flag.String("ignore", "", "ignore regexp")
-	tmplFlag     = flag.String("tmpl", "", "template file")
+	titleFlag    = flag.String(`title`, `goswf`, `site title`)
+	subtitleFlag = flag.String(`subtitle`, ``, `site subtitle`)
+	dirFlag      = flag.String(`in`, ``, `markdown file tree`)
+	ignoreRegExp = flag.String(`ignore`, ``, `ignore regexp`)
+	tmplFlag     = flag.String(`tmpl`, ``, `template file`)
 )
 
 type Navigation struct {
 
 func getdest(path string) (destpath string, dest *os.File) {
 	parts := strings.Split(path, string(filepath.Separator))
-	parts[0] = parts[0] + ".static"
+	parts[0] = parts[0] + `.static`
 	last := &parts[len(parts)-1]
 	re := regexp.MustCompile(`\.md$`)
 	*last = re.ReplaceAllLiteralString(*last, `.html`)
 	pageElems := PageItems{
 		Title:    *titleFlag,
 		SubTitle: *subtitleFlag,
-		CSS:      "/style.css",
+		CSS:      `/style.css`,
 		Main:     template.HTML(`<p>Hello, world!</p>`),
 	}
 	p, err := template.ParseFiles(*tmplFlag)
 	*/
 
 	switch filepath.Ext(srcPath) {
-	case ".md":
+	case `.md`:
 		// XXX: parse the markdown
 		p.Execute(dest, pageElems)
 	default:
 	flag.Parse()
 	fi, err := os.Stat(*dirFlag)
 	if err != nil || !fi.IsDir() {
-		fmt.Fprintln(os.Stderr, "Fatal: -in flag unset or not a directory")
+		fmt.Fprintln(os.Stderr, `Fatal: -in flag unset or not a directory`)
 		flag.Usage()
 		os.Exit(1)
 	}
 	if *tmplFlag == "" {
-		fmt.Fprintln(os.Stderr, "Fatal: -tmpl flag unset or not a file")
+		fmt.Fprintln(os.Stderr, `Fatal: -tmpl flag unset or not a file`)
 		flag.Usage()
 		os.Exit(1)
 	}
 
 	abs, _ := filepath.Abs(*dirFlag)
 	dir, inDir := filepath.Split(abs)
-	outDir := filepath.Join(dir, inDir+".static")
+	outDir := filepath.Join(dir, inDir+`.static`)
 	err = os.Chdir(dir)
 	if err != nil {
 		panic(err)