Bug 688585

Summary: Accented letters in book or article title
Product: [Community] Publican Reporter: luigi votta <luigi.vtt>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Ruediger Landmann <rlandman+disabled>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.5CC: mmcallis, publican-list, rlandman, rnewton
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-26 00:42:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description luigi votta 2011-03-17 12:23:14 UTC
Description of problem:
I would use accented letters in book/article title. As I cannot use them on command line or subtag <title>,  I've tried to set them in docname param but it doesn't compile.

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

How reproducible:
Use f.e. a title like "Si può_fare_di_più". It complains with:
"Invalid format for docname. Value (Si può_fare_di_più) does not conform to constraint ([^0-9a-zA-Z_\-\.\+]) at /usr/bin/publican line 556" 

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
Render regularly accented letters in title doc.

Comment 1 Ruediger Landmann 2011-03-17 22:36:53 UTC
(In reply to comment #0)
> Description of problem:
> I would use accented letters in book/article title. As I cannot use them on
> command line or subtag <title>,  I've tried to set them in docname param but it
> doesn't compile.

Hi Luigi --

Publican uses the contents of the <title> tag to generate the name of the RPM package for the book, and RPM packages can only have basic ASCII characters in their names. 

To use accented letters in a document title:

1. Create the book using only basic ASCII characters in the "name" option:

publican create --name Si_puo_fare_di_piu

2. Edit the <title> tag in the Book_Info.xml or Article_Info.xml file to include the correct name of the document:

<title>Si può fare di più</title>

3. Edit the publican.cfg file to include the RPM-friendly version of the document name:

docname: Si_puo_fare_di_piu

This is documented in the Publican Users' Guide: 3.1.2. Book_Info.xml, but admittedly, could be more explicit. 

I'd change this to a documentation bug now, but since accented characters only matter to RPM packaging, I wonder if we're catching them at the best place? Maybe the check should apply to the "publican package" command but not to "publican create" or "publican build"?

Comment 2 Jeff Fearn 🐞 2011-03-17 23:08:37 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Description of problem:
> > I would use accented letters in book/article title. As I cannot use them on
> > command line or subtag <title>,  I've tried to set them in docname param but it
> > doesn't compile.
> 
> Hi Luigi --
> 
> Publican uses the contents of the <title> tag to generate the name of the RPM
> package for the book, and RPM packages can only have basic ASCII characters in
> their names. 
> 
> To use accented letters in a document title:
> 
> 1. Create the book using only basic ASCII characters in the "name" option:
> 
> publican create --name Si_puo_fare_di_piu
> 
> 2. Edit the <title> tag in the Book_Info.xml or Article_Info.xml file to
> include the correct name of the document:
> 
> <title>Si può fare di più</title>
> 
> 3. Edit the publican.cfg file to include the RPM-friendly version of the
> document name:
> 
> docname: Si_puo_fare_di_piu
> 
> This is documented in the Publican Users' Guide: 3.1.2. Book_Info.xml, but
> admittedly, could be more explicit. 
> 
> I'd change this to a documentation bug now, but since accented characters only
> matter to RPM packaging, I wonder if we're catching them at the best place?
> Maybe the check should apply to the "publican package" command but not to
> "publican create" or "publican build"?

This will just lead to people creating books that can't be packaged and then complaining they should have been told or not allowed to do it. It can't be packaged because docname is not just the name of the package, it's the name of the main file as well.

Might be worth allowing one of those use cases for docname to be over ridden with another variable.

Cheers, Jeff.

Comment 3 luigi votta 2011-03-19 10:05:58 UTC
Hi all, thanks for replay and explanation.

What jumbled me a bit was the "override" concept of the parameter over the tag with special chars.  

Perhaps saying as that these parameter must be equal to the name used during creation could help.

Comment 4 Jeff Fearn 🐞 2011-04-11 05:58:47 UTC
Added mainfile parameter. This will allow docname, which is used for packaging and file naming, to be separate from the main XML/ENT file name and any strings in the Book_Info file if the author sets them in the cfg file.

Committed revision 1752.

Comment 5 Jeff Fearn 🐞 2011-07-07 10:16:14 UTC
Back ported to branches/publican-2x

Committed revision 1810.

Comment 6 Rebecca Newton 2011-07-13 03:47:48 UTC
This works!