fix: line wrapping for examples without desc#749
Conversation
bcoe
left a comment
There was a problem hiding this comment.
looking good to me 👍 thanks for taking this on.
| ui.div( | ||
| { | ||
| text: example[0], | ||
| padding: [0, 2, 0, 2] |
There was a problem hiding this comment.
I think rather than having no wrap here, you should use theWrap; this way the example will still wrap onto multiple lines at the width boundary, but will take up a full line.
There was a problem hiding this comment.
@bcoe So you mean I should add a width property like in line 276? 😄
There was a problem hiding this comment.
@maxrimue I think you want width: maxWidth(theWrap) + 4.
There was a problem hiding this comment.
@bcoe I've looked at this again but it seems that even without the width property it takes up the full line:

Isn't that what you meant with but it will take up a full line?
Using the width property like you suggested makes it wrap after each character:

Anyway, what I besides would suggest is perhaps adding a newline after each example to make it more distinguishable:

This can be achieved very easily with a bottom padding of 1.
bd1e40a to
37960eb
Compare
This PR fixes #697. Now, if an example is defined without a description, the usage example will take up the entire line instead of just 50% of it.