question on docbook header formatting

Jack ostroffjh at users.sourceforge.net
Mon Oct 23 00:48:48 BST 2023


On 2023.10.19 02:54, Yuri Chornoivan wrote:
> четвер, 19 жовтня 2023 р. 00:05:15 EEST Jack написано:
>> Running khelpcenter, looking at the TOC produced by meinproc5,  
>> within a chapter, if a sect1 has several sect2s within it, there is  
>> no extra space between the sect1 title and the first sect2 title,  
>> nor between the sequential sect2 titles.  There IS a space between  
>> the last sect2 and the following sect1.  However, there is no space  
>> between two sequential sect1 titles, if the first does not contain  
>> any sect2.  This looks odd to me, but I suppose it has been that way  
>> for a long time. Am I the only one who thinks this, and is there any  
>> reasonable way to change it?
> 
> This can be tweaked through kde-docs.css and kde-default.css  
> (common/en in kdoctools repo [1]).
> 
> Yes, I think the presentation can be better than now.
> 
> Best regards,
> Yuri
> 
> [1] https://invent.kde.org/frameworks/kdoctools
I've been playing with the css and have made some progress, but am not  
there yet.  I am no css expert, but the nested dl structure of the toc  
makes it difficult to select only those <dt> elements which contain a  
<span class="sect1"> but are NOT followed by a <dd> element (for lower  
level entries.  I seem to have a successful css which does this, but it  
requires using the :has() pseudo-selector.  I have gotten it to work in  
Firefox (by setting a config variable, since :has is not yet enabled in  
the released versions until 120.  However, it does NOT work at all in  
khelpcenter.  My guess is that it simply does not support the full  
suite of css constructs.  If this is true, and it does not support  
:has(), I'm not sure it is possible to do what I want, but I'm open to  
other suggestions.
> 
> > Simply adding space before any sect1 title would add
> > unwanted space between a chapter title and the first sect1 title,  
> so I
> > know it's not trivial to do.
Part of the issue is that margin-top and margin-bottom only apply to  
the <dt> element, and not directly to the <span class="sect1"> since  
that is inline, and inline elements do not get margins, only block  
elements.  Given those <span> tags apply to complete lines of the TOC,  
changing them to <div> might make things easier, but I don't know how  
buried in meinproc5 that is done.
> >
> > Any thoughts or suggestions?
> >
Jack


More information about the kde-doc-english mailing list