diff options
| author | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
| commit | 88bf5db0cca989c51237c661a13078eef08b3674 (patch) | |
| tree | 0a84e1b5e7fd239f57fab678bf40c5311b0064a0 /rt/devel/tools/rt-static-docs | |
| parent | 9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (diff) | |
| parent | e7eb845db1afab1cbdbc34ff9c387c5ac554659e (diff) | |
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'rt/devel/tools/rt-static-docs')
| -rw-r--r-- | rt/devel/tools/rt-static-docs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/rt/devel/tools/rt-static-docs b/rt/devel/tools/rt-static-docs index 30d422d04..c8038c028 100644 --- a/rt/devel/tools/rt-static-docs +++ b/rt/devel/tools/rt-static-docs @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -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); } |
