Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAllLinks ¶
func ExtractAllLinks(ast *blackfriday.Node) []blackfriday.LinkData
ExtractAllLinks will extract all links from the passed ast.
func FilterLocalLinks ¶
func FilterLocalLinks(links []blackfriday.LinkData) []blackfriday.LinkData
FilterLocalLinks will extract all "local" links, ie, links pointing to the local file system and not starting with "http[s]://...". This is done by looking at the link's destination. Links of the form "/absolute-link", "../sibling-dir/something", "sub-dir/something", nothing else. Note on anchors: links pointing to anchors in the same file will not be returned. Links pointing to other files while also containing an anchor (ie, in the form <path_to_file>#<anchor-name> are returned.
func ParseFileToAst ¶
func ParseFileToAst(markdownFile string) (*blackfriday.Node, error)
ParseFileToAst parses a file living at the path specified at marcdownFile and returns an abstract syntax tree
Types ¶
type Change ¶
type Change struct { Date string HeaderNode *blackfriday.Node ContentNodes []*blackfriday.Node }
Change contains the parsed content of a single change from a CHANGELOG file
func GetChanges ¶
GetChanges explores the passed ast, expecting it to contain a changelog with section titles that start with a date in the form DD.MM.YYYY it returns an ordered slice of changes