-
Notifications
You must be signed in to change notification settings - Fork 117
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
Match CI doc testing with docs.rs. #726
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.
Thanks!
@@ -5,7 +5,7 @@ | |||
|
|||
<div class="rustdoc-hidden"> | |||
|
|||
> [!TIP] | |||
> 💡 Tip |
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.
:( - this rendering is appreciably less obvious, but I can understand the motivation
Moving the <div class="rustdoc-hidden">
into mod.rs
should work, if we use the following:
That does move the title below the tip, but that might be just as fine - we don't expect too many people to view it in-situ.
<!-- Copyright 2024 the Xilem Authors -->
<!-- SPDX-License-Identifier: Apache-2.0 -->
> [!TIP]
>
> This file is intended to be read in rustdoc.
> Use `cargo doc --open --package masonry --no-deps`.
</div>
# Building a "To-Do List" app
Leaving it this way is also fine, to be clear.
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.
features = ["kurbo"] | ||
[[example]] | ||
name = "user_interface" | ||
# This actually enables scraping for all examples, not just this one. |
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.
That's janky...
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.
Very much so, but I guess it's not stabilized yet so they're going with it.
# rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 | ||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] | ||
|
||
[[example]] | ||
name = "mason" | ||
# This actually enables scraping for all examples, not just this one. | ||
# However it is possible to set doc-scrape-examples to false for other specific examples. | ||
doc-scrape-examples = true |
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.
Do we need to disable this for the _android
examples?
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.
Thankfully it's smart enough to not duplicate the examples, so no.
rustdoc
bugs giving false positives but I got it to pass without failure right now, so perhaps better times have arrived.x86_64-unknown-linux-gnu
on docs.rs as we don't have any platform specific docs.xilem
,xilem_core
, andmasonry
. Fully disable it forxilem_web
which does not have examples as Cargo defines them.--all-features
at docs.rs to match our CI and reduce the maintenance burden of manually syncing the features list.doc_auto_cfg
feature for docs.rs which will show a little tip next to feature gated functionality informing of the crate feature flag.[!TIP]
with💡 Tip
that was inside<div class="rustdoc-hidden" />
. The GitHub specific tip causes arustdoc
error and didn't even render properly.01_creating_app.md
just enough to getrustdoc
to pass, but that file needs a bunch of more work, as it is outdated.