diff options
Diffstat (limited to '.ikiwiki/IkiWiki/Plugin/pandoc.pm')
-rwxr-xr-x | .ikiwiki/IkiWiki/Plugin/pandoc.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/.ikiwiki/IkiWiki/Plugin/pandoc.pm b/.ikiwiki/IkiWiki/Plugin/pandoc.pm index 249e9d0..9f3e0c2 100755 --- a/.ikiwiki/IkiWiki/Plugin/pandoc.pm +++ b/.ikiwiki/IkiWiki/Plugin/pandoc.pm @@ -64,6 +64,17 @@ close $fh; # END +# activate with 'generate_$format' in meta; turn on all with 'generate_all_formats'. +my %extra_formats = ( + pdf => { ext=>'pdf', label=>'PDF', format=>'latex', extra=>[], order=>1 }, + docx => { ext=>'docx', label=>'DOCX', format=>'docx', extra=>[], order=>2 }, + odt => { ext=>'odt', label=>'ODT', format=>'odt', extra=>[], order=>3 }, + beamer => { ext=>'beamer.pdf', label=>'Beamer', format=>'beamer', extra=>[], order=>4 }, + revealjs => { ext=>'revealjs.html', label=>'RevealJS', format=>'revealjs', extra=>['--self-contained'], order=>5 }, + epub => { ext=>'epub', label=>'EPUB', format=>'epub3', extra=>[], order=>6 }, + latex => { ext=>'tex', label=>'LaTeX', format=>'latex', extra=>['--standalone'], order=>7 }, +); + sub import { # DEBUG Print @@ -733,7 +744,6 @@ sub htmlize ($@) { sub pagetemplate (@) { - my %params = @_; my $page = $params{page}; @@ -761,7 +771,6 @@ sub pagetemplate (@) { } sub pageactions { - my %args = @_; my $page = $args{page}; @@ -787,7 +796,6 @@ sub pageactions { } sub export_file { - my ($page, $ext, $json_content, $command, @args) = @_; # DEBUG @@ -882,7 +890,6 @@ sub export_file { } sub remove_exported_file { - my ($page, $ext) = @_; my ($export_path, $export_url) = _export_file_path_and_url($page, $ext); if (-f $export_path) { @@ -900,7 +907,6 @@ sub remove_exported_file { } sub _export_file_path_and_url { - my ($page, $ext) = @_; # the html file will end up in "$destdir/$page/index.html", # while e.g. a pdf will be in "$destdir/$page/$page_minus_dirs.pdf". @@ -915,12 +921,10 @@ sub _export_file_path_and_url { return ($export_path, $export_url); } - ## compile_string and unwrap_c are used to make the meta data structures ## easier to work with for perl. sub compile_string { - # Partially represents an item from the data structure in meta as a string. my @uncompiled = @_; return $uncompiled[0] if @uncompiled==1 && !ref($uncompiled[0]); @@ -936,7 +940,6 @@ sub compile_string { return $compiled_string; } sub unwrap_c { - # Unwrap pandoc's MetaLists, MetaInlines, etc. # Finds the deepest-level scalar value for 'c' in the data structure. # Lists with one element are replaced with the scalar, lists with more |