Would it be possible to disable the outer bullet when a Ordered/UnorderedList is added within another List, either entirely or with a toggle?
I think I could figure out how to implement this one if it's fine to add.
Interesting point! I don’t want to disable it completely because it could make sense in some cases. I think the easiest and most general solution would be to put Outer List 2 and the inner list into a
LinearLayout
. This should also work with embedded tables, images, and so on. Does that work for you?
Thanks, I didn't think of that but that would also work. I do think it would be convenient to have a toggle for it in the struct, since hiding the outer point is the default behavior in most word processing applications
That might be true for WYSIWYG applications, but I think most text/markup-based word processors do the same as
genpdf
currently does, for example HTML or LaTeX. And I currently don’t see a good way to implement this generically. You could try to downcast the element box to one of the list types and check if that is successful. But what would happen if the list is inside a wrapper element?So if you have a good and generic way to implement this, you can submit a patch, but I’m not convinced yet and can’t promise that I’ll accept it.
I was thinking of using
Any
to downcast, but you're right there isn't a simple way to do it that accounts for lists within other elements. Might be worth adding a short note in the docs about wrapping inner lists in aLinearLayout
Good point, I’ve added examples to the documentation that show the two ways of nesting lists in commit b96bcbd7f6f7b4a4ff8cd22856063a77784413f9.