X-Git-Url: http://git.rot13.org/?p=sysadmin-cookbook-html;a=blobdiff_plain;f=bin%2Fhtml.pl;h=6039b361b649dd1bd424b7e9e752fc0656902ce3;hp=fcaeb3447b8a989013d2343107bb25da836cba26;hb=b356e721222c6504f99da41d51206092e3792b3e;hpb=2e42311343086bd64df95273e46cb584b6649453 diff --git a/bin/html.pl b/bin/html.pl index fcaeb34..6039b36 100755 --- a/bin/html.pl +++ b/bin/html.pl @@ -3,7 +3,7 @@ use warnings; use strict; -my $recepies = '/srv/sysadmin-cookbook/recepies'; +my $recepies = 'recepies/'; use File::Find; use File::Slurp; @@ -30,10 +30,11 @@ sub file { my $changes = join("\n", map { my $d = $_->{date}; - $d =~ s{\.\d+Z}{}; + $d =~ s{:\d\d\.\d+Z}{}; $d =~ s{T}{ }; - qq|
  • $_->{msg} $d
  • | - } @{ $log->{logentry} } + my $r = $_->{revision}; + qq|
  • $_->{msg} $d
  • | + } reverse @{ $log->{logentry} } ); $path =~ s{^$recepies/*(.*?[^/]+)$}{$1} || next; @@ -46,7 +47,7 @@ sub file { my @names; find({ follow => 0, no_chdir => 1, wanted => sub { - push @names, $_ unless m{/\.}; + push @names, $_ unless m{/\.} || m{^\.}; }}, $recepies ); my $last_level = 0; @@ -74,6 +75,8 @@ my $to_path = ''; foreach my $path ( sort @names ) { + next if ( -d $path && ! -e "$path/.svn" ); + my $name = $path; $name =~ s{^$recepies.*?([^/]+)$}{$1} || next; next unless $name; @@ -117,7 +120,8 @@ pre.changes { } pre.content { - padding: 1em; + padding: 0.5em; + margin: 1em; background: #eee; } @@ -125,10 +129,15 @@ li .date { font-family: monospace; color: #888; float: right; + margin-right: 1em; } + Creative Commons License + Sysadmin Cookbook by Dobrica Pavlinusic is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Croatia License. +
    + Source code repository | . "
    $toc_html
    " , join("\n", @html)