Bug 467128 - kde-no-chunk.xsl and kde-web.xsl do not work
Summary: kde-no-chunk.xsl and kde-web.xsl do not work
Status: REPORTED
Alias: None
Product: frameworks-kdoctools
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Documentation Editorial Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-09 22:14 UTC by Thiago Sueto
Modified: 2024-01-16 19:07 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2023-03-09 22:14:49 UTC
Manually setting the --stylesheet used for meinproc5 to these two styles does not work, the resulting content does not display properly.
Comment 1 Jack 2023-10-22 22:22:51 UTC
I just ran into this again, and noticed something that might be relevant.  Without the --stylesheet parameter, index.html produced by meinproc5 includes the snippet <link rel="stylesheet" type="text/css" href="help:/kdoctools5-common/kde-default.css"> within the <header>.  (There are also other, similar links to other css files.  Note (at least on my systrem) that file is actually in /usr/share/help/en/kdoctools5-common. 
However, when using --stylesheet /usr/share/kf5/kdoctools/customization/kde-web.xsl, that snippet becomes <link rel="stylesheet" type="text/css" href="../common/kde-default.css">.  I have not yet lookied into the meinproc5 source to see how it congures this path, but that looks like it could be the reason no proper styling seems to be done at all.
Comment 2 Albert Astals Cid 2023-10-23 20:48:53 UTC
That's defined in the kde-web.xsl file itself, no?

<xsl:param name="kde.common">../common/</xsl:param>
<xsl:param name="html.stylesheet" select="concat($kde.common,'kde-default.css')"/>

Why is that a problem?
Comment 3 Jack 2023-10-23 21:53:34 UTC
If "../common" is actually from kde-web.xsl, then we know meinproc5 is indeed using that file with the --stylesheet parameter.  So, when the OP says "does not display properly" I'm very curious exactly what was wrong with the display.  (see my theory below)

I have no idea where that ../common directory is supposed to point, but I think it is being taken as relative to the location of the xsl file.  Using the web developer tools in Firefox, it appears NO css files are being used to display the index.html produced when I use --stylesheet.  If I change that ../common to point to the css as referenced in the index.html produced without --stylesheet, the styling from that css file is used.

If I use kde-no-chunk.xsl I get the same result (in terms of styling) as using kde-web.xsl, but with chapters in different files, not all in one.  So, --stylesheet IS doing something, but the reference css file is not being used, since it's not in the directory specified.

So - is there any way to know what kde-web.xsl is trying to do by using ../common, which doesn't seem to point to any existing directory?  That would certainly explain why there is no apparent styling applied.

Note, on my system the stylesheets are in /usr/share/kf5/kdoctools/customization/ and the css files are in /usr/share/help/en/kdoctools5-common.
Comment 4 Albert Astals Cid 2023-10-23 22:09:41 UTC
kde-web is for the kde web, your computer is not setup the same way the kde web, so the paths are "wrong" for your setup but it's not necessarily a bug.

[*] The kde web may have changed its setup and the paths are also wrong for it, that's a separate story  and would be indeed a bug of the web setup :D
Comment 5 Jack 2023-10-23 22:22:03 UTC
I just found the following commit for kde-chunk.xsl.

commit 1cd33b3cad5c9a38d39655a39aac911ed7b334f8
Author: Luigi Toscano <luigi.toscano@tiscali.it>
Date:   Sat Apr 26 02:44:12 2014 +0200

    Enable common/ for a different prefix, adapt kde-chunk.xsl
    
    Common files are installed again as it was in kdelibs4, but under
    a different prefix (kdoctools5-common) to avoid conflicts with the
    "old" common directory from kdelibs4.
    kde-chunk.xsl has been adapted to use this new prefix.
    
    REVIEW: 117781

Does this change in prefix need to also be applied to kde-no-chunk.xsl and to kde-web.xsl?  (the only two xsl files which have ../common)
Comment 6 Jack 2023-10-23 22:26:08 UTC
By the way - I am just running "firefox index.html" in the directory where the file is, not actually using a web server.  Looking at the README in the customization folder of kdoctools, it looks like kde-no-chunk should only differ from kde-chunk (the default KDE style sheet) by using separate files per chapter instead of a single file, and kde-web is a simplified version with limited width.  Other than those specific differences, I don't see why their reference to a common directory should differ.
Comment 7 Jack 2023-10-24 17:15:21 UTC
I hate to keep updating myself, but on further thought, I'd say only kde-no-chunk should get the same change that kde-chunk did, as both  are most likely to be used on a local system, for use by khelpcenter.  For kde-web, it should probably not specify any directory for the css, letting it be found in the same folder as the html itself.  That would make more sense if you are actually hosting it in a web server.
Comment 8 Albert Astals Cid 2023-10-24 21:47:28 UTC
We probably want Luigi to comment since he did that change 10 years ago, but as far as i understand he's on holiday so let's wait a bit
Comment 9 Jack 2023-10-24 21:49:41 UTC
There is certainly no rush - this has been sitting for a while, it can sit longer :-)  Let Luigi enjoy is holiday.
Comment 10 Luigi Toscano 2023-10-24 22:29:48 UTC
That was long ago but I vaguely remember that kde-no-chunk had a few issues and I decided to postpone the fix because it was not trivial and the web version on docs.kde.org was used anyway for most cases. But I may be wrong.
Comment 11 Albert Astals Cid 2023-11-15 20:13:03 UTC
Can you remind me when is kde-nochunk.xsl used?