(mkdoc) make it do a little more post-mkdoc work
This commit is contained in:
parent
cf10f7933c
commit
5d1adc63c2
57
doc/mkdoc
57
doc/mkdoc
|
@ -7,17 +7,45 @@ my $MKD = "./Markdown.pl";
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use lib '../src/Gitolite/Test';
|
||||||
|
use Tsh;
|
||||||
|
|
||||||
chomp(@ARGV = `cat list`) if not @ARGV;
|
$ENV{TSH_ERREXIT} = 1;
|
||||||
@ARGV = grep { $_ ne 'master-toc.mkd' and /./ } @ARGV;
|
|
||||||
my @save = @ARGV;
|
|
||||||
my $css = join("", <DATA>);
|
|
||||||
|
|
||||||
my $mt = "# gitolite master table of contents/index\n";
|
try "
|
||||||
my $mf = '';
|
mkdir ../html; ok
|
||||||
my $fh;
|
git status -s -uno; !/./
|
||||||
|
git log --oneline -1
|
||||||
|
" or die 1;
|
||||||
|
|
||||||
while (<>) {
|
my $head = (lines())[0];
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
|
try "
|
||||||
|
git checkout gh-pages; ok
|
||||||
|
git reset --hard github/gh-pages; ok
|
||||||
|
cd ..; ok
|
||||||
|
git rm g3/*.html; ok
|
||||||
|
mkdir g3; ok
|
||||||
|
mv html/*.html g3; ok
|
||||||
|
git add g3; ok
|
||||||
|
git commit -m '$head'; ok
|
||||||
|
git checkout g3; ok
|
||||||
|
rmdir html; ok
|
||||||
|
" or die 2;
|
||||||
|
|
||||||
|
sub main {
|
||||||
|
chomp(@ARGV = `cat list`) if not @ARGV;
|
||||||
|
@ARGV = grep { $_ ne 'master-toc.mkd' and /./ } @ARGV;
|
||||||
|
my @save = @ARGV;
|
||||||
|
my $css = join("", <DATA>);
|
||||||
|
|
||||||
|
my $mt = "# gitolite master table of contents/index\n";
|
||||||
|
my $mf = '';
|
||||||
|
my $fh;
|
||||||
|
|
||||||
|
while (<>) {
|
||||||
$ARGV =~ /^(?:.*\/)?([^\/]+)\.mkd$/;
|
$ARGV =~ /^(?:.*\/)?([^\/]+)\.mkd$/;
|
||||||
my $b = $1;
|
my $b = $1;
|
||||||
|
|
||||||
|
@ -38,18 +66,18 @@ while (<>) {
|
||||||
$mf .= "[$2]: $b.html" . ($2 ne $b ? "#$2" : "") . "\n" if $2;
|
$mf .= "[$2]: $b.html" . ($2 ne $b ? "#$2" : "") . "\n" if $2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open($fh, ">", "master-toc.mkd")
|
open($fh, ">", "master-toc.mkd")
|
||||||
and print $fh $mt
|
and print $fh $mt
|
||||||
and close $fh;
|
and close $fh;
|
||||||
|
|
||||||
# after this, do this for every mkd (including the master-toc.mkd)
|
# after this, do this for every mkd (including the master-toc.mkd)
|
||||||
|
|
||||||
# cat $css_block > $base.html
|
# cat $css_block > $base.html
|
||||||
# cat $base.mkd $mf | $MKD >> $base.html
|
# cat $base.mkd $mf | $MKD >> $base.html
|
||||||
|
|
||||||
for my $mkd ("master-toc.mkd", @save) {
|
for my $mkd ("master-toc.mkd", @save) {
|
||||||
$mkd =~ /^(?:.*\/)?([^\/]+)\.mkd$/;
|
$mkd =~ /^(?:.*\/)?([^\/]+)\.mkd$/;
|
||||||
my $b = $1;
|
my $b = $1;
|
||||||
|
|
||||||
|
@ -62,6 +90,7 @@ for my $mkd ("master-toc.mkd", @save) {
|
||||||
open($fh, "|-", "$MKD >> ../html/$b.html")
|
open($fh, "|-", "$MKD >> ../html/$b.html")
|
||||||
and print $fh $mkt, $mf
|
and print $fh $mkt, $mf
|
||||||
and close $fh;
|
and close $fh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__DATA__
|
__DATA__
|
||||||
|
|
Loading…
Reference in a new issue