From 6af25b204a948d73d1905333f614f5f140a6b4af Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 27 Aug 2019 11:07:49 +0200 Subject: [PATCH] Replace SOURCEURL, fix #111 --- lib/Perl6/Documentable/To/HTML/Wrapper.pm6 | 13 ++++++-- type-graph.txt | 38 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 type-graph.txt diff --git a/lib/Perl6/Documentable/To/HTML/Wrapper.pm6 b/lib/Perl6/Documentable/To/HTML/Wrapper.pm6 index 5811f8d3..83410e95 100644 --- a/lib/Perl6/Documentable/To/HTML/Wrapper.pm6 +++ b/lib/Perl6/Documentable/To/HTML/Wrapper.pm6 @@ -87,8 +87,15 @@ method menu($selected, $pod-path?) { .subst('EDITURL', $edit-url) } -method footer() { - $!footer.subst(/DATETIME/, ~DateTime.now.utc.truncated-to('seconds')); +method footer($pod-path) { + my $new-footer = $!footer.subst(/DATETIME/, ~DateTime.now.utc.truncated-to('seconds')); + if ( $pod-path ) { + my $source-path = $.config.pod-root-path ~ $pod-path; + $new-footer = $new-footer.subst(/SOURCEURL/, $source-path); + $new-footer = $new-footer.subst(/PODPATH/, $pod-path); + } + + $new-footer; } method render($pod, $selected = '', :$pod-path?) { @@ -97,7 +104,7 @@ method render($pod, $selected = '', :$pod-path?) { url => &!rewrite, head => $!head, header => self.menu($selected, $pod-path), - footer => self.footer, + footer => self.footer($pod-path), default-title => $!title-page, css-url => '' ) diff --git a/type-graph.txt b/type-graph.txt new file mode 100644 index 00000000..50857cf3 --- /dev/null +++ b/type-graph.txt @@ -0,0 +1,38 @@ +[basic] +class Perl6::Documentable +class Perl6::Documentable::Registry +class Perl6::Documentable::Primary is Perl6::Documentable +class Perl6::Documentable::Secondary is Perl6::Documentable +class Perl6::Documentable::Index is Perl6::Documentable +class Perl6::Documentable::Config +class Perl6::Documentable::Heading::Actions +class Perl6::Documentable::Heading::Grammar +class Perl6::Documentable::Search + +[basic] +class Perl6::Documentable::DocPage::Factory +class Perl6::Documentable::DocPage::Index +class Perl6::Documentable::DocPage::Index::Language is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Index::Programs is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Index::Type is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::SubIndex::Type is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Index::Routine is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::SubIndex::Routine is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Secondary is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Primary::Type is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Primary::Language is Perl6::Documentable::DocPage +class Perl6::Documentable::DocPage::Primary::Programs is Perl6::Documentable::DocPage +class Perl6::Documentable::To::HTML::Wrapper + +[basic] +role Perl6::Documentable::DocPage + +[exceptions] +class X::Documentable::TitleNotFound is Exception +class X::Documentable::SubtitleNotFound is Exception +class X::Documentable::MissingMetadata is Exception +class X::Documentable::Config::InvalidConfig is Exception +class X::Documentable::TypeNotFound is Exception + +[basic] +enum Kind \ No newline at end of file