Re: CSS documentation and non-breakable hyphens

2017-06-02 Thread Stefan Sauer
On 05/31/2017 10:37 AM, Arnaud wrote:
>> Wondering if there's a better way to do that.
> Well, it seems that the most common answer for that problem is to use a
>  element with the 'white-space' property set to 'nowrap'.
>
> HTML:i-dont-want-to-be-broken
> CSS:span.nobr { white-space: nowrap; }
>
> And this is now how it translates in our GTK XML documentation. We can
> use the  element along with the 'role' attribute. Example with a
> table entry from the file css-properties.xml.
>
>  role="nobr">-gtk-outline-bottom-left-radius
Please file a bug for gtk-doc, we'll have to see how easilly we can
apply this to the doc generation (and how much the extra tags will make
things slower :))

Stefan

>
> In the generated HTML, it translates to:
>
> -gtk-outline-bottom-left-radius
>
> Once this is done, the only thing left to do is to tweak the
> 'style.css', and add this snippet.
>
> span.nobr { white-space: nowrap; }
>
> It does the job, and would allow to remove every non-breaking spaces and
> hyphens. The only detail here is that it requires to modify 'style.css'
> file, which belongs to gtk-doc-tools, and is not shipped with gtk.
>
> Anyway, there may be better solution, I'm not a web developer, you
> shouldn't trust me too much on that ;)
>
> Cheers.
>
> 
>
> References:
>
> - DOCBOOK: Non breaking spaces or "ties"?
> 
>
> - Using CSS to style HTML
> 
>
> - White-space property
> 
>
> On 05/30/2017 05:51 PM, Arnaud wrote:
>> Hey there,
>>
>> While browsing the GTK+ CSS documentation lately in my web browser, I
>> noticed a weird phenomenon. If you do a research on 'font-' (for
>> example), most of the 'font-' strings are left out of the search results.
>>
>> You can try it easily. Go on this page, and do a research on 'font-'.
>> https://developer.gnome.org/gtk3/stable/chap-css-properties.html
>>
>> The truth behind is that the page uses 'non-breaking hyphens' (U+2011)
>> instead of 'normal hyphens'. I suppose it works great for formatting,
>> but it kind of breaks the search function in the browser.
>>
>> If you're curious about that on your console, browse the GTK+ source
>> code. And do something like that.
>>
>> cd docs/references
>> grep -rl $'\xe2\x80\x91' .
>> grep $'\xe2\x80\x91' ./gtk/css-overview.xml
>>
>> I've been even more curious and tried to replace all these non-breaking
>> hyphens with normal hyphens.
>>
>> sed -i 's:\xe2\x80\x91:-:g' css-*.xml
>>
>> The result is not that bad, but it's true that some property names in
>> first column of the tables get split in two lines.
>>
>> Wondering if there's a better way to do that.
>>
>> Cheers,
>> Arnaud
>>
>> ___
>> gtk-devel-list mailing list
>> gtk-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
>
> ___
> gtk-devel-list mailing list
> gtk-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: CSS documentation and non-breakable hyphens

2017-05-31 Thread Arnaud
> Wondering if there's a better way to do that.

Well, it seems that the most common answer for that problem is to use a
 element with the 'white-space' property set to 'nowrap'.

HTML:i-dont-want-to-be-broken
CSS:span.nobr { white-space: nowrap; }

And this is now how it translates in our GTK XML documentation. We can
use the  element along with the 'role' attribute. Example with a
table entry from the file css-properties.xml.

-gtk-outline-bottom-left-radius

In the generated HTML, it translates to:

-gtk-outline-bottom-left-radius

Once this is done, the only thing left to do is to tweak the
'style.css', and add this snippet.

span.nobr { white-space: nowrap; }

It does the job, and would allow to remove every non-breaking spaces and
hyphens. The only detail here is that it requires to modify 'style.css'
file, which belongs to gtk-doc-tools, and is not shipped with gtk.

Anyway, there may be better solution, I'm not a web developer, you
shouldn't trust me too much on that ;)

Cheers.



References:

- DOCBOOK: Non breaking spaces or "ties"?


- Using CSS to style HTML


- White-space property


On 05/30/2017 05:51 PM, Arnaud wrote:
> Hey there,
>
> While browsing the GTK+ CSS documentation lately in my web browser, I
> noticed a weird phenomenon. If you do a research on 'font-' (for
> example), most of the 'font-' strings are left out of the search results.
>
> You can try it easily. Go on this page, and do a research on 'font-'.
> https://developer.gnome.org/gtk3/stable/chap-css-properties.html
>
> The truth behind is that the page uses 'non-breaking hyphens' (U+2011)
> instead of 'normal hyphens'. I suppose it works great for formatting,
> but it kind of breaks the search function in the browser.
>
> If you're curious about that on your console, browse the GTK+ source
> code. And do something like that.
>
> cd docs/references
> grep -rl $'\xe2\x80\x91' .
> grep $'\xe2\x80\x91' ./gtk/css-overview.xml
>
> I've been even more curious and tried to replace all these non-breaking
> hyphens with normal hyphens.
>
> sed -i 's:\xe2\x80\x91:-:g' css-*.xml
>
> The result is not that bad, but it's true that some property names in
> first column of the tables get split in two lines.
>
> Wondering if there's a better way to do that.
>
> Cheers,
> Arnaud
>
> ___
> gtk-devel-list mailing list
> gtk-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


CSS documentation and non-breakable hyphens

2017-05-30 Thread Arnaud
Hey there,

While browsing the GTK+ CSS documentation lately in my web browser, I
noticed a weird phenomenon. If you do a research on 'font-' (for
example), most of the 'font-' strings are left out of the search results.

You can try it easily. Go on this page, and do a research on 'font-'.
https://developer.gnome.org/gtk3/stable/chap-css-properties.html

The truth behind is that the page uses 'non-breaking hyphens' (U+2011)
instead of 'normal hyphens'. I suppose it works great for formatting,
but it kind of breaks the search function in the browser.

If you're curious about that on your console, browse the GTK+ source
code. And do something like that.

cd docs/references
grep -rl $'\xe2\x80\x91' .
grep $'\xe2\x80\x91' ./gtk/css-overview.xml

I've been even more curious and tried to replace all these non-breaking
hyphens with normal hyphens.

sed -i 's:\xe2\x80\x91:-:g' css-*.xml

The result is not that bad, but it's true that some property names in
first column of the tables get split in two lines.

Wondering if there's a better way to do that.

Cheers,
Arnaud

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list