Skip to content
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

doc: fix word wrapping for api stability boxes #14809

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/api_assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ em code {
color: white !important;
margin: 0 0 1em 0;
font-family: "Lato", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Tahoma, sans-serif;
font-weight: 700;
white-space: pre-wrap;
word-wrap: break-word;
padding: 1em;
line-height: 1.5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these (esp. the font and wrapping ones) still necessary now that the container has been switched to a <div>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, you're right. Since it's not pre anymore, the wrapping is no longer an issue. The padding and line-height are still necessary though.

Copy link
Contributor Author

@saadq saadq Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the wrapping changes. Just to clarify, I don't know if the line-height is strictly "necessary", I just added it because that was what the pre had originally. I'm not sure if you all think it looks fine without it.

Without line-height:
screen shot 2017-08-14 at 5 18 42 am

With line-height:
screen shot 2017-08-14 at 5 18 53 am

Copy link
Contributor

@silverwind silverwind Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I like it more with the extra space. Another option would be to make it a <p> which already sets 1.5em line-height and a similar margin-bottom, so you save two declarations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought, it might be unexpected to have <p> and those boxes share CSS. So, LGTM as-is.

}

.api_stability * {
Expand Down
2 changes: 1 addition & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function parseAPIHeader(text) {

text = text.replace(
STABILITY_TEXT_REG_EXP,
`<pre class="${classNames}"><a href="${docsUrl}">$1 $2</a>$3</pre>`
`<div class="${classNames}"><a href="${docsUrl}">$1 $2</a>$3</div>`
);
return text;
}
Expand Down