Merge lp:~kfogel/launchpadlib/426323-apidoc-html-title-attrs into lp:launchpadlib

Proposed by Karl Fogel
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kfogel/launchpadlib/426323-apidoc-html-title-attrs
Merge into: lp:launchpadlib
Diff against target: 84 lines
1 file modified
src/launchpadlib/wadl-to-refhtml.xsl (+9/-9)
To merge this branch: bzr merge lp:~kfogel/launchpadlib/426323-apidoc-html-title-attrs
Reviewer Review Type Date Requested Status
Barry Warsaw code Needs Fixing
Review via email: mp+12442@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Karl Fogel (kfogel) wrote :

This resolves bug #426323.

I tested it by using Markus Korn's script from http://paste.ubuntu.com/267586/ (note that the last few lines of that paste are not the script, but rather instructions for using it). Basically, just do this:

0. cd 426323-apidoc-html-attrs ## Be at the top of the branch
1. ## Get the script, save it as get-wadl.py. ##
2. python get-wadl.py
3. Do the authn dance with Launchpad in your browser. Read-only access is all you need to grant the script.
4. xsltproc -o apidoc.html src/launchpadlib/wadl-to-refhtml.xsl lpapi.wadl
5. ## Point your browser at apidoc.html, hover over stuff to see the titletips appear. ##

That's it!

I also performed this optional step 6:

6. Hope for the recently-committed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=395668 to appear in my browser soon, so titletips don't drop away after five seconds.

Revision history for this message
Barry Warsaw (barry) wrote :

This looks good as it is, but I wondered on irc whether it's possible to test this in the launchpadlib tree. Does launchpadlib already test its wadl? If so, then adding a test for this shouldn't be difficult. If it's not, then we won't worry about it for this branch.

Please try to find Leonard or Francis to find out.

review: Needs Fixing (code)
Revision history for this message
Leonard Richardson (leonardr) wrote :

> This looks good as it is, but I wondered on irc whether it's possible to test
> this in the launchpadlib tree. Does launchpadlib already test its wadl? If
> so, then adding a test for this shouldn't be difficult. If it's not, then we
> won't worry about it for this branch.

There are no tests of the stylesheet in launchpadlib, or anywhere for that matter. I don't recommend making any changes in this branch.

You could write a test that runs the stylesheet on the example WADL in wadllib and then parses the result to prove various things about the translation. This could run within launchpadlib, which already depends on wadllib.

Or you could test the real generated HTML in Launchpad. We already test that the HTML is generated, but we don't look in the file.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/launchpadlib/wadl-to-refhtml.xsl'
2--- src/launchpadlib/wadl-to-refhtml.xsl 2009-09-09 10:17:14 +0000
3+++ src/launchpadlib/wadl-to-refhtml.xsl 2009-09-25 21:55:16 +0000
4@@ -426,7 +426,7 @@
5
6 <!-- Table of contents -->
7 <xsl:template name="table-of-contents">
8- <div id="toc">
9+ <div id="toc" title="toc">
10 <h2>Table of Contents</h2>
11 <h3>Top-level collections</h3>
12 <ul>
13@@ -470,7 +470,7 @@
14
15 <!-- Top level collections container -->
16 <xsl:template name="top-level-collections">
17- <div id="top-level-collections">
18+ <div id="top-level-collections" title="top-level-collections">
19 <h2>Top-level collections</h2>
20
21 <!--
22@@ -505,7 +505,7 @@
23
24 <!-- Documentation for one top-level-collection -->
25 <xsl:template match="wadl:resource_type" mode="top-level-collections">
26- <div id="{@id}" class="top-level-collection">
27+ <div id="{@id}" title="{@id}" class="top-level-collection">
28 <h3><xsl:call-template name="get-title-or-id"/></h3>
29 <xsl:apply-templates select="wadl:doc"/>
30
31@@ -569,7 +569,7 @@
32
33 <!-- Documentation for the standard methods on an entry -->
34 <xsl:template name="standard-methods">
35- <div id="{@id}-standard-methods" class="methods standard">
36+ <div id="{@id}-standard-methods" title="{@id}-standard-methods" class="methods standard">
37 <h4>Standard methods</h4>
38 <dl>
39 <!-- Standard methods are the ones without a ws.op param. -->
40@@ -618,7 +618,7 @@
41 @name = 'GET'][.//wadl:param[@name = 'ws.op']]" />
42
43 <xsl:if test="$operations">
44- <div id="{@id}-custom-GETs" class="methods GETs">
45+ <div id="{@id}-custom-GETs" title="{@id}-custom-GETs" class="methods GETs">
46 <h4>Custom GET methods</h4>
47
48 <xsl:apply-templates select="$operations">
49@@ -634,7 +634,7 @@
50 @name = 'POST'][.//wadl:param[@name = 'ws.op']]" />
51
52 <xsl:if test="$operations">
53- <div id="{@id}-custom-POSTs" class="methods POSTs">
54+ <div id="{@id}-custom-POSTs" title="{@id}-custom-POSTs" class="methods POSTs">
55 <h4>Custom POST methods</h4>
56
57 <xsl:apply-templates select="$operations">
58@@ -646,7 +646,7 @@
59
60 <!-- Container for all the entry types documentation -->
61 <xsl:template name="entry-types">
62- <h2 id="entry-types">Entry types</h2>
63+ <h2 id="entry-types" title="entry-types">Entry types</h2>
64
65 <!-- Process all the resource_types, except the service-root ones,
66 the type describing collections of that type,
67@@ -670,7 +670,7 @@
68
69 <!-- Documentation for one entry-type -->
70 <xsl:template match="wadl:resource_type" mode="entry-types">
71- <h3 id="{@id}"><xsl:call-template name="get-title-or-id"/></h3>
72+ <h3 id="{@id}" title="{@id}"><xsl:call-template name="get-title-or-id"/></h3>
73 <xsl:apply-templates select="wadl:doc"/>
74
75 <xsl:call-template name="entry-uri-doc"/>
76@@ -814,7 +814,7 @@
77 <!-- Documentation for a custom method -->
78 <xsl:template match="wadl:method[.//wadl:param[@name = 'ws.op']]">
79 <div class="method">
80- <h5 id="{@id}"><xsl:value-of
81+ <h5 id="{@id}" title="{@id}"><xsl:value-of
82 select=".//wadl:param[@name = 'ws.op']/@fixed"/></h5>
83 <xsl:choose>
84 <xsl:when test="wadl:doc|wadl:request|wadl:response">

Subscribers

People subscribed via source and target branches