| Age | Commit message (Collapse) | Author | Lines |
|
Fix impl block in const expr
Fixes #83026.
The problem was that we didn't visit block expressions. Considering how big the [walk_expr](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/intravisit.rs.html#678) function is, I decided to instead implement the `hir` visitor on the struct. It also answers the question which was in a comment for `RustdocVisitor`: we should have used a visitor instead of our ad-hoc implementation.
Adding this visitor also added some extra checks that weren't present before (check changes in `rustdoc-ui` tests).
r? `@notriddle`
|
|
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
|
|
This gets rid of the more-scraped-examples-inner wrapper, instead nesting the
children directly and using absolute positioning for the toggle line.
|
|
|
|
rustdoc: simplify section anchor CSS
Since f50bf8636e3b0296db82e631fe95c84324a46ccc changed anchors to be always positioned absolute, specifying it on hover as well is redundant.
|
|
Since f50bf8636e3b0296db82e631fe95c84324a46ccc changed anchors to be
always positioned absolute, specifying it on hover as well is redundant.
|
|
|
|
r=notriddle
rustdoc: Simplify CSS for scraped code examples code blocks
It's another approach than https://github.com/rust-lang/rust/pull/105894 for https://github.com/rust-lang/rust/pull/105823.
I simply removed the extra style added for the scraped code blocks which appears to be unneeded.
r? `@notriddle`
|
|
rustdoc: force pre tags to have the default line height
Fixes #105906
|
|
|
|
|
|
Fixes #105906
|
|
rustdoc: clean up margin CSS for scraped examples
* This stops applying a margin to the additional example links. Because these links are `display: inline`, it doesn't actually do anything.
* This switches from using a margin-bottom with a special exception for the examples themselves, plus an additional margin on the hide button, to instead using just margin-top on the examples, with an exception for the first one.
No user-visible changes should result from this.
|
|
rustdoc: Don't add "Read more" link if there is no extra content
Fixes #105677.
|
|
* This stops applying a margin to the additional example links.
Because these links are `display: inline`, it doesn't actually do anything.
* This switches from using a margin-bottom with a special exception for
the examples themselves, plus an additional margin on the hide button,
to instead using just margin-top on the examples, with an exception for
the first one.
No user-visible changes should result from this.
|
|
|
|
r=GuillaumeGomez
rustdoc: name the source page sidebar-toggle `#src-sidebar-toggle`
The old name doesn't get across where it's really supposed to be used.
|
|
rustdoc: remove unused CSS `.sub-settings`
Obsoleted when 9625ed8be7fa66c3ee5f78180a3d5911817096f6 changed the DOM.
|
|
r=GuillaumeGomez
rustdoc: simplify CSS for codeblock tooltips
Instead of making its parts `display: none` and then changing it on hover, just make the pseudo-element itself on hover.
|
|
The old name doesn't get across where it's really supposed to be used.
|
|
Obsoleted when 9625ed8be7fa66c3ee5f78180a3d5911817096f6 changed the DOM.
|
|
Instead of making its parts `display: none` and then changing it on hover,
just make the pseudo-element itself on hover.
|
|
|
|
rustdoc: remove no-op CSS `.item-info:before { color }`
No content is set, so this pseudo-element does not exist. The CSS was obsoleted by 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0.
|
|
notriddle:notriddle/scrape-example-src-line-numbers, r=GuillaumeGomez
rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`
This is the default CSS for `<pre>` tags in `.code-wrapper` anyway, so this line does nothing.
|
|
r=jhpratt,GuillaumeGomez
rustdoc: remove unnecessary CSS `kbd { cursor: default }`
Added along with theme picker changes in https://github.com/rust-lang/rust/pull/47686/files#diff-7dc22a0530802d77c2f2ec9e834024a5657b6eab4055520fca46edc99a544413R1144, but no reason seems to have been given at the time for why this particular rule was added.
Removing this rule results in `<kbd>` elements getting an I-bar, while the rule causes them to use the "default" arrow, but since selecting the text in these elements works fine, the I-bar is not misleading.
|
|
No content is set, so this pseudo-element does not exist. The CSS was
obsoleted by 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0.
|
|
This is the default CSS for `<pre>` tags in `.code-wrapper` anyway, so this
line does nothing.
|
|
Added along with theme picker changes in
e78f1392b79779fa184f9a63e7be04ac7074a1c2, but no reason seems to have been
given at the time for why this particular rule was added.
Removing this rule results in `<kbd>` elements getting an I-bar, while the
rule causes them to use the "default" arrow, but since selecting the text in
these elements works fine, the I-bar is not misleading.
|
|
Improve rustdoc markdown variable naming
Opened on the right repository this time. :laughing:
r? `@notriddle`
|
|
rustdoc: add CSS margin between `impl` docblock and its items
## Before

## After

|
|
r=GuillaumeGomez
rustdoc: simplify popover CSS
* Merge the color-changing block into the regular rules, which was probably written that way because it used to be in the theme files, but has no reason to be written this way now that it's in rustdoc.css
* Get rid of redundant `display: block`, since `position: absolute` blockifies the layout anyway.
|
|
|
|
* Merge the color-changing block into the regular rules, which was
probably written that way because it used to be in the theme files,
but has no reason to be written this way now that it's in rustdoc.css
* Get rid of redundant `display: block`, since `position: absolute`
blockifies the layout anyway.
|
|
This is common syntax used for intra-doc links, so fixing it should help
with doc formatting.
|
|
|
|
rustdoc: remove `type="text/css" from stylesheet links
MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web."
Like 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were missed the first time.
|
|
r=GuillaumeGomez
rustdoc: stop treating everything in a trait item as a method
This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the spacing on trait pages, but stopped being needed because 791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.
|
|
MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>,
since "CSS is the only stylesheet language used on the web."
Like 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were
missed the first time.
|
|
This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the
spacing on trait pages, but stopped being needed because
791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle.
By only putting the method-toggle class on actual methods, the JS setting
does the right thing.
|
|
Since source pages use the `example-wrap` wrapper, this rule became
redundant because there is already an `overflow-x: auto` rule.
|
|
|
|
r=notriddle
rustdoc: Only hide lines starting with `#` in rust code blocks
Fixes https://github.com/rust-lang/rust/issues/105527.
So before approving, this is a big question: in rust code blocks, in a line starts with a `#`, we hide it in the output. However, should we do the same for non-rust code blocks too? I think it's a bit problematic to do it because `#` can be used for many things but I prefer to check first with everyone (might also be worth updating documentation too).
cc ``@rust-lang/rustdoc``
r? ``@notriddle``
|
|
|
|
|
|
Removes a few lifetimes and renames some.
|
|
rustdoc: make stability badge CSS more consistent
# Before


# After


# Description
* They all get rounded corners now. A test case has been added for this, too.
* There are now broadly two kinds of stability badge, where there used to be three: item-info "fat badge", and the "thin badge" in both item tables and in docblocks (which got merged). The fat badges can have icons, while the thin badges can't.
* The old Ayu design doesn't make sense to me. Does anyone know why it was done that way?
|
|
r=GuillaumeGomez
rustdoc: remove no-op mobile CSS `#sidebar-toggle { text-align }`
Since 8b001b4da0716936e0ca32303cc0e3c5e53e42f8 make the sidebar toggle a flex container, and already centers its content in desktop mode, this rule doesn't do anything.
|
|
* They all get rounded corners now. A test case has been added for this, too.
* There are now broadly two kinds of stability badge, where there used to be
three: item-info "fat badge", and the "thin badge" in both item tables and
in docblocks (which got merged). The fat badges can have icons, while the
thin badges can't.
|
|
r=GuillaumeGomez
rustdoc: clean up docblock table CSS
# Preview
http://notriddle.com/notriddle-rustdoc-demos/table-2/test_dingus/fn.test.html
# Before

# After

# Details
* The rule `display: block` had no noticeable effect. Technically, because markdown tables have a tbody and thead, they get wrapped in an [anonymous table box] in the CSS tree, nested within the `<table>` element's block layout box.
This rule was added in #87230 to make the table side-scrolling, but this same issue was doubly fixed in #88742 by wrapping it in an explicit `<div>` tag. Since accessibility advocates recommend the wrapper div over marking the table as `display: block`, we'll stick with that.
https://adrianroselli.com/2020/11/under-engineered-responsive-tables.html
* The rule `width: calc(100% - 2px)` had no visible effect, because the anonymous table box was not affected.
* The style is tweaked to basically be the same style GitHub uses. In particular, it adds zebra stripes, and removes dotted borders.
https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Markdown.20table.20styling
[anonymous table box]: https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
|