Skip to content

Commit

Permalink
Merge branch '5.0/docs-support-markdown' into 5.0.6-releng
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed May 6, 2024
2 parents 97fa2bb + 56fa50b commit c4fa852
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Dockerfile is for testing only.

FROM bpssysadmin/rt-base-debian:RT-5.0.6-bullseye-20240430
FROM bpssysadmin/rt-base-debian:RT-5.0.6-bullseye-20240506

ENV RT_TEST_PARALLEL 1
ENV RT_TEST_DEVEL 1
Expand Down
34 changes: 22 additions & 12 deletions devel/tools/rt-static-docs
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,32 @@ else {
# the known contents.
for my $file (<README* UPGRADING*>) {
(my $name = $file) =~ s{^.+/}{};
my $dest = "$opts{to}/$name.html";

open my $source, "<", $file
or warn "Can't open $file: $!", next;

my $str = "";
$str .= encode_entities(decode_utf8($_)) while <$source>;
close $source;

$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;
if ( $name =~ s/\.md$// ) {
require Markdown::Render;
my $md = Markdown::Render->new( infile => $file );
$str = $md->render_markdown->get_html;
$str =~ s{\bdocs/images/}{images/}g;
$str = qq{<div class="rt-markdown">$str</div>};
}
else {
open my $source, "<", $file
or warn "Can't open $file: $!", next;

$str .= encode_entities( decode_utf8($_) ) while <$source>;
close $source;

$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;
}

my $dest = "$opts{to}/$name.html";
open my $html, ">", $dest
or warn "Can't open $dest: $!", next;
print $html $str;
Expand Down
4 changes: 2 additions & 2 deletions docs/extensions.pod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ L<http://www.bestpractical.com/rt/extensions.html>

RT extensions should be installed by downloading the C<.tar.gz> file for
the extensions, extracting it (with C<tar xzf filename.tar.gz>), and
following the instructions in its included F<README>.
following the instructions in its included C<README>.

The instructions under C<INSTALLING> in the F<README> always take
The instructions under C<INSTALLING> in the C<README> always take
precedence over those found here. In general, however, the process is
as follows:

Expand Down
2 changes: 1 addition & 1 deletion docs/writing_extensions.pod
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ When you have your extension ready and want to release it to the world, you
can do so with a few simple steps.

Assuming you have run C<perl Makefile.PL> and you created the F<inc/.author>
directory as described above, a F<README> file will be created for you. You can
directory as described above, a C<README> file will be created for you. You can
now type:

make manifest
Expand Down
1 change: 1 addition & 0 deletions etc/cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ on 'develop' => sub {
requires 'Try::Tiny';
requires 'WWW::Mechanize', '>= 1.80';
requires 'XML::Simple';
requires 'Markdown::Render';
};


Expand Down

0 comments on commit c4fa852

Please sign in to comment.