Paru is a simple Ruby wrapper around pandoc, the great multi-format document converter. Paru supports automating pandoc by writing Ruby programs and using pandoc in your Ruby programs (see Chapter 2 in the manual). Paru also supports writing pandoc filters in Ruby (see Chapter 3 in the manual). In paru's manual the use of paru is explained in detail, from explaining how to install and use paru, creating and using filters, to putting it all together in a real-world use case: generating the manual!
See also the paru API documentation.
Note If you're using pandoc 3, use paru version 1.1.x or higher; paru 1.0.x doesn't work with pandoc 3. If you're still using pandoc version 2, use paru version 1.0.x instead.