docs

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package docs builds the entlite documentation from the source tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Root is the repo root, it defaults to the working directory.
	Root string
	// OutDir holds the generated markdown, relative to Root.
	OutDir string
	// HTMLDir holds the generated html, empty skips the site step.
	HTMLDir string
	// Check reports stale files instead of writing them.
	Check bool
}

Config tells the pipeline where to read from and where to write to.

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline carries the state from one step to the next.

func (*Pipeline) Abs

func (p *Pipeline) Abs(path string) string

Abs turns a path relative to Root into an absolute one.

func (*Pipeline) Config

func (p *Pipeline) Config() Config

Config returns the settings of the current run.

func (*Pipeline) HTML

func (p *Pipeline) HTML(parts ...string) string

HTML returns the path of a file inside the html directory.

func (*Pipeline) Out

func (p *Pipeline) Out(parts ...string) string

Out returns the path of a markdown file inside the output directory.

func (*Pipeline) Read

func (p *Pipeline) Read(relPath string) ([]byte, error)

Read returns a file, an earlier step's output wins over the one on disk.

func (*Pipeline) Write

func (p *Pipeline) Write(relPath string, content []byte)

Write records a file, it reaches the disk when every step is done.

type Result

type Result struct {
	// Written lists the paths written to disk, empty in check mode.
	Written []string
	// Stale lists the paths that differ from the tree, only filled in check mode.
	Stale []string
	// Diff is a readable diff of the stale files, only filled in check mode.
	Diff string
}

Result reports what a run produced.

func Run

func Run(cfg Config) (Result, error)

Run executes every step and then writes or checks the result.

type Step

type Step struct {
	// Name is used in log and error messages.
	Name string
	// HTMLOnly marks a step that only runs when HTMLDir is set.
	HTMLOnly bool
	// Run fills the pipeline with the files the step produces.
	Run func(p *Pipeline) error
}

Step is one stage of the pipeline.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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