- Fix ($user-html-header$) to support <script src="foo">. While the rendered

result of <script> end tag by the DSSSL stylesheet was </script\n> to avoid
  unnecessary spaces after the tag, most of the www browsers and HTML
  processors cannot recognize it as the end of <script>.  To workaround this,
  ($user-html-headers$) now outputs the start and the end tag independently
  in each single line.

- Add %html-header-script% to control if <script> is included in <head>.

- Add html.header.script.google knob for SGML and XML documents in non-DocBook
  DTD.  %html.header.script.google; and $html.header.script.google.

- Add WWWFREEBSDORG make(1) knob to control the <script> inclusion.  Note that
  <script> is disabled temporarily.

Discussed with:	gjb and core
Tested by:	gjb
This commit is contained in:
Hiroki Sato 2012-01-31 02:01:32 +00:00
parent 5e41f5f784
commit a3e34ae400
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=38352
3 changed files with 49 additions and 2 deletions

View file

@ -224,6 +224,9 @@ TEX_CMDSEQ+= \tracingstats=${TRACE}
.if defined(RLE)
PNMTOPSFLAGS+= -rle
.endif
.if defined(WWWFREEBSDORG)
HTMLFLAGS+= -V %html-header-script%
.endif
.if !defined(WITH_INLINE_LEGALNOTICE) || empty(WITH_INLINE_LEGALNOTICE)
HTMLFLAGS+= -V %generate-legalnotice-link%

View file

@ -289,6 +289,9 @@ XSLTPROCOPTS+= --stringparam WEB_PREFIX ${WEB_PREFIX}
.if defined(XML_CATALOG_FILES) && !empty(XML_CATALOG_FILES)
XSLTPROCOPTS+= --nonet --catalogs
.endif
.if defined(WWWFREEBSDORG)
XSLTPROCOPTS+= --param "html.header.script.google" "'INCLUDE'"
.endif
XSLTPROC= env ${XSLTPROC_ENV} ${LOCALBASE}/bin/xsltproc
XMLLINTOPTS= ${XMLLINTFLAGS}

View file

@ -24,8 +24,49 @@
(define %hyphenation% #f) <!-- Silence a warning -->
(define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type")
("CONTENT" "text/html; charset=&doc.html.charset;"))))
<!--
Redefine $user-html-header$ to put </script> in a single line.
This is an ugly hack but it should work.
-->
(define ($user-html-header$ #!optional
(home (empty-node-list))
(up (empty-node-list))
(prev (empty-node-list))
(next (empty-node-list)))
;; Add additional header tags.
(let loop ((tl %html-header-tags%))
(if (or (null? tl) (null? (car tl)))
(empty-sosofo)
(make sequence
(cond
((equal? (normalize "SCRIPT") (car (car tl)))
(make sequence
(make empty-element gi: (car (car tl))
attributes: (cdr (car tl)))
(htmlnewline)
(make formatting-instruction data: "</")
(make formatting-instruction data: "SCRIPT>")))
(else
(make sequence
(make empty-element gi: (car (car tl))
attributes: (cdr (car tl))))))
(loop (cdr tl))))))
<!-- Use javascript for google analytics -->
(define %html-header-script-googlejs%
"http://www.FreeBSD.org/layout/js/google.js")
(define %html-header-script%
#f)
(define %html-header-tags%
(list (quote ("META"
("HTTP-EQUIV" "Content-Type")
("CONTENT" "text/html; charset=&doc.html.charset;")))
(if %html-header-script%
(list "SCRIPT"
(list "TYPE" "text/javascript")
(list "SRC" %html-header-script-googlejs%))
'())))
(define %gentext-nav-use-tables%
;; Use tables to build the navigation headers and footers?