my $input = shift;
my $output_file = shift;
my @code = ();
+ my $inline = $print_code;
+
+ $inline = 1 if $input =~ /sites-available/ || $output_file =~ /sites-available/;
if (!defined $output_file) {
$output = STDOUT;
}
if ($raw != $was_raw) {
- print $output "```\n" if ($print_code);
+ print $output "```\n" if ($inline);
$was_raw = $raw;
}
$line =~ s,doc/antora/modules/([^/]+)/pages/(.*)/([^/]+).adoc,xref:reference:$1/$2/$3.adoc[$3],g;
- if (!$print_code) {
+ if (!$inline) {
if ($raw && $was_raw) {
push @code, $line if ($opt_t);
next;
#
# Terminate any trailing "raw" text.
#
- print $output "```\n" if ($print_code);
+ print $output "```\n" if ($inline);
if ($opt_t) {
print $output "\n";