Documentation ¶
Overview ¶
Package md provides common markdown utilities, used by build-tools and learn platform.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶ added in v0.1.127
Copy copies the contents of the `src` directory to the `dest` directory. It skips over *.md files and returns their files names in a string slice, typically to generate HTML files from it.
func FindFiles ¶ added in v0.1.127
FindFiles finds recursively all file with .md extension in given directory and returns a slice of their names.
func HTMLFilename ¶ added in v0.1.127
HTMLFilename returns the HTML filename for a given markdown filename. README.md is converted to index.html, and all other .md files are converted .html file names with the same base name stem.
func RewriteLink ¶ added in v0.1.130
func RewriteLink(n Node)
RewriteLink replace a relative link to a .md file the HTML filename equivalent, see HTMLFilename.
func ToRoot ¶ added in v0.1.127
ToRoot returns a relative path to the root of the given filename. It requires a final slash to be concatenated with further paths, so it can be used in templates more directly, e.g.:
<link rel="stylesheet" href="{{.Root}}/css/index.css" type="text/css" />
func Undecorate ¶ added in v0.1.161
Undecorate returns a stripped down markdown representation of the given markdown.Inline: Strong has the `**` stripped, Code has the back-ticks stripped, Link only uses the text representation, no URL etc. Undecorate is used to extract a plain "name" for given inline elements.