diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:27:04 -0700 |
| commit | e131b1f71f08b69abb832c1687d1f29682d171f8 (patch) | |
| tree | 490167e41d9fe05b760e7b21a96ee35a86f8edda /rt/devel/tools/rt-static-docs | |
| parent | d05d7346bb2387fd9d0354923d577275c5c7f019 (diff) | |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/devel/tools/rt-static-docs')
| -rw-r--r-- | rt/devel/tools/rt-static-docs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/rt/devel/tools/rt-static-docs b/rt/devel/tools/rt-static-docs index 8ad86b153..c8038c028 100644 --- a/rt/devel/tools/rt-static-docs +++ b/rt/devel/tools/rt-static-docs @@ -54,6 +54,7 @@ use File::Temp; use File::Spec; use File::Path qw(make_path rmtree); use File::Copy qw(copy); +use Encode qw(decode_utf8); use HTML::Entities qw(encode_entities); use RT::Pod::HTMLBatch; @@ -142,14 +143,21 @@ for my $file (<README* UPGRADING*>) { open my $source, "<", $file or warn "Can't open $file: $!", next; - open my $html, ">", $dest - or warn "Can't open $dest: $!", next; + my $str = ""; + $str .= encode_entities(decode_utf8($_)) while <$source>; + close $source; - print $html "<pre>"; - print $html encode_entities($_) while <$source>; - print $html "</pre>"; + $str = "<pre>$str</pre>"; + $str =~ s{\bdocs/([a-z_-]+)\.pod\b}{<a href="$1.html">docs/$1.pod</a>}ig; + $str =~ s{\betc/(RT_Config)\.pm\b}{<a href="$1.html">etc/$1.pm</a>}g; + $str =~ s{\betc/(UPRGADING\.mysql)\b}{<a href="$1.html">etc/$1</a>}g; + $str =~ s{\b(https?://(?!rt\.example\.com)[.a-z0-9/_:-]+(?<!\.))}{<a href="$1">$1</a>}ig; + $str =~ s{\b([\w-]+\@(lists\.)?bestpractical.com)\b}{<a href="mailto:$1">$1</a>}g; - close $source; close $html; + open my $html, ">", $dest + or warn "Can't open $dest: $!", next; + print $html $str; + close $html; $converter->note_for_contents_file([$name], $file, $dest); } |
