Skip to content

Some documentation fixes#109

Merged
Liam-DeVoe merged 21 commits intohegeldev:mainfrom
winterqt:push-qszsulnplvlo
Mar 27, 2026
Merged

Some documentation fixes#109
Liam-DeVoe merged 21 commits intohegeldev:mainfrom
winterqt:push-qszsulnplvlo

Conversation

@winterqt
Copy link
Copy Markdown
Contributor

No description provided.

@winterqt winterqt marked this pull request as draft March 25, 2026 00:29
@winterqt
Copy link
Copy Markdown
Contributor Author

(forgot some intra-doc links, somehow. will fix.)

@Liam-DeVoe
Copy link
Copy Markdown
Member

I'm a bit torn on including scraped examples in our docs, because I would prefer emphasizing bespoke examples in each docstring instead. For many of the simpler generators, scraped examples are a distraction. I do think this is a net positive though.

@winterqt winterqt force-pushed the push-qszsulnplvlo branch from 2af502b to 7a1661c Compare March 26, 2026 19:13
@winterqt winterqt marked this pull request as ready for review March 26, 2026 19:13
Comment on lines 28 to 34

# Required for rustdoc to know that we're okay with building examples.
[[example]]
name = "stack"
doc-scrape-examples = true

[dependencies]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is listing just one of the examples, stack.rs. Is it still going to scrape all of the other example files?

Copy link
Copy Markdown
Member

@Liam-DeVoe Liam-DeVoe Mar 27, 2026

Choose a reason for hiding this comment

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

I don't see the requirement that we list [[examples]] in cargo.toml mentioned in the docs: https://doc.rust-lang.org/rustdoc/scraped-examples.html

Cargo seems to autodiscover the examples fine:

 ~/Desktop/Liam/coding/hegel/rust λ cargo build --example
error: "--example" takes one argument.
Available examples:
    die_hard
    ledger
    min_stack
    stack

 ~/Desktop/Liam/coding/hegel/rust λ 

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I went down this rabbit hole, and it is required, but for a more specific reason than the comment implied. Here's the docs page that convinced me: https://doc.rust-lang.org/cargo/reference/unstable.html#scrape-examples

Comment on lines 60 to 62

#[cfg(feature = "rand")]
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
pub use random::{HegelRandom, RandomsGenerator, randoms};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I confirmed this removal is correct, but only on nightly: rust-lang/rust#43781. docs-rs builds on nightly so this is fine

@Liam-DeVoe Liam-DeVoe enabled auto-merge March 27, 2026 18:09
@Liam-DeVoe Liam-DeVoe merged commit 9842643 into hegeldev:main Mar 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants