mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
wikiheaders: READMEs go in the base dir of the wiki now.
Reference PR #12529. (and several other issues.)
This commit is contained in:
parent
92a5417a98
commit
2c97a48c51
1 changed files with 14 additions and 23 deletions
|
@ -43,7 +43,6 @@ my $wikiurl = 'https://wiki.libsdl.org';
|
||||||
my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
|
my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
|
||||||
my $srcpath = undef;
|
my $srcpath = undef;
|
||||||
my $wikipath = undef;
|
my $wikipath = undef;
|
||||||
my $wikireadmesubdir = 'README';
|
|
||||||
my $warn_about_missing = 0;
|
my $warn_about_missing = 0;
|
||||||
my $copy_direction = 0;
|
my $copy_direction = 0;
|
||||||
my $optionsfname = undef;
|
my $optionsfname = undef;
|
||||||
|
@ -1033,7 +1032,6 @@ sub generate_quickref {
|
||||||
my $incpath = "$srcpath";
|
my $incpath = "$srcpath";
|
||||||
$incpath .= "/$incsubdir" if $incsubdir ne '';
|
$incpath .= "/$incsubdir" if $incsubdir ne '';
|
||||||
|
|
||||||
my $wikireadmepath = "$wikipath/$wikireadmesubdir";
|
|
||||||
my $readmepath = undef;
|
my $readmepath = undef;
|
||||||
if (defined $readmesubdir) {
|
if (defined $readmesubdir) {
|
||||||
$readmepath = "$srcpath/$readmesubdir";
|
$readmepath = "$srcpath/$readmesubdir";
|
||||||
|
@ -2082,18 +2080,15 @@ if ($copy_direction == 1) { # --copy-to-headers
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $readmepath) {
|
if (defined $readmepath) {
|
||||||
if ( -d $wikireadmepath ) {
|
mkdir($readmepath); # just in case
|
||||||
mkdir($readmepath); # just in case
|
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
|
||||||
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
|
while (readdir(DH)) {
|
||||||
while (readdir(DH)) {
|
my $dent = $_;
|
||||||
my $dent = $_;
|
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
|
||||||
if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here.
|
filecopy("$wikipath/$dent", "$readmepath/$dent", "\n");
|
||||||
next if $1 eq 'FrontPage';
|
|
||||||
filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
closedir(DH);
|
|
||||||
}
|
}
|
||||||
|
closedir(DH);
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
||||||
|
@ -2698,31 +2693,27 @@ __EOF__
|
||||||
# Write out READMEs...
|
# Write out READMEs...
|
||||||
if (defined $readmepath) {
|
if (defined $readmepath) {
|
||||||
if ( -d $readmepath ) {
|
if ( -d $readmepath ) {
|
||||||
mkdir($wikireadmepath); # just in case
|
mkdir($wikipath); # just in case
|
||||||
opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
|
opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
|
||||||
while (my $d = readdir(DH)) {
|
while (my $d = readdir(DH)) {
|
||||||
my $dent = $d;
|
my $dent = $d;
|
||||||
if ($dent =~ /\AREADME\-(.*?\.md)\Z/) { # we only bridge Markdown files here.
|
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
|
||||||
my $wikifname = $1;
|
filecopy("$readmepath/$dent", "$wikipath/$dent", "\n");
|
||||||
next if $wikifname eq 'FrontPage.md';
|
|
||||||
filecopy("$readmepath/$dent", "$wikireadmepath/$wikifname", "\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(DH);
|
closedir(DH);
|
||||||
|
|
||||||
my @pages = ();
|
my @pages = ();
|
||||||
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
|
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
|
||||||
while (my $d = readdir(DH)) {
|
while (my $d = readdir(DH)) {
|
||||||
my $dent = $d;
|
my $dent = $d;
|
||||||
if ($dent =~ /\A(.*?)\.(mediawiki|md)\Z/) {
|
if ($dent =~ /\AREADME\-.*?\.md\Z/) {
|
||||||
my $wikiname = $1;
|
push @pages, $dent;
|
||||||
next if $wikiname eq 'FrontPage';
|
|
||||||
push @pages, $wikiname;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(DH);
|
closedir(DH);
|
||||||
|
|
||||||
open(FH, '>', "$wikireadmepath/FrontPage.md") or die("Can't open '$wikireadmepath/FrontPage.md': $!\n");
|
open(FH, '>', "$wikipath/README.md") or die("Can't open '$wikipath/README.md': $!\n");
|
||||||
print FH "# All READMEs available here\n\n";
|
print FH "# All READMEs available here\n\n";
|
||||||
foreach (sort @pages) {
|
foreach (sort @pages) {
|
||||||
my $wikiname = $_;
|
my $wikiname = $_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue