+
Skip to content

acmerocket/rodeo

Repository files navigation

rodeo

Format JSON based on markdown templates. Accept input as well-formed chunks of JSON to be parsed and applied to a template.

go install github.com/acmerocket/rodeo@latest
goat firehose --ops | rodeo post

rodeo is designed to accept a stream of JSON, and convert it into fancy terminal graphics by mapping JSON fields into Markdown templates using Glamour.

Designed originally for use with goat.

Usage

FIXME: Usage here!

Examples

Grab the ATmosphere firehose and process it using the standard templates:

goat firehose --ops | rodeo

Grab the firehose and process only specific message types, using the standard templates:

goat firehose --ops | rodeo post like

rodeo supports mutiple paramaters, each allowing the following forms:

  • app.bsky.feed.post: Match the full message $type.
  • post: Partial match of message type.
  • post=default: Use a different template, in this case default, instead of the one derived from message type.
  • post=path/to/template.md: Use the specified template for messages that match post.

To list supported built-in message templates:

rodeo --list-templates

To use an existing template in for a different message type, for example if there is no tempate for a new.message.type that you wish to display with the list template:

goat firehose --ops | rodeo new.message.type=list

To use an external template located on the filesystem (path/to/template.md)

goat firehose --ops | rodeo post=path/to/template.md like=path/to/other.md

Development

git clone https://github.com/acmerocket/rodeo
cd rodeo
make test

This project uses make and provides:

target description
make build Build the project.
make test Run the test suite.
make cover Run the test suite with coverage.
make install Install the project with go install.
make release Release the project.
make clean Clean up, remove all generates files.

Release

To release a new version, specify the version:

VERSION=v0.4.0 make release

About

Format JSON based on markdown templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载