pkg

package
v0.0.0-...-565e439 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FS       afero.Fs
	RootPath string
	Width    int
}

Config holds the configuration required to justify text.

func (*Config) Justify

func (c *Config) Justify(input string) (string, error)

justify takes an input and a desired line length and returns a fully-justified version of the text. Taken wholesale from Malik Browne's great JavaScript walkthrough that does the same https://www.malikbrowne.com/blog/text-justification-coding-question. This version adds support for godoc code examples.

func (*Config) ParseRoot

func (c *Config) ParseRoot() error

func (*Config) ProcessFile

func (c *Config) ProcessFile(fset *token.FileSet, path string, node *ast.File) error

Jump to

Keyboard shortcuts

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