diff --git a/README.md b/README.md index 68910ae..c0647b9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,25 @@ + + # MdView -MdView is a simple tool for [GitHub Flavored Markdown](https://github.github.com/gfm/) files in your web browser. MdView -recursively renders the containing directory of the provided file path, and serves its contents over HTTP on port 8080. -The default browser is then launched, displaying the contents. +MdView is a tool for viewing [GitHub Flavored Markdown](https://github.github.com/gfm/) files in your web browser. +MdView recursively renders the parent directory of the user-provided file and serves its contents over HTTP on port +8080. The default browser is then launched, displaying the Markdown file as an HTML document. ## Features * Works on Linux, Mac OS, and Windows. * Single executable; no installation or configuration required. -* Preview is automatically refreshes when source files change. -* Output supports GitHub styling, including light and dark modes. +* Preview is automatically refreshed when source files change. +* Output supports GitHub styles, including light and dark modes. +* Automatically skips any included front matter header data. ## Usage diff --git a/go.sum b/go.sum index b202e94..6dad236 100644 --- a/go.sum +++ b/go.sum @@ -22,7 +22,9 @@ github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwV github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs= +github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.1 h1:PT/lllxVVN0gzzSqSlHEmP8MJB4MY2U7STGxiouV4X8= github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -49,5 +51,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index e48b352..38d6956 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ import ( "github.com/FooSoft/goldsmith" "github.com/FooSoft/goldsmith-components/devserver" "github.com/FooSoft/goldsmith-components/plugins/document" + "github.com/FooSoft/goldsmith-components/plugins/frontmatter" "github.com/FooSoft/goldsmith-components/plugins/livejs" "github.com/FooSoft/goldsmith-components/plugins/markdown" "github.com/PuerkitoBio/goquery" @@ -61,6 +62,7 @@ func (self *builder) Build(contentDir, buildDir, cacheDir string) { errs := goldsmith.Begin(contentDir). Clean(true). + Chain(frontmatter.New()). Chain(markdown.NewWithGoldmark(gm)). Chain(livejs.New()). Chain(document.New(embedCss)).