From 5cbb6b9dca11fe98b2feefcd31684ee2c2f1455a Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 25 Dec 2014 18:19:55 +0100 Subject: Rename and shorten filters. --- pandoc-filter-sections | 55 -------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100755 pandoc-filter-sections (limited to 'pandoc-filter-sections') diff --git a/pandoc-filter-sections b/pandoc-filter-sections deleted file mode 100755 index f0bb5a5..0000000 --- a/pandoc-filter-sections +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; - -use Pandoc::Filter; -use Pandoc::Elements; - -# FIXME: avoid eating content past tweaked headers -pandoc_filter( - \&frontmatter, - \&mainmatter, - \&backmatter, - \&toc, -); - -# FIXME: use Header (not latex RawBlock) - why does it hang?!? -sub header { - my $label = shift; -# Header( 1, attributes {}, [ Str $label ], ); - RawBlock( 'latex', '\\chapter{'.$label.'}' ); -}; - -sub frontmatter { - my $self = shift; - return [ RawBlock( 'latex', '\\frontmatter' ), header('About'), ] - if ( $self->name eq 'Header' and $self->level >= 1 - and stringify($self) eq 'About' ); - return; -} - -sub mainmatter { - my $self = shift; - return [ RawBlock( 'latex', '\\mainmatter' ), header(stringify($self)), ] - if ( $self->name eq 'Header' and $self->level == 1 - and stringify($self) =~ /^Scope/ ); - return; -} - -sub backmatter { - my $self = shift; - return [ RawBlock( 'latex', '\\backmatter' ), header('References'), ] - if ( $self->name eq 'Header' and $self->level == 1 - and stringify($self) =~ /^Notes/ ); - return; -} - -sub toc { - my $self = shift; - return unless ( $self->name eq 'Header' and $self->level == 1 - and stringify($self) =~ /^Table/ ); - return RawBlock( 'latex', - '{\\hypersetup{linkcolor=black}\\setcounter{tocdepth}{3}\\tableofcontents}' - ); -} -- cgit v1.2.3