]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print inline code for virtual servers
authorAlan T. DeKok <aland@freeradius.org>
Mon, 27 Jan 2025 14:14:46 +0000 (09:14 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 27 Jan 2025 14:14:46 +0000 (09:14 -0500)
scripts/asciidoc/conf2adoc

index ea8b48c5b6dc972c5aff03aa0eda87c9fc32857e..958b31c94c78d85e285e2d6bd8042865fc9ac91e 100755 (executable)
@@ -47,6 +47,9 @@ sub process_file {
        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;
@@ -116,7 +119,7 @@ sub process_file {
                }
 
                if ($raw != $was_raw) {
-                       print $output "```\n" if ($print_code);
+                       print $output "```\n" if ($inline);
                        $was_raw = $raw;
                }
 
@@ -189,7 +192,7 @@ sub process_file {
 
                $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;
@@ -205,7 +208,7 @@ sub process_file {
        #
        #  Terminate any trailing "raw" text.
        #
-       print $output "```\n" if ($print_code);
+       print $output "```\n" if ($inline);
 
        if ($opt_t) {
            print $output "\n";