[libvirt] [PATCH 0/4] Various minor fixes

I stumbled upon few things that would be nice to have when fixed, so I separated them into sensible groups. Martin Kletzander (4): docs: allow custom link elements docs: fix 404 page when fetched from different location docs: update and fix search page docs/virsh: various minor fixes docs/404.html.in | 5 ++- docs/api_extension.html.in | 4 -- docs/page.xsl | 3 ++ docs/pending.html.in | 4 -- docs/search.php | 80 +++++++++++++++++++++++++++++-------------- tools/virsh.c | 4 +- 6 files changed, 63 insertions(+), 37 deletions(-) -- 1.7.8.6

This patch makes custom <link> elements possible to be specified in individual pages when needed. --- docs/page.xsl | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/docs/page.xsl b/docs/page.xsl index fc782a2..3f98942 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -136,7 +136,10 @@ <head> <link rel="stylesheet" type="text/css" href="{$href_base}main.css"/> <link rel="SHORTCUT ICON" href="{$href_base}32favicon.png"/> + <xsl:apply-templates select="/html/head/link" mode="content" /> + <title>libvirt: <xsl:value-of select="html/body/h1"/></title> + <meta name="description" content="libvirt, virtualization, virtualization API"/> </head> <body> -- 1.7.8.6

Error 404 page had relative paths specified for both the image and stylesheets which caused a problem when requested URL included a subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects this behaviour. --- docs/404.html.in | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/docs/404.html.in b/docs/404.html.in index 9363871..66e4c14 100644 --- a/docs/404.html.in +++ b/docs/404.html.in @@ -1,5 +1,8 @@ <?xml version="1.0"?> <html> + <head> + <link rel="stylesheet" type="text/css" href="/main.css" /> + </head> <body> <h1>404 page not found</h1> @@ -15,7 +18,7 @@ </ul> <p class="image"> - <img src="libvirtLogo404.png" alt="libvirt Logo"/> + <img src="/libvirtLogo404.png" alt="libvirt Logo"/> </p> -- 1.7.8.6

On Thu, Jun 21, 2012 at 12:18:12PM +0200, Martin Kletzander wrote:
Error 404 page had relative paths specified for both the image and stylesheets which caused a problem when requested URL included a subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects this behaviour. --- docs/404.html.in | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/docs/404.html.in b/docs/404.html.in index 9363871..66e4c14 100644 --- a/docs/404.html.in +++ b/docs/404.html.in @@ -1,5 +1,8 @@ <?xml version="1.0"?> <html> + <head> + <link rel="stylesheet" type="text/css" href="/main.css" /> + </head>
The page.xsl already generates a <head> section with a <link> element. What you need todo is fix site.xsl to use '/' as the href_base. In fact if we just used '/' as href_base, then we can remove the subsite.xsl entirely.
<body> <h1>404 page not found</h1>
@@ -15,7 +18,7 @@ </ul>
<p class="image"> - <img src="libvirtLogo404.png" alt="libvirt Logo"/> + <img src="/libvirtLogo404.png" alt="libvirt Logo"/> </p>
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/21/2012 12:24 PM, Daniel P. Berrange wrote:
On Thu, Jun 21, 2012 at 12:18:12PM +0200, Martin Kletzander wrote:
Error 404 page had relative paths specified for both the image and stylesheets which caused a problem when requested URL included a subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects this behaviour. --- docs/404.html.in | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/docs/404.html.in b/docs/404.html.in index 9363871..66e4c14 100644 --- a/docs/404.html.in +++ b/docs/404.html.in @@ -1,5 +1,8 @@ <?xml version="1.0"?> <html> + <head> + <link rel="stylesheet" type="text/css" href="/main.css" /> + </head>
The page.xsl already generates a <head> section with a <link> element. What you need todo is fix site.xsl to use '/' as the href_base. In fact if we just used '/' as href_base, then we can remove the subsite.xsl entirely.
I haven't noticed that, thanks. OK, so I deleted subsite.xsl, replaced it with site.xsl, but internals/*.html are still generated with ../main.css, which is ok, but its not what I meant to achieve. The only place where href_base is set to '../' is newapi.xsl, but that one is used only for libvirt-api.xml if I read the rules and Makefiles correctly. Anyway, I'll send a v2 for this.
<body> <h1>404 page not found</h1>
@@ -15,7 +18,7 @@ </ul>
<p class="image"> - <img src="libvirtLogo404.png" alt="libvirt Logo"/> + <img src="/libvirtLogo404.png" alt="libvirt Logo"/> </p>
Daniel

On Thu, Jun 21, 2012 at 01:47:40PM +0200, Martin Kletzander wrote:
On 06/21/2012 12:24 PM, Daniel P. Berrange wrote:
On Thu, Jun 21, 2012 at 12:18:12PM +0200, Martin Kletzander wrote:
Error 404 page had relative paths specified for both the image and stylesheets which caused a problem when requested URL included a subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects this behaviour. --- docs/404.html.in | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/docs/404.html.in b/docs/404.html.in index 9363871..66e4c14 100644 --- a/docs/404.html.in +++ b/docs/404.html.in @@ -1,5 +1,8 @@ <?xml version="1.0"?> <html> + <head> + <link rel="stylesheet" type="text/css" href="/main.css" /> + </head>
The page.xsl already generates a <head> section with a <link> element. What you need todo is fix site.xsl to use '/' as the href_base. In fact if we just used '/' as href_base, then we can remove the subsite.xsl entirely.
I haven't noticed that, thanks. OK, so I deleted subsite.xsl, replaced it with site.xsl, but internals/*.html are still generated with ../main.css, which is ok, but its not what I meant to achieve. The only place where href_base is set to '../' is newapi.xsl, but that one is used only for libvirt-api.xml if I read the rules and Makefiles correctly.
Unfortunately I've just realized we can't do what I suggested, because that only works if browsing the pages via apache. If you just point your web browser at /usr/share/doc/libvirt, then all the CSS links will be broken. So we need to keep the relative href_base, but in site.xsl, add a special case setting href_base to '/', /only/ for the 404.html page Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Search page had old and shifted menu under the whole content. This patch moves the menu before the content, which makes it appear correctly as on other pages, and updates it to the newest look. --- docs/search.php | 76 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 52 insertions(+), 24 deletions(-) diff --git a/docs/search.php b/docs/search.php index 768e06f..d768ae1 100644 --- a/docs/search.php +++ b/docs/search.php @@ -16,6 +16,57 @@ <div id="headerLogo"></div> </div> <div id="body"> + <div id="menu"> + <ul class="l0"><li> + <div> + <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a> + </div> + </li><li> + <div> + <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a> + </div> + </li><li> + <div> + <a title="Applications known to use libvirt" class="inactive" href="apps.html">Applications</a> + </div> + </li><li> + <div> + <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a> + </div> + </li><li> + <div> + <a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a> + </div> + </li><li> + <div> + <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a> + </div> + </li><li> + <div> + <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a> + </div> + </li><li> + <div> + <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a> + </div> + </li><li> + <div> + <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a> + </div> + </li><li> + <div> + <a title="Available test suites for libvirt" class="inactive" href="testsuites.html">Test suites</a> + </div> + </li><li> + <div> + <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a> + </div> + </li><li> + <div> + <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a> + </div> + </li></ul> + </div> <div id="content"> <?php $query = $_GET['query']; @@ -243,30 +294,7 @@ } } ?> - <img src="libvirtLogo.png" alt="libvirt Logo" /> - </div> - <div id="menu"> - <ul class="l0"><li> - <span class="active">Home</span> - </li><li> - <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a> - </li><li> - <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a> - </li><li> - <a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a> - </li><li> - <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a> - </li><li> - <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a> - </li><li> - <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a> - </li><li> - <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a> - </li><li> - <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a> - </li><li> - <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a> - </li></ul> + <img src="libvirtLogo.png" alt="libvirt Logo" /> </div> </div> <div id="footer"> -- 1.7.8.6

On Thu, Jun 21, 2012 at 12:18:13PM +0200, Martin Kletzander wrote:
Search page had old and shifted menu under the whole content. This patch moves the menu before the content, which makes it appear correctly as on other pages, and updates it to the newest look. --- docs/search.php | 76 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 52 insertions(+), 24 deletions(-)
This is just replacing one set of hardcoded content with another set. What is needed here is to rename it to search.php.in and then process it with the XSL templates as we do for all the other pages. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/21/2012 12:28 PM, Daniel P. Berrange wrote:
On Thu, Jun 21, 2012 at 12:18:13PM +0200, Martin Kletzander wrote:
Search page had old and shifted menu under the whole content. This patch moves the menu before the content, which makes it appear correctly as on other pages, and updates it to the newest look. --- docs/search.php | 76 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 52 insertions(+), 24 deletions(-)
This is just replacing one set of hardcoded content with another set.
What is needed here is to rename it to search.php.in and then process it with the XSL templates as we do for all the other pages.
Daniel
Yes, that definitely seems more logical and clean, I just didn't want to change it that much. But if you're ok with that, I'll follow with v2 in a moment. Martin

List: - some old libvir/libvirt rename leftovers (the only problem can be if somebody parses 'virsh version' output really badly) - remove pointless tags specified in some pages that are not used --- docs/api_extension.html.in | 4 ---- docs/pending.html.in | 4 ---- docs/search.php | 4 ++-- tools/virsh.c | 4 ++-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/api_extension.html.in b/docs/api_extension.html.in index 8d74752..83c488c 100644 --- a/docs/api_extension.html.in +++ b/docs/api_extension.html.in @@ -1,8 +1,4 @@ <html> - <head> - <title>Implementing a new API in Libvirt</title> - </head> - <body> <h1>Implementing a new API in Libvirt</h1> diff --git a/docs/pending.html.in b/docs/pending.html.in index 7a31878..f2978bf 100644 --- a/docs/pending.html.in +++ b/docs/pending.html.in @@ -1,8 +1,4 @@ <html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Pending patches needing review</title> - </head> <body> <h1>Pending patches needing review</h1> <p> A list of pending patches needing review upstream is available diff --git a/docs/search.php b/docs/search.php index d768ae1..c203c7d 100644 --- a/docs/search.php +++ b/docs/search.php @@ -8,7 +8,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" type="text/css" href="main.css" /> <link rel="SHORTCUT ICON" href="32favicon.png" /> - <title>Search the documentation on Libvir.org</title> + <title>Search the documentation on Libvirt.org</title> <meta name="description" content="libvirt, virtualization, virtualization API" /> </head> <body> @@ -73,7 +73,7 @@ // We handle only the first argument so far $query = ltrim ($query); if (! $query) { - echo "<h1 align='center'>Search the documentation on Libvir.org</h1>"; + echo "<h1 align='center'>Search the documentation on Libvirt.org</h1>"; } $scope = $_GET['scope']; if ($scope == NULL) diff --git a/tools/virsh.c b/tools/virsh.c index a117424..8052d8d 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -13126,7 +13126,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) includeVersion %= 1000000; minor = includeVersion / 1000; rel = includeVersion % 1000; - vshPrint(ctl, _("Compiled against library: libvir %d.%d.%d\n"), + vshPrint(ctl, _("Compiled against library: libvirt %d.%d.%d\n"), major, minor, rel); ret = virGetVersion(&libVersion, hvType, &apiVersion); @@ -13138,7 +13138,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) libVersion %= 1000000; minor = libVersion / 1000; rel = libVersion % 1000; - vshPrint(ctl, _("Using library: libvir %d.%d.%d\n"), + vshPrint(ctl, _("Using library: libvirt %d.%d.%d\n"), major, minor, rel); major = apiVersion / 1000000; -- 1.7.8.6
participants (2)
-
Daniel P. Berrange
-
Martin Kletzander