diff options
Diffstat (limited to '.ikiwiki/IkiWiki')
-rwxr-xr-x | .ikiwiki/IkiWiki/Plugin/pandoc.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/.ikiwiki/IkiWiki/Plugin/pandoc.pm b/.ikiwiki/IkiWiki/Plugin/pandoc.pm index 573617a..aa5bcd0 100755 --- a/.ikiwiki/IkiWiki/Plugin/pandoc.pm +++ b/.ikiwiki/IkiWiki/Plugin/pandoc.pm @@ -1,6 +1,8 @@ #!/usr/bin/env perl +# DEBUG $DB::single = 1; +# END package IkiWiki::Plugin::pandoc; @@ -11,8 +13,9 @@ use FileHandle; use IPC::Open2; use File::Path qw/make_path/; use JSON; -use Data::Dumper; +# DEBUG +use Data::Dumper; $Data::Dumper::Indent = 3; my $fh = undef; @@ -23,6 +26,7 @@ my $next = 0; my $base = '/tmp/pandoc'; mkdir($base); +# END # activate with 'generate_$format' in meta; turn on all with 'generate_all_formats'. my %extra_formats = ( @@ -52,6 +56,8 @@ my @list_hash_meta_keys = qw/ references /; + +# DEBUG setup filename function sub debug_get_filename_prefix { my $place = shift; @@ -72,6 +78,7 @@ sub debug_get_filename_prefix { } return $fnm_pfx; } +# END # DEBUG Print print "D: pandoc: First file read.\n"; @@ -723,8 +730,10 @@ sub htmlize ($@) { waitpid $to_html_pid, 0; + # DEBUG print "D: pandoc:htmlize: Pandoc command: ", " ", $command, " ", '-f', " ", 'json', " ", '-t', $htmlformat, " ", @html_args, "\n"; + # END $content = Encode::decode_utf8(join('', @html)); @@ -846,7 +855,9 @@ sub pageactions { my %args = @_; my $page = $args{page}; + # DEBUG print "D: pandoc:pageactions: Run for ", $page, "\n"; + # END my @links = (); return unless $pagestate{$page}{pandoc_extra_formats}; @@ -926,9 +937,11 @@ sub export_file { print EXPORT $json_content; close EXPORT or die "Could not close pipe for $ext: $!"; + # DEBUG print "D: pandoc:export_file: Pandoc command: ", " ", $command, " ", '-f' => 'json', " ", '-t' => $to_format, " ", '-o' => $tmp_export_path, " ", @args, " ", @extra_args; + # DEBUG if ($indirect_pdf && $tmp_export_path ne $export_path) { my @latexmk_args = qw(-quiet -silent); |