[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] docs: improve index.html generation



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1322583807 0
# Node ID 9c55908af1090b52c47f84a319f925f0805b71c6
# Parent  b264a2618f6cb3cdf67b1a786fa14193fcccb8e6
docs: improve index.html generation

Include hypercall documentation, fixing link generation for top level links to
use the INDEX.

Allow subsection links to be renamedi in the INDEX too.

Strip .txt suffixes as well as .html ones by moving the regex to the right
place instead of placing the literal text "(?:html|txt)" into the backlink to
the top level page. (oops)

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r b264a2618f6c -r 9c55908af109 docs/INDEX
--- a/docs/INDEX        Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/INDEX        Tue Nov 29 16:23:27 2011 +0000
@@ -1,6 +1,10 @@
+hypercall/index                        Hypercall Interfaces
+
+man                            Man Pages
+
+misc                           Miscellaneous Documentation
 misc/hvm-emulated-unplug       Xen HVM emulated device unplug protocol
-
-misc/console.txt               Xen PV Console notes
+misc/console                   Xen PV Console notes
 
 # These are not all that useful anymore, hide them from the index
 reference/interface/index      NO-INDEX
diff -r b264a2618f6c -r 9c55908af109 docs/gen-html-index
--- a/docs/gen-html-index       Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/gen-html-index       Tue Nov 29 16:23:27 2011 +0000
@@ -45,7 +45,7 @@
     }
     else
     {
-        $h1 = "<a href=\"../index.(?:html|txt)\">Xen Documentation</a> - 
$title";
+        $h1 = "<a href=\"../index.html\">Xen Documentation</a> - $title";
         $title = "Xen Documentation - $title";
     }
     $o .= <<END;
@@ -63,7 +63,7 @@
 sub make_linktext ($) {
     my ($l) = @_;
     return "$1($2)" if $l =~ m,^man/(.*)\.([0-9].*)\.html,;
-    $l =~ s/.(html)$//g;
+    $l =~ s/.(?:html|txt)$//g;
     return $index{$l} if exists $index{$l};
     return basename($l);
 }
@@ -109,13 +109,14 @@
     my @d = (grep /^\Q$od\E/, @docs);
     if ( @d == 1 and $d[0] eq "$od/index.html" )
     {
-        $top .= "<li><a href=\"${od}/index.html\">${od}/index.html</a></li>\n";
+        $top .= make_link("$od/index.html", 0);
     }
     else
     {
        my $links = make_links($od,0,@d);
+       my $secttitle = make_linktext($od);
        $top .= <<END;
-<li><a href=\"${od}/index.html\">$od</a></li>
+<li><a href=\"${od}/index.html\">$secttitle</a></li>
 <ul>
 $links
 </ul>
@@ -124,12 +125,12 @@
        $links = make_links($od,1,@d);
         my $idx = '';
        $idx .= <<END;
-<li>$od</li>
+<li>$secttitle</li>
 <ul>
 $links
 </ul>
 END
-        make_page("$outdir/$od/index.html", $od, $idx);
+        make_page("$outdir/$od/index.html", $secttitle, $idx);
     }
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.