Bug 410393 - Bad XML to HTML conversion code in ccbysa4-notice.docbook
Summary: Bad XML to HTML conversion code in ccbysa4-notice.docbook
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kdoctools
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Documentation Editorial Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-30 12:28 UTC by David C. Bryant
Modified: 2019-07-30 15:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
.docbook file to demonstrate the error. (1.32 KB, application/x-docbook+xml)
2019-07-30 12:28 UTC, David C. Bryant
Details
Picture of the output from meinproc5 after I patched ccbysa4-notice.docbook on my own hard disk (87.62 KB, image/png)
2019-07-30 14:38 UTC, David C. Bryant
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David C. Bryant 2019-07-30 12:28:59 UTC
Created attachment 121834 [details]
.docbook file to demonstrate the error.

SUMMARY
ccbysa4-notice.docbook generates incorrect HTML code. You can find the master copy here:

https://cgit.kde.org/kdoctools.git/tree/src/customization/en/entities/ccbysa4-notice.docbook

There are also copies in //cgit.../customization/xx/... for these other five languages:

xx = ca (Catalan)
xx = es (Español)
xx = id (Indonesian)
xx = ru (Russian)
xx = uk (Ukrainian)

So there are six instances of the bug, all together. The rest of the subdirectories (42 other languages) do not have an entry for ccbysa4-notice.docbook. Not yet. I'm not certain how many languages are actively supported right now.

STEPS TO REPRODUCE
1. Download "example.docbook", attached to this report.
2. Run meinproc5 to translate "example.docbook" into "index.html"
3. You'll see this error message: 
ERROR: xref linking to cc-by-sa-4 has no generated link text.
Error: no ID for constraint linkend: "cc-by-sa-4".

OBSERVED RESULT
Bad html code linking to index#(nowhere).

EXPECTED RESULT
Good html code pointing to https://creativecommons.org/licenses/by-sa/4.0/legalcode

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: From openSuSE LEAP 15.0 repositories
(available in About System)
KDE Plasma Version: 5.12.8
KDE Frameworks Version: 5.45.0
Qt Version: 5.9.4

ADDITIONAL INFORMATION

I recently started writing some missing documentation (for KAddressBook). When I submitted my first rough draft (at https://phabricator.kde.org/D22799), somebody said I should replace one XML ENTITY (&FDLNotice;) with another one (&CCBYSA4Notice;). So I did that. But then I got the error message from meinproc5.

So I did some digging around on my hard disk, and I figured it out. ccbysa4-notice.docbook is pretty short -- it says

<para>Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 4.0 International or any later. A copy of the license is included in <xref linkend="cc-by-sa-4"/>.</para>

But it really ought to say

<para>Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License or any later version of that license. A copy of the license is included in <ulink href="https://creativecommons.org/licenses/by-sa/4.0/legalcode">at the Creative Commons web site</ulink>>.
</para>

(Please note that I have patched a few words in the verbiage, substituted a "ulink" tag for "link", and also inserted the href="crea..." attribute.)

I haven't figured out where the generated notice ought to point in any other language besides English, but I do see this at the Creative Commons web site, in a menu list at the top right:

Deutsch
Español
Français
Русский
Україиська

I don't see Catalan, but Español is pretty close ... you might need to talk with some of the translators to get the whole thing done right. I'll gladly submit a patch via Phabricatr if you just let me know which KD# repo I need to clone. Thanks!
Comment 1 David C. Bryant 2019-07-30 14:38:04 UTC
Created attachment 121842 [details]
Picture of the output from meinproc5 after I patched ccbysa4-notice.docbook on my own hard disk

I patched ccbysa4-notice.docbook in usr/share/kf5/... on my own hard disk, then ran my KAddressBook.docbook document through it. This is acreenshot of the resulting index.html file, as viewed via KHelpCenter.

PS I would assign the bug to myself,, but I'm not certain which repos I need to clone to create / submit a patch. I'm still learning a bunch of this stuff. I'll gladly make the patch; just point me in the right direction, please.
Comment 2 Luigi Toscano 2019-07-30 15:11:22 UTC
As requested in the review, the document is not complete and it lacks the copyright section. Compared with the example template.docbook, the relevant entity which refers to the license, which should be part of that section, is not present here (in this case, &underCCBYSA4;).
 Adding it makes the error goes away.