frontmatter alternatives and similar packages
Based on the "Utility" category.
Alternatively, view frontmatter alternatives based on common mentions on social networks and blogs.
-
Koazee
A StreamLike, Immutable, Lazy Loading and smart Golang Library to deal with slices. -
gotabulate
Gotabulate - Easily pretty-print your tabular data with Go -
strutil-go
Golang metrics for calculating string similarity and other string utility functions -
regroup
Match regex group into go struct using struct tags and automatic parsing -
html2data
Library and cli for extracting data from HTML via CSS selectors -
Tagify
Tagify produces a set of tags from a given source. Source can be either an HTML page, a Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages. -
TySug
A project around helping to prevent typing typos. TySug (Typo Suggestions) suggests alternative words with respect to keyboard layouts -
parseargs-go
A string argument parser that understands quotes and backslashes
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of frontmatter or a related project?
README
frontmatter
Go library for detecting and decoding various content front matter formats.
Supported formats
The following front matter formats are supported by default. If the default formats are not suitable for your use case, you can easily bring your own. For more information, see the usage examples below.
Installation
go get github.com/adrg/frontmatter
Usage
Default usage.
package main
import (
"fmt"
"strings"
"github.com/adrg/frontmatter"
)
var input = `
---
name: "frontmatter"
tags: ["go", "yaml", "json", "toml"]
---
rest of the content`
func main() {
var matter struct {
Name string `yaml:"name"`
Tags []string `yaml:"tags"`
}
rest, err := frontmatter.Parse(strings.NewReader(input), &matter)
if err != nil {
// Treat error.
}
// NOTE: If a front matter must be present in the input data, use
// frontmatter.MustParse instead.
fmt.Printf("%+v\n", matter)
fmt.Println(string(rest))
// Output:
// {Name:frontmatter Tags:[go yaml json toml]}
// rest of the content
}
Bring your own formats.
package main
import (
"fmt"
"strings"
"github.com/adrg/frontmatter"
"gopkg.in/yaml.v2"
)
var input = `
...
name: "frontmatter"
tags: ["go", "yaml", "json", "toml"]
...
rest of the content`
func main() {
var matter struct {
Name string `yaml:"name"`
Tags []string `yaml:"tags"`
}
formats := []*frontmatter.Format{
frontmatter.NewFormat("...", "...", yaml.Unmarshal),
}
rest, err := frontmatter.Parse(strings.NewReader(input), &matter, formats...)
if err != nil {
// Treat error.
}
// NOTE: If a front matter must be present in the input data, use
// frontmatter.MustParse instead.
fmt.Printf("%+v\n", matter)
fmt.Println(string(rest))
// Output:
// {Name:frontmatter Tags:[go yaml json toml]}
// rest of the content
}
Full documentation can be found at: https://pkg.go.dev/github.com/adrg/frontmatter.
Stargazers over time
Contributing
Contributions in the form of pull requests, issues or just general feedback, are always welcome. See [CONTRIBUTING.MD](CONTRIBUTING.md).
License
Copyright (c) 2020 Adrian-George Bostan.
This project is licensed under the MIT license. See [LICENSE](LICENSE) for more details.
*Note that all licence references and agreements mentioned in the frontmatter README section above
are relevant to that project's source code only.