I’m starting to replace my ad-hoc solutions to code display with a systematic use of Codly. I’m quite happy with the package so far, but there’s one thing I haven’t been able to reproduce: a code box in full page width with hanging line numbers:
Thanks, but I’m not quite following. I am using the “outside” placement. My issue is to make the box as wide as the line width, with the number sticking in the margin.
Sorry, I couldn’t tell how familiar you are with the package.
I’m afraid the existing codly features alone don’t support this styling. For example, moving numbers to the left via number-format: (number) => place(dx: -0.5em, str(number)) hides them behind a white block, which is obviously not desired here, but also the code block doesn’t compensate for that space difference.
So I suggest you file a feature request in codly repository or apply your own changes by copying package files for the time being. Hopefully I overlooked something and I’m simply wrong.
I tried figuring out the exact width, but I don’t know where the magic-padding length comes from. And the stroke kinda magically works, without move the stroke disappears. Thankfully, it doesn’t need any width manipulation. So it’s a mess, but so far looks promising. Only a real use case can show if it’s robust enough to not care much about the existence of this hack. A native feature would be better anyway.
So far, it doesn’t work with zebra-fill, because it still fills only inner blocks, but not the stroked one.