pipeline

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: GPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LinkRegex is the regex of links in posts
	LinkRegex = regexp.MustCompile(`(^|\s)(\[\[(\w|-)+\]\])(\s|$)`)
)

Functions

func ConvertMarkdownToHTML

func ConvertMarkdownToHTML(posts []Post) error

ConvertMarkdownToHTML converts post's body into HTML

func MakeGraph

func MakeGraph(posts []Post) (*graph.Mutable, error)

MakeGraph returns a graph for a given list of `Posts`.

func ReplaceLinks(posts []Post) error

ReplaceLinks replaces all the `[[]]` links in the body with the link to the HTML page.

Types

type Link struct {
	Title, Slug string
}

Link is the link given to another post.

type Metadata

type Metadata struct {
	Date  time.Time `yaml:"date"`
	Tags  []string  `yaml:"tags"`
	Title string    `yaml:"title"`
}

Metadata contains the metadata extracted from the frontmatter of the post.

type Post

type Post struct {
	Meta     Metadata
	Body     string
	FilePath string

	// Links here only contains the links mentioned in the body.
	// These are not all the links to/from this post, since we need
	// to derive those from the graph.
	Links       []Link
	Connections []Link
}

Post contains all the necessary things to render a post.

func NewPost

func NewPost(path string) Post

NewPost returns a new Post

func ReadFiles

func ReadFiles(directory string) ([]Post, error)

ReadFiles reads the given directory and appends into given posts

Jump to

Keyboard shortcuts

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