Adding entity to books formatting

Dmitry Morozovsky marck at rinet.ru
Thu Dec 15 08:30:16 UTC 2011


Dear colleagues,

I need an advice from dsl-fu-knowledgeable perswon ;)

Prodded by glebius@, I'm trying to add new entity svnref to generate a link to 
svnweb.

My quick patch stopped with an erro, while generating seems-to-be-correct 
content:

-- 8< --
marck at woozle:~/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook> grep -6i 
svnref freebsd-versions.html
>Dec 12, 2011</TD
><TD
>10-CURRENT after defining boolean true/false in sys/types.h,
                      sizeof(bool) may had changed (rev <A
HREF="http://svnweb.freebsd.org/base?view=revision&revision=228444"
><TT
CLASS="SVNREF"
>228444</TT
></A
>).
                      <TT
CLASS="FILENAME"
>foofile</TT

-- 8< --

The error is unknown element:

/usr/bin/env SP_ENCODING=ISO-8859-1 /usr/local/bin/jade -V html-manifest 
-ioutput.html -d 
/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook/freebsd.dsl 
-ifreebsd.urls.relprefix.4 -V %generate-legalnotice-link% -ioutput.html.images   
-D 
/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook/../../../share/images/books/porters-handbook 
-D /usr/obj/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook -c 
/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/share/sgml/catalog -c 
/lh/home/marck/FreeBSD/doc/share/sgml/catalog -c 
/usr/local/share/sgml/docbook/dsssl/modular/catalog -c 
/usr/local/share/sgml/iso8879/catalog -c /usr/local/share/sgml/jade/catalog -c 
/usr/local/share/sgml/catalog.ports -t sgml 
/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml
/usr/local/bin/jade:/lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml:14547:49:E: 
element "SVNREF" undefined
*** Error code 1

Stop in /lh/home/marck/FreeBSD/doc/en_US.ISO8859-1/books/porters-handbook.


It seems I;ve missed something very similar -- what?

Thanks in advance!

-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck at FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------
-------------- next part --------------
Index: en_US.ISO8859-1/books/porters-handbook/book.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v
retrieving revision 1.1130
diff -u -r1.1130 book.sgml
--- en_US.ISO8859-1/books/porters-handbook/book.sgml	13 Dec 2011 07:30:07 -0000	1.1130
+++ en_US.ISO8859-1/books/porters-handbook/book.sgml	15 Dec 2011 08:12:16 -0000
@@ -14543,7 +14543,11 @@
 		  <row>
 		    <entry>1000002</entry>
 		    <entry>Dec 12, 2011</entry>
-		    <entry>10-CURRENT after defining boolean true/false in sys/types.h, sizeof(bool) may had changed (r228444). 10-CURRENT after xlocale.h had been introduced (r227753).</entry>
+		    <entry>10-CURRENT after defining boolean true/false in sys/types.h,
+		      sizeof(bool) may had changed (rev <svnref>228444</svnref>).
+		      <filename>foofile</filename>.
+		      10-CURRENT after xlocale.h had been introduced (r227753).
+		    </entry>
 		  </row>
 		</tbody>
 	      </tgroup>
Index: share/misc/docbook.css
===================================================================
RCS file: /home/ncvs/doc/share/misc/docbook.css,v
retrieving revision 1.16
diff -u -r1.16 docbook.css
--- share/misc/docbook.css	6 Mar 2011 13:18:58 -0000	1.16
+++ share/misc/docbook.css	15 Dec 2011 08:12:16 -0000
@@ -133,6 +133,10 @@
 	color: #007a00;
 }
 
+SVNREF {
+	color: #007a00;
+}
+
 .GUIMENU, .GUIMENUITEM, .GUISUBMENU,
 .GUILABEL, .INTERFACE,
 .SHORTCUT, .SHORTCUT .KEYCAP {
Index: share/sgml/freebsd-html.dsl
===================================================================
RCS file: /home/ncvs/doc/share/sgml/freebsd-html.dsl,v
retrieving revision 1.8
diff -u -r1.8 freebsd-html.dsl
--- share/sgml/freebsd-html.dsl	5 Sep 2011 23:19:53 -0000	1.8
+++ share/sgml/freebsd-html.dsl	15 Dec 2011 08:12:16 -0000
@@ -206,6 +206,14 @@
               (("ports")   (string-append u "&" "amp;" "manpath=FreeBSD+8.2-RELEASE+and+Ports"))
               (else u))))
 
+        <!-- Specify how to generate the link HREF to SVN revision commit page -->
+	<!-- http://svnweb.freebsd.org/base?view=revision&revision=222741 -->
+	(element svnref
+	      (let ((svnurl	(string-append
+	          "http://svnweb.freebsd.org/base?view=revision" "&" "amp;" "revision="
+		       (data (current-node)))))
+		(create-link (list (list "HREF" svnurl)) ($mono-seq$))))
+
         (element application ($bold-seq$))
 
         (element citerefentry


More information about the freebsd-doc mailing list