Fork me on GitHub
#cljdoc
<
2024-07-11
tengstrand03:07:32

Is there a way to prevent cljdoc to wrap the #RGB colors under the Dark and Light columns in https://github.com/polyfy/polylith/blob/186e54ec1694af2b332f652048e840ec946492ce/doc/colors.adoc?plain=1#L7-L17 example?

martinklepsch07:07:12

I think the question is probably more can Asciidoc do this? :) There’s a way to specify column width but i’m not sure it’s useful for this situation https://docs.asciidoctor.org/asciidoc/latest/tables/adjust-column-widths/#:~:text=using%20percentage%20values-,Column%20width,total%20width%20of%20the%20table.

tengstrand07:07:14

Okay, thanks. Or maybe do some CSS tricks with nowrap or similar (maybe under the hood)? I'm not a CSS expert!

Cora (she/her)11:07:47

yep, white-space: nowrap would be the CSS to prevent that wrapping

lread14:07:14

Let us know what solution you end up using @U1G0HH87L. Sometimes, instead of using autowidth, I'll https://docs.asciidoctor.org/asciidoc/latest/tables/adjust-column-widths/ and find something that usually works.

tengstrand14:07:04

Will do that.

lread15:07:38

Another hack would be to make your color images a tad wider.

lread15:07:24

But some nowrap directive would be the most reliable, I think.

tengstrand16:07:19

> Another hack would be to make your color images a tad wider. I had that idea too. Or maybe put some nbsp in the headings.

Cora (she/her)19:07:27

this is really what white-space: nowrap was made for, so I'd use it if I could in this instance

👍 2
tengstrand03:07:30

Could someone help me with adding that custom css file and get it to work? Create a PR, or guide me a bit more? I would be very grateful if so!

Cora (she/her)04:07:16

cljdoc uses tachyons so you could try using a tachyons class http://tachyons.io

Cora (she/her)04:07:37

in this case the css class is nowrap

tengstrand07:07:23

Could you point me to the right place in https://github.com/polyfy/polylith where I should put the css file @UE21H2HHD? Can I then just refer to that css file, from the .adoc file where it's used (like in https://docs.asciidoctor.org/asciidoctor/latest/html-backend/custom-stylesheet/ example)? I guess it will just extend the existing css.

tengstrand07:07:25

Or maybe I can just embed css directly to the https://github.com/polyfy/polylith/blob/186e54ec1694af2b332f652048e840ec946492ce/doc/colors.adoc?plain=1#L13-L14, if possible? It would be less elegant, but solve the problem.

lread11:07:39

like github, we sanitize html for consistent styling, so you can’t just use underlying tachyons styles. if we allowed that we could never switch out tachyons for something else.

lread12:07:31

I can give you a hand with this sometime today, I vaguely remember editing this doc for you a while back…

tengstrand12:07:35

Okay, thanks!

lread14:07:41

So once you know how, it is easy! This:

`#f8eeb6
` Can be changed to this:
[.nowrap]#`#f8eeb6`#
To force no wrapping. See https://docs.asciidoctor.org/asciidoc/latest/text/text-span-built-in-roles/#built-in. So @U02N27RK69K advice was spot on, but we just needed to express this through the adoc abstraction.

💜 1
Cora (she/her)14:07:48

I love accidentally being right 😅

💜 1
lread14:07:10

I think your advice to use nowrap instead of the various hacks we were inventing was very good! 💜