booklit: Index | Files

package booklitcmd

import ""


Package Files

command.go main.go server.go

func Main Uses

func Main()

type Command Uses

type Command struct {
    Version func() `short:"v" long:"version" description:"Print the version of Boooklit and exit."`

    In  string `long:"in"  short:"i" required:"true" description:"Input .lit file to load."`
    Out string `long:"out" short:"o" description:"Directory into which sections will be rendered."`

    SectionTag  string `long:"section-tag"  description:"Section tag to render."`
    SectionPath string `long:"section-path" description:"Section path to load and render with --in as its parent."`

    SaveSearchIndex bool `long:"save-search-index" description:"Save a search index JSON file in the destination."`

    ServerPort int `long:"serve" short:"s" description:"Start an HTTP server on the given port."`

    Plugins []string `long:"plugin" short:"p" description:"Package to import, providing a plugin."`

    Debug bool `long:"debug" short:"d" description:"Log at debug level."`

    AllowBrokenReferences bool `long:"allow-broken-references" description:"Replace broken references with a bogus tag."`

    HTMLEngine struct {
        Templates string `long:"templates" description:"Directory containing .tmpl files to load."`
    }   `group:"HTML Rendering Engine" namespace:"html"`

    TextEngine struct {
        FileExtension string `long:"file-extension" description:"File extension to use for generated files."`
        Templates     string `long:"templates"      description:"Directory containing .tmpl files to load."`
    }   `group:"Text Rendering Engine" namespace:"text"`

func (*Command) Build Uses

func (cmd *Command) Build() error

func (*Command) Execute Uses

func (cmd *Command) Execute(args []string) error

func (*Command) Serve Uses

func (cmd *Command) Serve() error

type Server Uses

type Server struct {
    In        string
    Processor *load.Processor

    Templates string
    Engine    *render.HTMLRenderingEngine

    FileServer http.Handler
    // contains filtered or unexported fields

func (*Server) ServeHTTP Uses

func (server *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Package booklitcmd imports 14 packages (graph). Updated 2020-07-02. Refresh now. Tools for package owners.