Bug 919486 - RFE: Support all DocBook conditionals
Summary: RFE: Support all DocBook conditionals
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.2
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
Zac Dover
URL:
Whiteboard:
: 733577 (view as bug list)
Depends On:
Blocks: 913281
TreeView+ depends on / blocked
 
Reported: 2013-03-08 15:54 UTC by Stephen Gordon
Modified: 2013-08-09 04:49 UTC (History)
5 users (show)

Fixed In Version: 3.2.0
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-09 04:49:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Gordon 2013-03-08 15:54:43 UTC
Description of problem:

I have been working of late to see how feasible it is to build documentation from the openstack-manuals project using Publican, allowing us to single source while working with the upstream community. At this time I am looking at using a pre-build script to perform some transformations on the XML to allow this but some of these seem like they should/could be unnecessary.

One thing I have noticed is that the project uses the "os" conditional in some guides to support downstream projects in building documentation output specific to a single operating system. I would like to see support for the "os" conditional in publican.

My interim plan is to convert these attributes to "condition" which is supported by publican in pre-build scripting.

Version-Release number of selected component (if applicable):

publican-3.1.3-1.fc17.noarch

Comment 1 Stephen Gordon 2013-04-22 12:02:19 UTC
Reflecting on this request further I suspect the precursor would be support for setting more than one profiling condition from publican.cfg (currently you can *set* more than one but only the last one found is used when processing the XML). Not sure how feasible this is in the current publican code base.

Comment 2 Jeff Fearn 🐞 2013-04-22 22:55:05 UTC
It just needs an extra if statement in XmlClean::prune_xml and to store 'os' in $Publican->{config}

You might be better off storing it in the 'arch' conditional, which isn't strictly correct but it would be easy to regex back to 'os' later on if you have a chance of using 'condition'.

Comment 3 Jeff Fearn 🐞 2013-06-17 04:50:33 UTC
Assuming two conditions means OR.

e.g.

a section for 'fu' or 'bar'.

<section condition="fu;bar">

a section for 'bang'

<section condition="bang">


In the publican.cfg

condition: 'fu;bang'


Both the above sections would be included.


[Dev Note]
XmlClean.pm, sub prune_xml, put all attrs from http://www.sagehill.net/docbookxsl/Profiling.html in an array, loop, split, loop, compare, FTW.

Comment 4 Jeff Fearn 🐞 2013-07-11 05:34:49 UTC
Docs need to be updated!

Previously we supported arch and conditional, this has been expanded to the full list.

arch audience condition conformance lang** os revision revisionflag role security status userlevel vendor wordsize

Previously the profiling allowed 1 option to be set. e.g.:

arch: "i386"

The logic has been changed so that multiple conditions can be set. e.g.

arch: "i386;x86_64"

Where the ';' means OR.

The XML supports the same OR logic, e.g.

<para security="minimal;maximal">

** lang is special, it's always used in Publican and it gets set implicitly.

To ssh://git.fedorahosted.org/git/publican.git
   1bc3841..1b8f230  HEAD -> devel

Comment 5 Ruediger Landmann 2013-07-11 06:02:14 UTC
(In reply to Jeff Fearn from comment #4)
> Docs need to be updated!

Zac, can you take this one too please?

Comment 6 Jeff Fearn 🐞 2013-07-18 07:56:43 UTC
*** Bug 733577 has been marked as a duplicate of this bug. ***

Comment 7 Tim Hildred 2013-07-23 09:20:33 UTC
The os attribute works as expected.

Comment 8 Tim Hildred 2013-07-23 09:20:52 UTC
However, unless I'm missing something, "audience" does not.

I have in my publican.cfg:
audience: dudes

But, when I add something like this to a book:
<section audience='dudes'>

I get this when I build it:
Beginning work on en-US
DTD Validation failed: 
Introduction.xml:16: validity error : No declaration for attribute audience of element section

Comment 9 Tim Hildred 2013-07-23 09:49:31 UTC
I tried examples of each of these:

arch audience condition conformance lang** os revision revisionflag role security status userlevel vendor wordsize

They all work except for audience, as stated in comment #8.

publican-3.1.5-0.fc18.t62.noarch

Comment 10 Jeff Fearn 🐞 2013-07-23 22:31:55 UTC
Changing to verified as audience is a DocBook 5 common attribute and will correctly fail when used in DocBook 4 content.

Comment 11 Jeff Fearn 🐞 2013-08-09 04:49:26 UTC
The fix for this bug has been shipped in publican 3.2.0


Note You need to log in before you can comment on or make changes to this bug.