Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: third_party/docbook-xsl-1.78.0/params/webhelp.tree.cookie.id.xml

Issue 1394993002: Doing some cleanup. (Closed) Base URL: https://github.com/dart-lang/www.dartlang.org.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="5.0" xml:id="webhelp.tree.cookie.id">
7 <refmeta>
8 <refentrytitle>webhelp.tree.cookie.id</refentrytitle>
9 <refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
10 </refmeta>
11 <refnamediv>
12 <refname>webhelp.tree.cookie.id</refname>
13 <refpurpose>Controls how the cookie that stores the webhelp toc state is named.< /refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17 <src:fragment xml:id="webhelp.tree.cookie.id.frag">
18 <xsl:param name="webhelp.tree.cookie.id" select="concat( 'treeview-', count(//no de()) )"/>
19 </src:fragment>
20 </refsynopsisdiv>
21
22 <refsection><info><title>Description</title></info>
23 <para>The webhelp output does not use a frameset. Instead, the table of contents is a div on each page. To preserve the state of the table of contents as the us er navigates from page to page, webhelp stores the state in a cookie and reads t hat cookie when you get to the next page. If you've published several webhelp do cuments on the same domain, it is important that each cookie have a unique id. I n lieu of calling on a GUID generator, by default this parameter is just set to the number of nodes in the document on the assumption that it is unlikely that y ou will have more than one document with the exact number of nodes. A more optim al solution would be for the user to pass in some unique, stable identifier from the build system to use as the webhelp cookie id. For example, if you have safe guards in place to ensure that the xml:id of the root element of each document w ill be unique on your site, then you could set webhelptree.cookie.id as follows:
24 <programlisting><![CDATA[
25 <xsl:param name="webhelp.tree.cookie.id">
26 <xsl:choose>
27 <xsl:when test="/*/@xml:id">
28 <xsl:value-of select="concat('treeview-',/*/@xml:id)"/>
29 </xsl:when>
30 <xsl:otherwise>
31 <xsl:value-of select="concat( 'treeview-', count(//node()) )"/>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:param>]]>
35 </programlisting>
36 </para>
37 </refsection>
38 </refentry>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698