New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: line wrapping for examples without desc #749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bcoe So you mean I should add a width property like in line 276? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxrimue I think you want width: maxWidth(theWrap) + 4
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxrimue my bad, we only need to specify width in a multi-column layout I believe.
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.