]> git.proxmox.com Git - pve-docs.git/commitdiff
asciidoc-pve.in: use new mediawiki.conf to render wiki pages
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Oct 2016 06:13:04 +0000 (08:13 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Oct 2016 06:15:16 +0000 (08:15 +0200)
asciidoc-pve.in

index 5ad2a715d190ff87ce34383edadd67b30f27ef9a..878fe51772ce82481fa2fbe465046def340e624b 100644 (file)
@@ -6,6 +6,7 @@ use Getopt::Long;
 use File::Path;
 use File::Basename;
 use IO::File;
 use File::Path;
 use File::Basename;
 use IO::File;
+use Cwd;
 
 use JSON;
 
 
 use JSON;
 
@@ -372,10 +373,20 @@ sub compile_asciidoc {
        $attributes->{icons} = undef;
        $attributes->{'data-uri'} = undef;
 
        $attributes->{icons} = undef;
        $attributes->{'data-uri'} = undef;
 
-       my $cmd = ['asciidoc', '-b', 'html5'];
+       my $cmd = ['asciidoc'];
 
 
-       push @$cmd, '-s' if ($env eq 'wiki') ||
-           (($env eq 'manvolnum') && ($man_target eq 'wiki'));
+       if (($env eq 'wiki') ||
+           (($env eq 'manvolnum') && ($man_target eq 'wiki'))) {
+
+           push @$cmd, '-s';
+
+           if (-f "./asciidoc/mediawiki.conf") {
+               my $cwd = getcwd();
+               push @$cmd, '-b', "$cwd/asciidoc/mediawiki";
+           } else {
+               push @$cmd, '-b', "mediawiki";
+           }
+       }
 
        foreach my $key (keys %$attributes) {
            my $value = $attributes->{$key};
 
        foreach my $key (keys %$attributes) {
            my $value = $attributes->{$key};