Rewrite to static site
With a complete reorganisation of the directory structure and most of the content converted to pandoc-flavoured markdown. Some TODO's left before this can go live: - Main page - Atom feeds - Bug tracker
This commit is contained in:
parent
5c85a7d32f
commit
6242b2ee9c
291 changed files with 4346 additions and 6141 deletions
55
mkpod.pl
Executable file
55
mkpod.pl
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
package POD2HTML;
|
||||
|
||||
use Pod::Simple::XHTML;
|
||||
@ISA = qw/Pod::Simple::XHTML/;
|
||||
|
||||
sub new {
|
||||
bless shift->SUPER::new(@_), __PACKAGE__;
|
||||
}
|
||||
|
||||
sub resolve_pod_page_link {
|
||||
(undef, $page, $section) = @_;
|
||||
|
||||
$lnk = {
|
||||
'TUWF' => '/tuwf/man',
|
||||
'TUWF::DB' => '/tuwf/man/db',
|
||||
'TUWF::Intro' => '/tuwf/man/intro',
|
||||
'TUWF::Misc' => '/tuwf/man/misc',
|
||||
'TUWF::Request' => '/tuwf/man/request',
|
||||
'TUWF::Response' => '/tuwf/man/response',
|
||||
'TUWF::XML' => '/tuwf/man/xml',
|
||||
'TUWF::Validate' => '/tuwf/man/validate',
|
||||
'' => '',
|
||||
}->{$page||''} // "https://metacpan.org/pod/$page";
|
||||
$lnk .= '#'.($section =~ s/ /-/gr) if $section;
|
||||
$lnk
|
||||
}
|
||||
|
||||
sub resolve_man_page_link {
|
||||
(undef, $page, undef) = @_;
|
||||
|
||||
my $lnk = {qw{
|
||||
globsterctl(1) /globster/ctl
|
||||
globster-launch(1) /globster/launch
|
||||
globster(1) /globster/daemon
|
||||
globster-api(7) /globster/api
|
||||
ncdu(1) /ncdu/man
|
||||
}}->{$page||''} || ($page =~ /(.+)\((.)\)/ and "https://manned.org/$1.$2");
|
||||
$lnk
|
||||
}
|
||||
|
||||
|
||||
$p = POD2HTML->new();
|
||||
$html = '';
|
||||
#$p->anchor_items(1); # pandoc doesn't support this :(
|
||||
$p->output_string(\$html);
|
||||
$p->parse_file(\*STDIN);
|
||||
|
||||
# Some post-processing to improve the pandoc-generated markdown
|
||||
$html =~ s/^ //mg;
|
||||
$html =~ s/<code> //g;
|
||||
$html =~ s/<li><p>/<li>/g;
|
||||
|
||||
print $html;
|
||||
Loading…
Add table
Add a link
Reference in a new issue