pandocwalk - parse document with pandoc and process abstract syntax tree
pandocwalk [ options ] [ SCRIPT | 'SELECTOR => ACTION' ]
Calls pandoc with given options to parse a document and process its abstract syntax tree. A processing script must be given as executable file or as Perl code to filter the document. See Pandoc::Filter::Lazy for filter syntax.
Extract all URLs from a HTML file:
pandocwalk document.html 'Link => say $_->url'
Extract table of contents from a LaTeX file:
pandocwalk document.tex 'Header => say " " x $_->level, $_->string'
To install Pandoc::Elements, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pandoc::Elements
CPAN shell
perl -MCPAN -e shell install Pandoc::Elements
For more information on module installation, please visit the detailed CPAN module installation guide.