Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdBuild = &cli.Command{ Name: "build", Usage: "Builds a book from its markdown files", ArgsUsage: "[dir]", Action: func(ctx *cli.Context) error { dir := ctx.Args().First() if dir == "" { dir, _ = os.Getwd() } if err := BuildBook(dir); err != nil { fmt.Println("build book failed:", err) os.Exit(1) } return nil }, }
View Source
var CmdClean = &cli.Command{ Name: "clean", Usage: "Deletes a built book", ArgsUsage: "[dir]", Action: func(ctx *cli.Context) error { dir := ctx.Args().First() if dir == "" { dir, _ = os.Getwd() } if err := CleanBook(dir); err != nil { fmt.Println("delete book failed:", err) os.Exit(1) } return nil }, }
View Source
var CmdInit = &cli.Command{ Name: "init", Usage: "Creates a new book", ArgsUsage: "[dir]", Action: func(ctx *cli.Context) error { dir := ctx.Args().First() if dir == "" { dir, _ = os.Getwd() } if err := InitBook(dir); err != nil { fmt.Println("init book failed:", err) os.Exit(1) } return nil }, }
View Source
var CmdServe = &cli.Command{ Name: "serve", Usage: "Serves a book at http://localhost:3000", ArgsUsage: "[dir]", Flags: []cli.Flag{ &cli.StringFlag{ Name: "http", Usage: "HTTP service address", Value: "localhost:3000", }, }, Action: func(ctx *cli.Context) error { dir := ctx.Args().First() if dir == "" { dir, _ = os.Getwd() } Serve(dir, ctx.String("http")) return nil }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.