From 5bc2321b4ff7a7b8afd9156fdf95848cd9230d16 Mon Sep 17 00:00:00 2001 From: Spencer Brower Date: Mon, 4 Mar 2024 09:46:34 -0500 Subject: [PATCH] refactor: Gomplate now renders all examples using the same plugin. --- .gomplate.yml | 8 +++----- README.md | 5 +++-- README.md.tmpl | 17 ++++++++++------- bin/run-example | 6 ++++++ 4 files changed, 22 insertions(+), 14 deletions(-) create mode 100755 bin/run-example diff --git a/.gomplate.yml b/.gomplate.yml index 460f737..50f3701 100644 --- a/.gomplate.yml +++ b/.gomplate.yml @@ -6,10 +6,8 @@ plugins: filters: ./get_filter_support_table ffprobe: ./get_ffprobe_commands_table version: ./nu_version - ffprobe_example: ./examples/ffprobe.nu - ffprobe_multiple_files_example: ./examples/ffprobe-multiple-files.nu - ffprobe_streams_audio_example: ./examples/streams-audio.nu - ffprobe_streams_video_example: ./examples/streams-video.nu - ffprobe_dimensions_example: ./examples/dimensions.nu + example: + cmd: ./bin/run-example + #args: [] #pluginTimeout: 10s diff --git a/README.md b/README.md index 61ed2ac..75c7aec 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # nu-ffmpeg Utility commands for working with ffmpeg in nushell. @@ -9,8 +8,10 @@ Utility commands for working with ffmpeg in nushell. - `ffprobe` multiple files at once - Use `streams`, `streams video`, and `streams audio` to filter `ffprobe` output - get the `dimensions` of a video stream as a record + +- Apply complex filters to a video using standard shell pipes `|` rather than filtergraph syntax. +- Conditionally apply filters to a video based on the inputs - Tab-completion for filter options. i.e. `fps --round` will yield `zero inf down up near` -- Apply and parse complex filters to a video (Work In Progress) ## Setup diff --git a/README.md.tmpl b/README.md.tmpl index e13994c..18c0e93 100644 --- a/README.md.tmpl +++ b/README.md.tmpl @@ -3,7 +3,8 @@ vim: filetype=markdown : -> -{{ end }} +{{ end -}} + # nu-ffmpeg Utility commands for working with ffmpeg in nushell. @@ -14,8 +15,10 @@ Utility commands for working with ffmpeg in nushell. - `ffprobe` multiple files at once - Use `streams`, `streams video`, and `streams audio` to filter `ffprobe` output - get the `dimensions` of a video stream as a record + +- Apply complex filters to a video using standard shell pipes `|` rather than filtergraph syntax. +- Conditionally apply filters to a video based on the inputs - Tab-completion for filter options. i.e. `fps --round` will yield `zero inf down up near` -- Apply and parse complex filters to a video (Work In Progress) ## Setup @@ -47,18 +50,18 @@ use /filters * ## Examples ```nu -{{ ffprobe_example -}} +{{ example "ffprobe" -}} ``` ```nu -{{ ffprobe_multiple_files_example -}} +{{ example "ffprobe-multiple-files" -}} ``` ```nu -{{ ffprobe_streams_video_example -}} -{{ ffprobe_streams_audio_example -}} +{{ example "streams-video" -}} +{{ example "streams-audio" -}} ``` ```nu -{{ ffprobe_dimensions_example -}} +{{ example "dimensions" -}} ``` diff --git a/bin/run-example b/bin/run-example new file mode 100755 index 0000000..40f0769 --- /dev/null +++ b/bin/run-example @@ -0,0 +1,6 @@ +#!/usr/bin/env nu +# vim: filetype=nu : + +def main [name: string] { + nu $'./examples/($name).nu' +}