From dave at badgers-in-foil.co.uk Sun Jan 2 23:51:25 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sun, 2 Jan 2005 23:51:25 +0000 Subject: [docbook-css] Generating URLs for empty Message-ID: <20050102235124.GA20471@vhost.badgers-in-foil.co.uk> is supposed to generate content if it's empty. I've added this rule to do this: ulink:empty:after { content: " <" attr(url) ">"; } The :empty selector is CSS3, but seems to have been implemented in Gecko. dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Mon Jan 3 01:33:46 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 3 Jan 2005 01:33:46 +0000 Subject: [docbook-css] support Message-ID: <20050103013346.GB20471@vhost.badgers-in-foil.co.uk> --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've been playing with adding Mozilla support for internal links within a document using the DocBook element. Getting clickable links was fairly easy in the end, but I've come across a sticky problem generating the content for the . content is typically derived from the element targeted by the element's 'linkend' attribute. I therefore implemented some code to have Mozilla retrieve the referenced element for interrogation. The JavaScript 'getElementById(...)' would normally be the thing to use for this, so I was a bit surprised when it didn't work. It turns out, however that the 'Id' in getElementById doesn't refer to an 'id' attribute as I'd thought, but to attributes of type 'ID', as defined by the document's DTD. Mozilla doesn't inspect the DTD specified for XML documents, so the current implementation can never find the target of an . I've found that my testcase starts working if the ID attributes are defined in an internal subset of the DOCTYPE, like this: ...etc... ]> This is a nasty hack though, so I strongly recommend against it. dave -- http://david.holroyd.me.uk/ --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xref_support-patch1.diff" Index: db-bindings.xml =================================================================== RCS file: /var/lib/cvs/docbook-css/db-bindings.xml,v retrieving revision 1.5 diff -u -r1.5 db-bindings.xml --- db-bindings.xml 16 Oct 2004 22:40:50 -0000 1.5 +++ db-bindings.xml 3 Jan 2005 00:43:53 -0000 @@ -1,6 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: mozilla.css =================================================================== RCS file: /var/lib/cvs/docbook-css/mozilla.css,v retrieving revision 1.6 diff -u -r1.6 mozilla.css --- mozilla.css 21 Nov 2004 19:34:59 -0000 1.6 +++ mozilla.css 3 Jan 2005 00:43:53 -0000 @@ -17,6 +17,11 @@ /* make s clickable */ ulink { -moz-binding:url('db-bindings.xml#ulink'); +} +xref { + -moz-binding:url('db-bindings.xml#xref'); +} +ulink, xref { cursor: pointer; -moz-user-focus: normal; } Index: styles.css =================================================================== RCS file: /var/lib/cvs/docbook-css/styles.css,v retrieving revision 1.10 diff -u -r1.10 styles.css --- styles.css 2 Jan 2005 23:52:32 -0000 1.10 +++ styles.css 3 Jan 2005 00:43:53 -0000 @@ -348,12 +348,20 @@ content: "]"; } -xref:after { - /* simple symbol - content: "#" attr(linkend);*/ - /* 'section' symbol */ - content: "\00a7" attr(linkend); +/* TODO: group with other 'link' styles */ +xref { color:#0000ff; text-decoration: underline; +} +xref:before { + /* + * Generates a section symbol before the xref, to try and indicate + * that there is 'something' here (this will hopefully make + * surrounding text that refers to 'see ...' make sense). We could + * insert attr(linkend) too, but that would clash with the presentation + * in Mozilla, where we are able to generate better content text. + */ + content: "\00a7"; } blockquote { --vtzGhvizbBRQ85DL-- From dave at badgers-in-foil.co.uk Mon Jan 3 15:22:11 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 3 Jan 2005 15:22:11 +0000 Subject: [docbook-css] numeration Message-ID: <20050103152211.GB1010@vhost.badgers-in-foil.co.uk> These rules, just added to styles.css, allow for the different possible values of the 'numeration' attribute for : orderedlist[numeration=loweralpha] { list-style-type: lower-alpha; } orderedlist[numeration=upperalpha] { list-style-type: upper-alpha; } orderedlist[numeration=lowerroman] { list-style-type: lower-roman; } orderedlist[numeration=upperroman] { list-style-type: upper-roman; } dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Mon Jan 3 15:44:41 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 3 Jan 2005 15:44:41 +0000 Subject: [docbook-css] Inline Images: Changes to styles.css In-Reply-To: References: Message-ID: <20050103154440.GC1010@vhost.badgers-in-foil.co.uk> On Fri, Nov 19, 2004 at 01:49:24PM +0000, martin.gautier@myrnham.co.uk wrote: > Changes to styles.css > > /*imageobject { > display: block; > } */ You're correct, that rule shouldn't have been there. I've removed it. dave -- http://david.holroyd.me.uk/ From martin.gautier at myrnham.co.uk Thu Jan 20 18:14:14 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 18:14:14 +0000 Subject: [docbook-css] New mod. - revhistory Message-ID: I've just added the following to my customisation layer. I don't think it's something I'd want to see via the Browser under normal usage... revhistory { display: none; } From martin.gautier at myrnham.co.uk Thu Jan 20 18:18:12 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 18:18:12 +0000 Subject: [docbook-css] ulinks Message-ID: What's the deal with ulinks currently? ie. This book lives at Should these display as links in Firefox? Mart From martin.gautier at myrnham.co.uk Thu Jan 20 18:25:34 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 18:25:34 +0000 Subject: [docbook-css] Another New Mod - titleabbrev Message-ID: >From DB:TDG [Processing Expectations]...Abbreviated titles are usually used only in specific contexts, such as headers and footers, and suppressed everywhere else. On this basis, I'm suppressing css processing this in my customisation layer. Mart From dave at badgers-in-foil.co.uk Thu Jan 20 18:14:34 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 20 Jan 2005 18:14:34 +0000 Subject: [docbook-css] ulinks In-Reply-To: References: Message-ID: <20050120181434.GB26276@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 06:18:12PM +0000, martin.gautier@myrnham.co.uk wrote: > What's the deal with ulinks currently? > > ie. This book lives at url="http://www.linktomywebsite.org/"/> > > Should these display as links in Firefox? I've comitted support for this to CVS, but it's not in the distributed stylesheets yet -- those only allow for s that contain content. See my earlier message: http://lists.badgers-in-foil.co.uk/pipermail/docbook-css/2005-January/000039.html dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Thu Jan 20 18:19:13 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 20 Jan 2005 18:19:13 +0000 Subject: [docbook-css] New mod. - revhistory In-Reply-To: References: Message-ID: <20050120181912.GC26276@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 06:14:14PM +0000, martin.gautier@myrnham.co.uk wrote: > I've just added the following to my customisation layer. I don't think > it's something I'd want to see via the Browser under normal usage... > > revhistory { > display: none; > } Good call. I'm planning on doing some work some time soon to try and make the stylesheets useful for the Vex visual XML editor project. One of the changes I forsee if the movement of rules to suppress various bits of content into a seperate module; as, in an editing environment, it would not be wise to hide anything (I guess). Better modularisation may allow us to produce a seperate 'driver' file specific to editors. (I just installed Vex for the first time today!) dave -- http://david.holroyd.me.uk/ From martin.gautier at myrnham.co.uk Thu Jan 20 19:45:56 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 19:45:56 +0000 Subject: [docbook-css] New mod. - revhistory In-Reply-To: <20050120181912.GC26276@vhost.badgers-in-foil.co.uk> Message-ID: >> (I just installed Vex for the first time today!) Yeah. Vex has the potential to be very nice. I can't use it until they support images, tables and code templates though :o( >>the movement of rules to suppress various bits of content into a seperate module ... >>to produce a seperate 'driver' file specific to editors. Good plan. >>Good call. Cheers. I've just started editing a big project today so there may be some more of these snippets cropping up soon... Mart From martin.gautier at myrnham.co.uk Thu Jan 20 20:24:06 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 20:24:06 +0000 Subject: [docbook-css] New Mod: varlistentry>term Message-ID: I couldn't find handled anywhere so I've added this to my customisation layer. NB: It's the same as glossentry>glossterm. varlistentry>term { font-weight: bolder; font-style: italic; } From martin.gautier at myrnham.co.uk Thu Jan 20 21:15:09 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 21:15:09 +0000 Subject: [docbook-css] New Mod: Message-ID: I didn't find support so I've added this to my customisation layer: function { font-family: monospace; } From martin.gautier at myrnham.co.uk Thu Jan 20 21:19:11 2005 From: martin.gautier at myrnham.co.uk (martin.gautier@myrnham.co.uk) Date: Thu, 20 Jan 2005 21:19:11 +0000 Subject: [docbook-css] Callouts Message-ID: Hmm. Tricky one. Any plans afoot? I'd hazzard a guess that CSS is going to have trouble. I don't grok Gecko/XUL so can't say whether it could cope... Here's an example: Deleting Items from a Dictionary >>> d {'server': 'mpilgrim', 'uid': 'sa', 'database': 'master', 42: 'douglas', 'retrycount': 3} >>> del d[42] >>> d {'server': 'mpilgrim', 'uid': 'sa', 'database': 'master', 'retrycount': 3} >>> d.clear() >>> d {} del lets you delete individual items from a dictionary by key. clear deletes all items from a dictionary. Note that the set of empty curly braces signifies a dictionary without any items. From dave at badgers-in-foil.co.uk Thu Jan 20 23:14:28 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 20 Jan 2005 23:14:28 +0000 Subject: [docbook-css] Callouts In-Reply-To: References: Message-ID: <20050120231427.GD27811@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 09:19:11PM +0000, martin.gautier@myrnham.co.uk wrote: > Hmm. > > Tricky one. > > Any plans afoot? I'd hazzard a guess that CSS is going to have trouble. I > don't grok Gecko/XUL so can't say whether it could cope... Yeah, you're right, CSS isn't going to be able to cope with callouts. XBL is almost able to generate the crossreferences for these kind of callouts, but the general unavailability of getElementById() for Mozilla's XML DOM makes it tricky. [ Maybe I could have a go at substituting an (almost) equivalent XPath function. Hmmm... ] I also seem to recall some other kind of DB callout system using x/y coordinates, though maybe that was a caffeine-induced hallucination? Oh, FYI, I've just started trying to improve thee XBL for image handling. I'm in the process of replacing the naive binding on with something more complex bound to the parent <[inline]mediaobject>. dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Fri Jan 21 00:31:58 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Fri, 21 Jan 2005 00:31:58 +0000 Subject: [docbook-css] Another New Mod - titleabbrev In-Reply-To: References: Message-ID: <20050121003157.GF27811@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 06:25:34PM +0000, martin.gautier@myrnham.co.uk wrote: > >From DB:TDG > > > [Processing Expectations]...Abbreviated titles are usually used only in > specific contexts, such as headers and footers, and suppressed everywhere > else. > > On this basis, I'm suppressing css processing this in my customisation > layer. Cool. I've added that to core.css in CVS. -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Fri Jan 21 00:39:10 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Fri, 21 Jan 2005 00:39:10 +0000 Subject: [docbook-css] New Mod: varlistentry>term In-Reply-To: References: Message-ID: <20050121003909.GG27811@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 08:24:06PM +0000, martin.gautier@myrnham.co.uk wrote: > I couldn't find handled anywhere so I've added this to my > customisation layer. > > NB: It's the same as glossentry>glossterm. > > varlistentry>term { > font-weight: bolder; > font-style: italic; > } I've expanded the glossterm rule in 'styles.css' with... glossentry>glossterm, term { font-weight: bolder; font-style: italic; } ( is only allowed in , so we don't need to match against that.) dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Fri Jan 21 00:42:17 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Fri, 21 Jan 2005 00:42:17 +0000 Subject: [docbook-css] New Mod: In-Reply-To: References: Message-ID: <20050121004217.GH27811@vhost.badgers-in-foil.co.uk> On Thu, Jan 20, 2005 at 09:15:09PM +0000, martin.gautier@myrnham.co.uk wrote: > I didn't find support so I've added this to my customisation > layer: > > function { > font-family: monospace; > } Ok, I've added to the list of monospaced elements is 'styles.css'. Thanks for all these nice tweaks! dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Sat Jan 22 01:11:24 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sat, 22 Jan 2005 01:11:24 +0000 Subject: [docbook-css] Different image resources for HTML & FO output In-Reply-To: <20041019200800.GB20944@vhost.badgers-in-foil.co.uk> References: <20041019200800.GB20944@vhost.badgers-in-foil.co.uk> Message-ID: <20050122011123.GA20514@vhost.badgers-in-foil.co.uk> --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 19, 2004 at 08:08:00PM +0000, David Holroyd wrote: > ... > > I was thinking about changing the XBL such that, rather than simply > binding to all the elements, a binding is made to the > containing . That binding would then, somehow, make a > reasonable selection from the children. I went ahead and implemented something along these lines. The attached patch causes the XBL to use the following image selection process for and : 1) Look through all the children for one with an acceptable 'role' attribute. We will accept the values 'html', 'HTML', 'xhtml' or 'XHTML'. 2) If step 1 doesn't select and image, look though all the descendants for on with an acceptable 'format' attribute. We will accept the values 'PNG', 'GIF', 'GIF87a', 'GIF89a', 'JPG' or 'JPEG'. 3) If either step above has now selected an element with a non-empty 'fileref' attribute, use that attribute's value as the image path, otherwise, use the Gecko built-in broken image "resource://gre/res/broken-image.gif". This should prevent multiple images from appearing, and also gives a visual indication that 'some' image should be appearing, even if the stylesheet considers none of the options suitable. dave -- http://david.holroyd.me.uk/ --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="improved_image_selection-patch1.diff" Index: db-bindings.xml =================================================================== RCS file: /var/lib/cvs/docbook-css/db-bindings.xml,v retrieving revision 1.6 diff -u -r1.6 db-bindings.xml --- db-bindings.xml 3 Jan 2005 01:30:22 -0000 1.6 +++ db-bindings.xml 22 Jan 2005 00:49:51 -0000 @@ -81,20 +81,58 @@ - + + - + + var img = document.getAnonymousNodes(this)[0]; - var file = this.getAttribute("fileref"); + var file = this.selectImage(); // HACK: using img.src=file 'inline' doesn't seem to work // but it does when called from a setTimeout() var f = function() { img.src = file; } setTimeout(f, 0); + + + + + + + + + + Index: mozilla.css =================================================================== RCS file: /var/lib/cvs/docbook-css/mozilla.css,v retrieving revision 1.7 diff -u -r1.7 mozilla.css --- mozilla.css 3 Jan 2005 01:30:22 -0000 1.7 +++ mozilla.css 22 Jan 2005 00:49:51 -0000 @@ -34,10 +34,9 @@ -moz-outline: 1px dotted invert; } -imagedata { - -moz-binding:url('db-bindings.xml#image'); +mediaobject, inlinemediaobject { + -moz-binding:url('db-bindings.xml#mediaobj'); } - guimenu, guimenuitem, guisubmenu { font: menu; Index: styles.css =================================================================== RCS file: /var/lib/cvs/docbook-css/styles.css,v retrieving revision 1.15 diff -u -r1.15 styles.css --- styles.css 22 Jan 2005 00:43:59 -0000 1.15 +++ styles.css 22 Jan 2005 00:49:51 -0000 @@ -657,6 +657,16 @@ text-align: center; } -mediaobject>textobject { - font-size: smaller; +/* hide content; we will use XML in mozilla to display it */ +mediaobject>*, inlinemediaobject>* { + display: none; +} +mediaobject>caption { + display: block; +} +mediaobject { + text-align: center; +} +caption>para { + text-align: inherit; /* to override 'justify' and inherit 'centre' */ } --BXVAT5kNtrzKuDFl--