cmd

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 29 Imported by: 0

README

Winter Project

This directory holds your new Winter project. To start, create some new pages or posts in src/cold manually, or hook up a writing program to synchronize its content to src/warm automatically.

Documentation

Overview

Package cmd contains the commands for the winter CLI.

Index

Constants

View Source
const (
	KnownURLsPath = "src/urls.txt"
)

Variables

This section is empty.

Functions

func Execute

func Execute(version string)

Execute sets up the root command and all attached subcommands, then runs them according to the CLI arguments supplied.

Types

type Builder

type Builder func(src, dst string, cfg document.Config) error

Builder is a function that builds a source file src into a destination directory dst.

type Reloader

type Reloader struct {
	// Builders is a mapping of filepath patterns to functions which can build
	// paths that match those patterns. Deprecated: Use Substructure instead.
	Builders     map[string]Builder
	Ignore       map[string]struct{}
	Substructure *document.Substructure
	// contains filtered or unexported fields
}

Reloader watches the filesystem for changes to relevant files so it can reload the browser using WebSockets.

func (*Reloader) Handler

func (r *Reloader) Handler() websocket.Handler

Handler returns a function that handles incoming WebSocket connections which implements http.Handler.

func (*Reloader) Reload

func (r *Reloader) Reload()

Reload notifies all connected browsers to reload the page. It also notifies any browsers that connect in the next second,

func (*Reloader) Shutdown

func (r *Reloader) Shutdown()

Shutdown stops watching the filesystem for changes and gracefully closes any open WebSocket connections.

func (*Reloader) Watch

func (r *Reloader) Watch(paths []string) error

Watch starts watching the filesystem for changes asynchronously, building any changes based on the contents of Builders and then reloading any connected browser.

Watch returns once the goroutine has been spun off successfully. Any errors enountered while watching the filesystem are printed to stderr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL