Bug 688585 - Accented letters in book or article title
Accented letters in book or article title
Status: CLOSED CURRENTRELEASE
Product: Publican
Classification: Community
Component: publican (Show other bugs)
2.5
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeff Fearn
Ruediger Landmann
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-17 08:23 EDT by luigi votta
Modified: 2011-07-25 20:42 EDT (History)
4 users (show)

See Also:
Fixed In Version: 2.6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-25 20:42:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description luigi votta 2011-03-17 08:23:14 EDT
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 18:36:53 EDT
(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 19:08:37 EDT
(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 06:05:58 EDT
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 01:58:47 EDT
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 06:16:14 EDT
Back ported to branches/publican-2x

Committed revision 1810.
Comment 6 Rebecca Newton 2011-07-12 23:47:48 EDT
This works!

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