From af881c07fa1d210d79878eb5c4bff9f92626ff1d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 27 Apr 2006 08:59:37 +0000 Subject: [PATCH] Added two new params: html.head.legalnotice.link.types and html.head.legalnotice.link.multiple. If the value of the generate.legalnotice.link is non-zero, then the stylesheet generates (in the head section of the HTML source) either a single HTML link element or, if the value of the html.head.legalnotice.link.multiple is non-zero, one link element for each link type specified. Each link has the following attributes: - a rel attribute whose value is derived from the value of html.head.legalnotice.link.types - an href attribute whose value is set to the URL of the file containing the legalnotice - a title attribute whose value is set to the title of the corresponding legalnotice (or a title programatically determined by the stylesheet) For example: Closes #1476450. Thanks to Sam Steingold. --- xsl/html/chunk-common.xsl | 65 +++++++++++++++++ xsl/html/param.ent | 2 + xsl/html/param.xweb | 4 ++ xsl/params/generate.legalnotice.link.xml | 29 ++++++-- .../html.head.legalnotice.link.multiple.xml | 37 ++++++++++ .../html.head.legalnotice.link.types.xml | 72 +++++++++++++++++++ 6 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 xsl/params/html.head.legalnotice.link.multiple.xml create mode 100644 xsl/params/html.head.legalnotice.link.types.xml diff --git a/xsl/html/chunk-common.xsl b/xsl/html/chunk-common.xsl index d6d07be06..31228db6e 100644 --- a/xsl/html/chunk-common.xsl +++ b/xsl/html/chunk-common.xsl @@ -700,6 +700,16 @@ + + + + + + + + @@ -969,6 +979,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/html/param.ent b/xsl/html/param.ent index 73112d4cf..d9211a293 100644 --- a/xsl/html/param.ent +++ b/xsl/html/param.ent @@ -70,6 +70,8 @@ + + diff --git a/xsl/html/param.xweb b/xsl/html/param.xweb index 42abeb77a..020a22794 100644 --- a/xsl/html/param.xweb +++ b/xsl/html/param.xweb @@ -170,6 +170,8 @@ stylesheet like this: &author.othername.in.middle; &generate.legalnotice.link; &generate.revhistory.link; +&html.head.legalnotice.link.types; +&html.head.legalnotice.link.multiple; Reference Pages @@ -535,6 +537,8 @@ around all these parameters. + + diff --git a/xsl/params/generate.legalnotice.link.xml b/xsl/params/generate.legalnotice.link.xml index b2f12a394..e843ec709 100644 --- a/xsl/params/generate.legalnotice.link.xml +++ b/xsl/params/generate.legalnotice.link.xml @@ -14,10 +14,31 @@ Description -If non-zero, the contents of legalnotice are written -to a separate HTML file and a link to the file is -generated. Otherwise, legalnotice contents are rendered on -the title page. +If the value of generate.legalnotice.link +is non-zero, the stylesheet: + + + + writes the contents of legalnotice to a separate + HTML file + + + inserts a hyperlink to the legalnotice file + + + adds (in the HTML head) either a single + link or element or multiple + link elements (depending on the value of the + html.head.legalnotice.link.multiple + parameter), with the value or values derived from the + html.head.legalnotice.link.types + parameter + + + + Otherwise, if generate.legalnotice.link is + zero, legalnotice contents are rendered on the title + page. diff --git a/xsl/params/html.head.legalnotice.link.multiple.xml b/xsl/params/html.head.legalnotice.link.multiple.xml new file mode 100644 index 000000000..5f02ff9c1 --- /dev/null +++ b/xsl/params/html.head.legalnotice.link.multiple.xml @@ -0,0 +1,37 @@ + + +html.head.legalnotice.link.multiple +boolean + + +html.head.legalnotice.link.multiple +Generate multiple link instances in html head for legalnotice? + + + + + + +Description + +If html.head.legalnotice.link.multiple is +non-zero and the value of +html.head.legalnotice.link.types contains +multiple link types, then the stylesheet generates (in the +head section of the HTML source) one +link element for each link type specified. For +example, if the value of +html.head.legalnotice.link.types is +“copyright license”: + + <link rel="copyright" href="ln-id2524073.html" title="Legal Notice"> + <link rel="license" href="ln-id2524073.html" title="Legal Notice"> + + Otherwise, the stylesheet generates generates a single + link instance; for example: + + <link rel="copyright license" href="ln-id2524073.html" title="Legal Notice"> + + + + diff --git a/xsl/params/html.head.legalnotice.link.types.xml b/xsl/params/html.head.legalnotice.link.types.xml new file mode 100644 index 000000000..69313b7d3 --- /dev/null +++ b/xsl/params/html.head.legalnotice.link.types.xml @@ -0,0 +1,72 @@ + + +html.head.legalnotice.link.types +string + + +html.head.legalnotice.link.types +Specifies link types for legalnotice link in html head + + + + +copyright + + + +Description + +The value of +html.head.legalnotice.link.types is a +space-separated list of link types, as described in Section 6.12 +of the HTML 4.01 specification. If the value of the +generate.legalnotice.link parameter is +non-zero, then the stylesheet generates (in the +head section of the HTML source) either a single +HTML link element or, if the value of the +html.head.legalnotice.link.multiple is +non-zero, one link element for each link type +specified. Each link has the following attributes: + + + + a rel attribute whose + value is derived from the value of + html.head.legalnotice.link.types + + + an href attribute whose + value is set to the URL of the file containing the + legalnotice + + + a title attribute whose + value is set to the title of the corresponding + legalnotice (or a title programatically + determined by the stylesheet) + + + +For example: + + <link rel="license" href="ln-id2524073.html" title="Legal Notice"> + + + + About the default value + In an ideal world, the default value of + html.head.legalnotice.link.types would + probably be “license”, since the content of the + DocBook legalnotice is typically license + information, not copyright information. However, the default value + is “copyright” for pragmatic reasons: because + that’s among the set of “recognized link types” listed in Section + 6.12 of the HTML 4.01 specification, and because certain + browsers and browser extensions are preconfigured to recognize that + value. + + + + -- 2.40.0