| 1 |
#!/usr/bin/env perl |
| 2 |
use strict; |
| 3 |
use v5.10; |
| 4 |
|
| 5 |
=head1 NAME |
| 6 |
|
| 7 |
multifilter - Pandoc filter to apply filters listed in field C<multifilter> |
| 8 |
|
| 9 |
=head1 DESCRIPTION |
| 10 |
|
| 11 |
This Pandoc filter applies other filters listed in document metadata field |
| 12 |
C<multifilter>. The filters can be specified like with pandoc option C<-F> or |
| 13 |
C<--filter>. For instance C<input.md>: |
| 14 |
|
| 15 |
--- |
| 16 |
filters: |
| 17 |
- filter1 # in $PATH or ~/.pandoc/filters |
| 18 |
- ./filter2.pl # relative path |
| 19 |
- /path/filter3 # absolute path |
| 20 |
... |
| 21 |
|
| 22 |
converted via |
| 23 |
|
| 24 |
pandoc --filter multifilter input.md |
| 25 |
|
| 26 |
will be filtered like |
| 27 |
|
| 28 |
pandoc -F filter1 -F ./filter2.pl -F /path/filter3 input.md |
| 29 |
|
| 30 |
In addition, filters are searched in C<~/.pandoc/filters>. |
| 31 |
|
| 32 |
=head1 OPTIONS |
| 33 |
|
| 34 |
=over |
| 35 |
|
| 36 |
=item --help|-h |
| 37 |
|
| 38 |
Print this help |
| 39 |
|
| 40 |
=back |
| 41 |
|
| 42 |
=cut |
| 43 |
|
| 44 |
use Pandoc::Filter; |
| 45 |
use Pandoc::Filter::Multifilter; |
| 46 |
|
| 47 |
pandoc_filter_document( Pandoc::Filter::Multifilter->new ); |