https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18817

--- Comment #14 from Jonathan Druart <[email protected]> 
---
Automatic replacement has been done with:

use Modern::Perl;
use File::Slurp;

# examplelistemail:18_miscellaneous.html#example-email-from-list
my $mappings;
for my $line ( split "\n", read_file('mappings.txt') ) {
    chomp $line;
    next unless $line;
    my ( $old_anchor, $link ) = split ':', $line;
    $mappings->{$old_anchor} = $link;
}


my @files = `git grep -l manual.koha-community.org`;
for my $file ( @files ) {
    chomp $file;
    next if $file =~ 'misc/release_notes'; # FIXME What do we do with release
notes?
    say $file;
    my $content = read_file( $file );
    my @content;
    for my $line ( split "\n", $content ) {
        chomp $line;
        # http://manual.koha-community.org/[% helpVersion %]/en/aboutkoha.html
        if ( $line =~ m|manual.koha-community.org/\[% helpVersion
%\]/en/.*\.html#([^"]+)"| ) {
            my $old_anchor = $1;
            if ( exists $mappings->{$old_anchor} ) {
                my $new_anchor = $mappings->{$old_anchor};
                $line =~ s|manual.koha-community.org/\[% helpVersion
%\]/en/[^"]+"|koha-community.org/manual/[% helpVersion %]/html/$new_anchor"|g;
            } else {
                warn "$old_anchor DOES NOT HAVE A MAPPING";
            }
        }
        push @content, $line;
    }
    write_file( $file, join( "\n", @content ) . "\n" );
}


Just for the record.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to