graph

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyTree

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

func NewDependencyTree

func NewDependencyTree(filename string, paths Paths) (*DependencyTree, error)

NewDependencyTree creates a new DependencyTree for the given filename. If the file is a local markdown file, it extracts all the links within it and creates child dependencies recursively.

func (*DependencyTree) IsMarkdown

func (d *DependencyTree) IsMarkdown() bool

type DependencyType

type DependencyType int

type Graph

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

Graph is a dependency graph.

func BuildGraph

func BuildGraph(entryPoint string) (*Graph, error)

BuildGraph builds a graph from the given entry point.

func (*Graph) Process

func (g *Graph) Process(r Renderer, dst string) error

Process processes the graph by rendering each markdown file in parallel.

type Paths

type Paths struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

Paths is a thread-safe map of paths.

func NewPaths

func NewPaths(store map[string]struct{}) *Paths

NewPaths creates a new Paths.

func (*Paths) IsSet

func (p *Paths) IsSet(path string) bool

IsSet returns true if the given path is set.

func (*Paths) Set

func (p *Paths) Set(path string)

Set sets the given path.

type Renderer

type Renderer interface {
	RenderPage(mdFilename string) ([]byte, error)
}

Renderer is the interface that wraps the RenderPage method.

Jump to

Keyboard shortcuts

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