Skip to content

Commit

Permalink
made links more accessible in documentation browser
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 15, 2014
1 parent e5eadc2 commit 5c597e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,7 +1,8 @@

4.90 2014-03-15
- Removed deprecated to_rel method from Mojo::URL.
- Improved documentation browser to make inline code a little more readable.
- Improved documentation browser with more accessible links and readable
inline code.
- Fixed textarea and title parsing bugs in Mojo::DOM::HTML.

4.89 2014-03-13
Expand Down
6 changes: 4 additions & 2 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -70,8 +70,10 @@ sub _html {

# Rewrite
push @parts, [] if $e->type eq 'h1' || !@parts;
push @{$parts[-1]}, $text, Mojo::URL->new->fragment($anchor);
$e->content($self->link_to($text => $toc, id => $anchor));
my $link = Mojo::URL->new->fragment($anchor);
push @{$parts[-1]}, $text, $link;
my $permalink = $self->link_to('#' => $link, class => 'permalink');
$e->content($permalink . $self->link_to($text => $toc, id => $anchor));
}

# Try to find a title
Expand Down
10 changes: 10 additions & 0 deletions lib/Mojolicious/templates/perldoc.html.ep
Expand Up @@ -26,6 +26,7 @@
color: #2a2a2a;
font-size: 1.5em;
margin: 0;
position: relative;
}
h1 a, h2 a, h3 a { text-decoration: none }
pre {
Expand Down Expand Up @@ -64,6 +65,15 @@
max-width: 1000px;
margin: 0 auto;
}
.permalink {
display: none;
left: -0.75em;
position: absolute;
padding-right: 0.25em;
}
h1:hover .permalink, h2:hover .permalink, h3:hover .permalink {
display: block;
}
% end
</head>
<body>
Expand Down

0 comments on commit 5c597e3

Please sign in to comment.