summaryrefslogtreecommitdiffstats
path: root/scripts/MarkdownBook/Book.pm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/MarkdownBook/Book.pm')
-rw-r--r--scripts/MarkdownBook/Book.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/MarkdownBook/Book.pm b/scripts/MarkdownBook/Book.pm
index 3056a13..7693cb4 100644
--- a/scripts/MarkdownBook/Book.pm
+++ b/scripts/MarkdownBook/Book.pm
@@ -203,16 +203,22 @@ sub _do_gen_toc
$toc .= "\n" if $toc ne '';
if (ref($section) =~ m/^MarkdownBook::Document/) {
next if $section->type() eq 'index';
- $toc .= ' * ';
+ $toc .= ' * [';
$toc .= $section->id();
$toc .= ' ';
$toc .= $section->title();
+ $toc .= '][';
+ $toc .= $section->file();
+ $toc .= ']';
} elsif (ref($section) eq 'MarkdownBook::Section') {
$toc .= ' ' x $section->level();
- $toc .= ($section->level() == 1 ? ' - ' : ' * ');
+ $toc .= ($section->level() == 1 ? ' - [' : ' * [');
$toc .= $section->number();
$toc .= ' ';
$toc .= $section->title();
+ $toc .= '][';
+ $toc .= $section->id();
+ $toc .= ']';
}
}