Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move pragmas to the top
  • Loading branch information
JJ committed Dec 14, 2018
1 parent 4209c9a commit e4cebe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Pod/To/HTML.pm
@@ -1,4 +1,7 @@
unit class Pod::To::HTML;

use MONKEY-SEE-NO-EVAL;

use URI::Escape;
use Template::Mustache;

Expand All @@ -24,12 +27,10 @@ multi method render(Pod::Block $pod, Str :$header = '', Str :$footer = '', Str :
}

multi method render(IO::Path $file, Str :$header = '', Str :$footer = '', Str :head-fields($head) = '', :$default-title = '', :$lang = 'en') {
use MONKEY-SEE-NO-EVAL;
pod2html(EVAL($file.slurp ~ "\n\$=pod"), :$header, :$footer, :$head, :$default-title, :$lang);
}

multi method render(Str $pod-string, Str :$header = '', Str :$footer = '', Str :head-fields($head) = '', :$default-title = '', :$lang = 'en') {
use MONKEY-SEE-NO-EVAL;
pod2html(EVAL($pod-string ~ "\n\$=pod"), :$header, :$footer, :$head, :$default-title, :$lang);
}

Expand Down
3 changes: 3 additions & 0 deletions t/011-external.t
Expand Up @@ -15,7 +15,10 @@ sub test-files( $possible-file-path ) {
my $example-path = $possible-file-path.IO.e??$possible-file-path!!"t/$possible-file-path";

my $a-pod = $example-path.IO.slurp;
my $rendered= Pod::To::HTML.render($example-path.IO);
say $rendered;
my $pod = (EVAL ($a-pod ~ "\n\$=pod")); # use proved pod2onebigpage method
say $pod.perl;
my $r = node2html $pod;
ok( $r, "Converting external" );
unlike( $r, /Pod\:\:To/, "Is not prepending class name" );
Expand Down

0 comments on commit e4cebe3

Please sign in to comment.