Skip to content

simple command-line utility for working with markdown frontmatter.

License

Notifications You must be signed in to change notification settings

rythoris/frontmatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontmatter

frontmatter is a simple command-line utility for working with markdown frontmatter.

Usage: frontmatter [--format FORMAT] [--content] FILE

Positional arguments:
  FILE                   markdown file path

Options:
  --format FORMAT, -f FORMAT
                         frontmatter output format (possible values: 'yaml', 'json') [default: json]
  --content, -c          only print content of the file
  --help, -h             display this help and exit

frontmatter wouldn't be possible without adrg/frontmatter library. Consider showing them some love by starring their repository.

Installation

go install -v github.com/rythoris/frontmatter@latest

Examples

# extract 'title' from test.md
frontmatter -f json ./test.md | jq -r '.title'

# extract content of the test.md
frontmatter -c ./test.md

FAQ

Why are you using json-iterator/go instead of encoding/json

Because apperantly encoding/json doesn't not support unmarshalling to map[interface {}]interface {} type.

License

This project is licensed under MIT License. See LICENSE for more details.

About

simple command-line utility for working with markdown frontmatter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages