[docs][website] Can the docs on the website be xhtml + svg?
I've been investigating getting better equations and graphs into the Math lib docs and one prerequisite seems to be serving up pages as XHTML rather than HTML: without that SVG's simply do not display correctly (or at all) in IE. The docbook xhtml generation seems to be working OK, but would the pages get served correctly on the current website? Thanks, John.
On 31 January 2014 13:29, John Maddock
I've been investigating getting better equations and graphs into the Math lib docs and one prerequisite seems to be serving up pages as XHTML rather than HTML: without that SVG's simply do not display correctly (or at all) in IE.
Have you tried adding a doctype to the html file?
On 31 January 2014 13:42, Daniel James
On 31 January 2014 13:29, John Maddock
wrote: I've been investigating getting better equations and graphs into the Math lib docs and one prerequisite seems to be serving up pages as XHTML rather than HTML: without that SVG's simply do not display correctly (or at all) in IE.
Have you tried adding a doctype to the html file?
I'll explain a little further. In order to support existing web sites Internet Explorer has two engines, the old one for "quirks mode" and the new standards based engine. Our pages are currently displayed using the old one which doesn't support SVG. Using an xml mime type is one way to cause it to use the standards based engine, another way is to use an appropriate doctype. The ideal is the html5 doctype (<!DOCTYPE html>), but it doesn't seem to be possible to change docbook to generate it. But hopefully it would work with one of the html 4.01 doctypes: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> The first one will use "almost standards" mode, the second for "standards". You could try checking out the 'feature/new-style' boostbook branch and adding to your jamfile: -xsl:paramboost.defaults=Boost xsl:paramboost.defaults=Boost2 It's using the transitional doctype, and I'm not sure if that will work. Strict might be better.
I've been investigating getting better equations and graphs into the Math lib docs and one prerequisite seems to be serving up pages as XHTML rather than HTML: without that SVG's simply do not display correctly (or at all) in IE.
Have you tried adding a doctype to the html file?
Yes, generating xhtml adds: <?xml version="1.0" encoding="US-ASCII" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> As the doctype header, so everything is working fine locally (albeit I need to cleanup/modify a lot of our SVG's to make them platform independent, but that's a whole other issue), but I assume there's no way I can test it with Boost's webserver until we actually produce a release, which is a little late. However, now that you've jogged my memory(!), I see there are some docbook xsl params for setting the document type and adding: xsl:paramchunker.output.doctype-public="-//W3C//DTD HTML 4.01//EN" xsl:paramchunker.output.doctype-system="http://www.w3.org/TR/html4/strict.dtd" To the build options produces output which looks OK locally, and as it's HTML it doesn't need to be served as xml either, so I think that's problem solved! Thanks! John. PS You could use the above mechanism to get a HTML 5 doctype - however it's unlikely that boostbook actually generates valid HTML?
On 31 January 2014 18:05, John Maddock
However, now that you've jogged my memory(!), I see there are some docbook xsl params for setting the document type and adding:
xsl:paramchunker.output.doctype-public="-//W3C//DTD HTML 4.01//EN"
xsl:paramchunker.output.doctype-system="http://www.w3.org/TR/html4/strict.dtd"
To the build options produces output which looks OK locally, and as it's HTML it doesn't need to be served as xml either, so I think that's problem solved!
That's what I was doing on the 'new-style' branch. The problem is that the rendering changes a little in standards mode. One problem is that margins are different in tables, to fix that I added to the CSS: table th > *:first-child, table td > *:first-child { margin-top: 0; } table th > *:last-child, table td > *:last-child { margin-bottom: 0; } Which seems to work okay. I was also trying to convert it to use more consistent units for fonts.
PS You could use the above mechanism to get a HTML 5 doctype - however it's unlikely that boostbook actually generates valid HTML?
I think it does, but even in not, it's close enough. We could use the alternative HTML5 doctype: <!DOCTYPE html SYSTEM "about:legacy-compat"> But I don't know if browsers respect it. The 4.01 doctype should be fine.
The ideal is the html5 doctype (<!DOCTYPE html>), but it doesn't seem to be possible to change docbook to generate it.
The latest docbook stylesheets have an option for xhtml5 which should do that: there's no support for calling that stylesheet in Boost.Build of course. John.
On 31 Jan 2014 at 13:29, John Maddock wrote:
I've been investigating getting better equations and graphs into the Math lib docs and one prerequisite seems to be serving up pages as XHTML rather than HTML: without that SVG's simply do not display correctly (or at all) in IE. The docbook xhtml generation seems to be working OK, but would the pages get served correctly on the current website?
I assume you mean that the HTTP response says Content-Type: text/html? Have you tried renaming the .html files to .xhtml? That should solve the XHTML delivery problem. Failing that, I'd supply a suitable .htaccess file for Apache to override the response headers just for your project. Changing the default site-wide is likely to have unexpected consequences. Niall -- Currently unemployed and looking for work in Ireland. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
participants (3)
-
Daniel James
-
John Maddock
-
Niall Douglas