rustdoc: migrate document_type_layout to askama#109949
rustdoc: migrate document_type_layout to askama#109949bors merged 7 commits intorust-lang:masterfrom
document_type_layout to askama#109949Conversation
|
r? @jsha (rustbot has picked a reviewer for you, use r? to override) |
camelid
left a comment
There was a problem hiding this comment.
Since I implemented the original version of this function, I thought reviewing this PR could be a good way to start getting familiar with Askama. :)
There was a problem hiding this comment.
What's the meaning of the {# #} here and below? According to Askama's docs, it's a block comment?
There was a problem hiding this comment.
It's a block comment, yes.
The point of it is to eat the whitespace between the end of this tag and the start of the one on the next line (it would normally be preserved).
There was a problem hiding this comment.
According to Askama's docs, the {#+ #} keeps whitespace, but don't we want to suppress it to reduce page size?
There was a problem hiding this comment.
If it was {# #}, I'd wind up with <strong>completelyunstable</strong>. If it was completely absent, I'd wind up with the newline and several spaces in a row between the two words.
|
☔ The latest upstream changes (presumably #109925) made this pull request unmergeable. Please resolve the merge conflicts. |
ae57609 to
08f204e
Compare
jsha
left a comment
There was a problem hiding this comment.
Thanks for working on this! Sorry I was slow to get back to you.
ab8ea2b to
e26ae95
Compare
|
@jsha These all seem like good ideas, and I've pushed a new version of the commit that makes these changes. |
jsha
left a comment
There was a problem hiding this comment.
Generally looks great! Just a style question about nesting lets in scopes. And, relatedly: why nest the struct definitions inside document_type_layout? It winds up making the function body harder to navigate. If we're concerned about polluting scopes, maybe it would be better to use a module? That is, have render/type_layout.rs, with document_type_layout as the only public item, and with struct TypeLayout and struct TypeLayoutSize at the top level of that module.
|
The nested The nested rust/src/librustdoc/html/sources.rs Lines 294 to 312 in 4212c1b |
This comment has been minimized.
This comment has been minimized.
097a299 to
e6664c0
Compare
jsha
left a comment
There was a problem hiding this comment.
Looks great. r=me when tests pass. Thanks!
|
@bors r=jsha rollup |
Rollup of 7 pull requests Successful merges: - rust-lang#109949 (rustdoc: migrate `document_type_layout` to askama) - rust-lang#110622 (Stable hash tag (discriminant) of `GenericArg`) - rust-lang#110635 (More `IS_ZST` in `library`) - rust-lang#110640 (compiler/rustc_target: Raise m68k-linux-gnu baseline to 68020) - rust-lang#110657 (nit: consistent naming for SimplifyConstCondition) - rust-lang#110659 (rustdoc: clean up JS) - rust-lang#110660 (Print ty placeholders pretty) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.