Skip to content

Conversation

alexcrichton
Copy link
Member

The default path to the readme is README.md, and this can be overridden with
the readme key in the project manifest. A value of false will disable
documentation tests, while a string value will be considered the relative path
to the readme.

Closes #383

The default path to the readme is `README.md`, and this can be overridden with
the `readme` key in the project manifest. A value of `false` will disable
documentation tests, while a string value will be considered the relative path
to the readme.
@tomaka
Copy link
Contributor

tomaka commented Aug 26, 2014

I'm not sure that this is a good idea.

This will fail: https://github.com/bjz/gl-rs/blob/master/README.md
This will fail: https://github.com/tomaka/rust-hl-lua/blob/master/README.md
This will fail: https://github.com/PistonDevelopers/rust-image
etc.

In regular documentation you can fix this by having ````ignoreor by adding hidden lines with a#` prefix, but this is not desirable in a README file because it makes the file more difficult to read (example).

A lot of repositories will probably choose between removing all code from their README or disable this feature.

@brson
Copy link
Contributor

brson commented Aug 26, 2014

I'm also a bit skeptical of this.

@alexcrichton
Copy link
Member Author

Hm ok, I think we'll need to think more closely about this feature.

@alexcrichton alexcrichton deleted the issue-383 branch August 27, 2014 15:11
@WaffleLapkin
Copy link
Member

In regular documentation you can fix this by having ```ignore or by adding hidden lines with a # prefix, but this is not desirable in a README file because it makes the file more difficult to read (example).

Actually you could write

```rust,ignore

This will be understood by both rustdoc and github

@tim-weis
Copy link

tim-weis commented Sep 3, 2022

I'm not sure that this is a good idea.

This will fail: https://github.com/bjz/gl-rs/blob/master/README.md
This will fail: https://github.com/tomaka/rust-hl-lua/blob/master/README.md
This will fail: https://github.com/PistonDevelopers/rust-image etc.

In regular documentation you can fix this by having ````ignoreor by adding hidden lines with a#` prefix, but this is not desirable in a README file because it makes the file more difficult to read (example).

A lot of repositories will probably choose between removing all code from their README or disable this feature.

It's been 8 years. Are those concerns still valid, or is it time to progress along with common practice? I'd love to see some tentative (or aggressive, even) exploration on this.

What are the specific issues inhibiting progress on this?

@WaffleLapkin
Copy link
Member

The ignore concern I believe is not valid anymore, as noted in #445 (comment). # is not understood by github the same way it is used by rustdoc (hiding lines) though, so to be able to use this feature you'll need to make the examples complete, for better or worse.

I don't think this can be added as a default behavior, but as an opt-in I think this is sensible.

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.

Run doc tests on README
5 participants