aboutsummaryrefslogtreecommitdiffstats
path: root/docs/gen-html-index
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-09-11 10:48:19 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-09-17 17:03:54 +0100
commitd3900dea28f9ab8207c35365b5fee2058b68fe91 (patch)
treef5b0dfd717f5cc5795bcfd5101d0f9b558d7a52e /docs/gen-html-index
parent730127d4a1f5fa60082c86e03e3b872b8e934819 (diff)
downloadxen-d3900dea28f9ab8207c35365b5fee2058b68fe91.tar.gz
xen-d3900dea28f9ab8207c35365b5fee2058b68fe91.tar.bz2
xen-d3900dea28f9ab8207c35365b5fee2058b68fe91.zip
docs: fix documentation index for hypercalls
This was broken by 118104e5eaf2 "docs: Build docs for ARM as well as x86_64". Move docs to hypercall/ARCH instead of hypercall-ARCH. Support mulitple levels of subdirectories in gen-html-index tool. This removes the need for a symlink hypercall->hypercall-x86_64 since there is now a proper index at hypercall/index.html. Update INDEX to human readable names for the architecture specific hypercalls. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'docs/gen-html-index')
-rw-r--r--docs/gen-html-index33
1 files changed, 24 insertions, 9 deletions
diff --git a/docs/gen-html-index b/docs/gen-html-index
index 7b36a191e3..e9792bf937 100644
--- a/docs/gen-html-index
+++ b/docs/gen-html-index
@@ -71,16 +71,16 @@ sub make_link ($$) {
my ($ref,$base) = @_;
my $txt = make_linktext($ref);
- $ref = basename($ref) if $base;
+ $ref =~ s,^$base/,, if $base; #/
return "<li><a href=\"$ref\">$txt</a></li>\n";
}
-sub make_links ($$@) {
- my ($dir,$base,@docs) = @_;
+sub make_links ($@) {
+ my ($dir,@docs) = @_;
my $idx = '';
foreach my $of (sort { make_linktext($a) cmp make_linktext($b) } @docs) {
- $idx .= make_link($of,$base);
+ $idx .= make_link($of,$dir);
}
return $idx;
}
@@ -103,22 +103,37 @@ sub uniq (@) {
foreach (@_) { $h{$_} = 1; }
return keys %h;
}
-
+
for (@docs) { s,^\Q$outdir\E/,, }
@docs = grep { -e "$outdir/$_" && (make_linktext($_) ne "NO-INDEX") } @docs;
my $top = '';
-foreach my $od (sort { $a cmp $b } uniq map { dirname($_) } @docs) {
+# Return a list of all directories leading to $path
+sub dirs($)
+{
+ my ($path) = @_;
+ my @dirs;
+ while ( $path =~ m,/, )
+ {
+ $path =~ m,/([^/]+)$,;
+ push @dirs, $`;#`
+ $path = $`;#`
+ }
+ return @dirs;
+}
+
+foreach my $od (sort { $a cmp $b } uniq map { dirs($_) } @docs) {
my @d = (grep /^\Q$od\E/, @docs);
if ( @d == 1 and $d[0] eq "$od/index.html" )
{
+ next if $d[0] =~ m,/,;#/ linked to from the subdirectory entry.
$top .= make_link("$od/index.html", 0);
}
else
{
- my $links = make_links($od,0,@d);
+ my $links = make_links(undef,@d);
my $secttitle = make_linktext($od);
$top .= <<END;
<li><a href=\"${od}/index.html\">$secttitle</a></li>
@@ -127,8 +142,8 @@ $links
</ul>
END
- $links = make_links($od,1,@d);
- my $idx = '';
+ $links = make_links($od,@d);
+ my $idx = '';
$idx .= <<END;
<li>$secttitle</li>
<ul>