Bug 1267389 - Error trying to use docname in publican.cfg
Error trying to use docname in publican.cfg
Status: CLOSED NOTABUG
Product: Publican
Classification: Community
Component: publican (Show other bugs)
3.2
Unspecified Other
unspecified Severity high
: ---
: ---
Assigned To: Jeff Fearn
Ruediger Landmann
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-29 17:52 EDT by Cheryl Fernandes
Modified: 2015-10-05 22:30 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-05 22:30:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Cheryl Fernandes 2015-09-29 17:52:53 EDT
Description of problem:

I am using Publican3.2 on Centos6. When I use docname in publican.cfg to override the <title> tag in the Book_Info.xml and run the following command, 
publican build --formats html,pdf --langs en-US --config publican.cfg

I get the following error:
Cannot locate main XML file: '<value of docname>.xml' at /bin/publican line 936.

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


How reproducible:
Easy to reproduce. For me atleast.

Steps to Reproduce:
1. Create a book
2. Add docname to publican.cfg
3. Run command 'publican build --formats html,pdf --langs en-US --config publican.cfg'

Actual results:
Cannot locate main XML file: '<value of docname>.xml' at /bin/publican line 936.

Expected results:
The title should be different from the book name


Additional info:
Comment 1 Ruediger Landmann 2015-09-29 20:24:43 EDT
Hi Cheryl -- this isn't a bug -- Publican lets you decouple the document title from the name of the package that deploys the document (with the docname parameter that you've found), but also to use any arbitrary XML file as the top of the XML tree for the book (with the mainfile parameter).

In this case, just add an extra line to your publican.cfg to point Publican to the mainfile of the doc. For example, if your project is set up with Bar.xml and Bar.ent as the main XML and entity files, but you want to use Foo as the docname, set:

docname: Foo
mainfile: Bar

Does this work for you now?
Comment 2 Cheryl Fernandes 2015-09-30 14:19:40 EDT
Hi,
  Thanks for your quick response!

I followed what you said. In addition to 'docname', I also added 'mainfile'. 

I'm not getting the "Cannot locate main XML file ..." error anymore and everything builds fine. HOWEVER, the <title> in BookInfo.xml does not get overridden with the value of 'docname'

Steps to Reproduce:
1. Create a book
2. Add docname and mainfile to publican.cfg 
3. Run command 'publican build --formats html,pdf --langs en-US --config publican.cfg'

Actual results:
The <title> remains the same

Expected results:
The title should grab the docname value from publican.cfg
Comment 3 Ruediger Landmann 2015-10-01 00:04:32 EDT
Right, but that's not what docname is for: it's an override used for RPM packaging. If you want to change the title of the doc, you just need to change whatever's in the <title> tags in the Book_Info.xml file.

So Publican lets you set whatever you want as the <title> for the doc, and decouple this from the name of the mainfile of the doc, and from the RPM package name used to deploy the doc (they can be three different things if you really want).
Comment 4 Cheryl Fernandes 2015-10-01 14:58:31 EDT
Ok, this works. thanks!

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