frontmatter

command module
v0.0.0-...-530598f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 9 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL