Skip to content

Rendering messed up for old crates #1027

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

Closed
xd009642 opened this issue Sep 2, 2020 · 8 comments
Closed

Rendering messed up for old crates #1027

xd009642 opened this issue Sep 2, 2020 · 8 comments
Labels
A-frontend Area: Web frontend C-bug Category: This is a bug

Comments

@xd009642
Copy link

xd009642 commented Sep 2, 2020

https://docs.rs/syntex_syntax/0.54.0/syntex_syntax/ast/enum.MetaItemKind.html

So on google chrome Version 84.0.4147.125 (Official Build) (64-bit) using fedora 31 I saw this:

Screenshot from 2020-09-02 21-23-21

I know syntex_syntax is deprecated and people should use syn instead, but I guess it would be nice if legacy things rendered properly for future instances where someone will be maintaining legacy software

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

There are two divs that both have the container-rustdoc class: one underneath nav-container and one at the top level of the body. The first one is wrong.

container-rustdoc

Possibly fallout from #930?

@jyn514 jyn514 added A-frontend Area: Web frontend C-bug Category: This is a bug labels Sep 2, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

Relevant code:

// Before: <body> ... rustdoc content ... </body>
// After:
// ```html
// <div id="rustdoc_body_wrapper" class="{{ rustdoc_body_class }}" tabindex="-1">
// ... rustdoc content ...
// </div>
// ```
let body_handler = |rustdoc_body_class: &mut Element| {
// Add the `rustdoc` classes to the html body
let mut tmp;
let klass = if let Some(classes) = rustdoc_body_class.get_attribute("class") {
tmp = classes;
tmp.push_str(" container-rustdoc");
&tmp
} else {
"container-rustdoc"
};

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

We're adding it in two places 🤦

<div class="container-rustdoc rustdoc-navigation">

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

syntext_syntax doesn't build with 1.48 so I'm having trouble confirming whether my fix actually works.

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

Actually that wouldn't help anyway since I'm 99% sure this is due to a difference in the generated rustdoc HTML. I need to build it with the original toolchain with CRATESFYI_TOOLCHAIN.

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

I am unable to replicate the build with a toolchain that old, it errors out on cargo metadata.

2020/09/02 17:10:44 [INFO] rustwide::cmd: running `Command { std: "/home/joshua/src/rust/docs.rs-workspace/cargo-home/bin/cargo" "+1.15.0" "metadata" "--format-version" "1", kill_on_drop: false }`
Error: Building documentation failed

Caused by:
    missing field `crate_types` at line 1 column 432

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

Duplicate of #1005

@jyn514 jyn514 marked this as a duplicate of #1005 Sep 2, 2020
@jyn514 jyn514 closed this as completed Sep 2, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 20, 2020

@xd009642 this has been fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Web frontend C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants