Skip to content

Commit 5ef62d6

Browse files
committed
Adds debugging
1 parent d282651 commit 5ef62d6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/Pod/To/HTML.pm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ multi method render(Pod::Block $pod, Str :$header = '', Str :$footer = '', Str :
2626
}
2727

2828
multi method render(IO::Path $file, Str :$header = '', Str :$footer = '', Str :head-fields($head) = '', :$default-title = '', :$lang = 'en') {
29-
30-
pod2html(load($file), :$header, :$footer, :$head, :$default-title, :$lang);
29+
Debug { note colored("Rendering with IO::Path", "bold") ~ load($file).perl }
30+
31+
pod2html(load($file), :$header, :$footer, :$head, :$default-title, :$lang);
3132
}
3233

3334
multi method render(Str $pod-string, Str :$header = '', Str :$footer = '', Str :head-fields($head) = '', :$default-title = '', :$lang = 'en') {
34-
pod2html($pod-string, :$header, :$footer, :$head, :$default-title, :$lang);
35+
pod2html(load($pod-string), :$header, :$footer, :$head, :$default-title, :$lang);
3536
}
3637

3738
# FIXME: this code's a horrible mess. It'd be really helpful to have a module providing a generic
@@ -184,6 +185,7 @@ sub pod2html(
184185
#| Keep count of how many footnotes we've output.
185186
my Int $*done-notes = 0;
186187
&OUTER::url = &url;
188+
Debug { note colored("About to call node2html ", "bold") ~ $pod.perl };
187189
@body.push: node2html($pod.map: { visit $_, :assemble(&assemble-list-items) });
188190
my $title_html = $title // $default-title // '';
189191

@@ -478,7 +480,8 @@ multi sub node2html(Pod::Item $node) {
478480
}
479481

480482
multi sub node2html(Positional $node) {
481-
return $node.map({ node2html($_) }).join
483+
Debug { note colored("Positional node2html called for ", "bold") ~ $node.gist };
484+
return $node.map({ node2html($_) }).join
482485
}
483486

484487
multi sub node2html(Str $node) {

t/012-multi.t

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use Test; # -*- mode: perl6 -*-
22
use Pod::To::HTML;
3-
plan 9;
3+
plan 1;
44

55
my $example-path = "multi.pod6".IO.e??"multi.pod6"!!"t/multi.pod6";
66

77
my $a-pod = $example-path.IO.slurp;
88
my $rendered= Pod::To::HTML.render($example-path.IO);
9-
say $rendered.perl;
10-
like( $rendered, /magicians/, "Is including the whole file" );
9+
like( $rendered, /magicians/, "Is rendering the whole file" );
1110

0 commit comments

Comments
 (0)