Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // LinkRegex is the regex of links in posts LinkRegex = regexp.MustCompile(`(^|\s)(\[\[(\w|-)+\]\])(\s|$)`) )
Functions ¶
func ConvertMarkdownToHTML ¶
ConvertMarkdownToHTML converts post's body into HTML
func ReplaceLinks ¶
ReplaceLinks replaces all the `[[]]` links in the body with the link to the HTML page.
func SyntaxHighlighter ¶ added in v0.4.1
SyntaxHighlighter Highlights any code-blocks from the Generated HTML files(from markdown) based on the style defined in the pygmentsStyle key in zettel.toml file It takes in the rendered HTML from markdown, parses it and selects the code blocks within the <code></code> tag and the language from the tag's class It tokenizes the code based on the language and applies highlighting. It uses styles from the chroma library in Go
Types ¶
type Metadata ¶
type Metadata struct { Date time.Time `yaml:"date"` Tags []string `yaml:"tags"` Title string `yaml:"title"` Draft bool `yaml:"draft"` }
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.