Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRun doc tests on README #383
Comments
This comment has been minimized.
This comment has been minimized.
|
I imagine people might have many markdown files which are documentation and contain examples; it would be nice to be able to specify additional |
This comment has been minimized.
This comment has been minimized.
|
Sounds like a good idea! We could at least start out with a README and expand it with a manifest key later on. |
alexcrichton
referenced this issue
Aug 26, 2014
Closed
Run doc tests over the README if present #445
This comment has been minimized.
This comment has been minimized.
|
Some concerns were raised in #445 which are applicable to this as well. |
This comment has been minimized.
This comment has been minimized.
|
The question is: how will README interact with the Cargo registry? Currently the examples are in the README file mainly because it's easy to read when you discover a library on github. But if the registry automatically provides the rustdoc output of each package, then I think that the basic examples should simply be in the crate root documentation, just like the standard |
This comment has been minimized.
This comment has been minimized.
skade
commented
Nov 22, 2014
|
I'd like to have this feature. Broken README code is worse then broken code in the crate docs, as this is the first place where people go to. Outdated READMEs are even worse of an issue, a thing tested READMEs elegantly circumvent. Also, I prefer writing README code, as crate documentation is a bit cumbersume and hard to read in source, given the amount of comment characters it needs. Rust code can be highlighted on github and ignored by using:
(this currently is parsed correctly, but not properly picked up. As a middleground, my suggestion is to allow listing additional documents to test with rustdoc in the Manifest and generate a Cargo.toml including "README.md" in that list per default. This raises awareness of the feature, but ultimately leaves the user in control. |
This comment has been minimized.
This comment has been minimized.
skade
commented
Feb 5, 2015
|
I'd like to push this one, I just ran into precisely the problem that my README examples were the only ones broken. |
This comment has been minimized.
This comment has been minimized.
pzol
commented
Feb 5, 2015
|
+1 |
This comment has been minimized.
This comment has been minimized.
pythonesque
commented
Feb 5, 2015
|
I would love this. Concerns can be addressed by making the feature opt-in (and maybe also with attribute metadata, but I don't know markdown well enough to know if that's a thing). |
This comment has been minimized.
This comment has been minimized.
moonglum
commented
Feb 6, 2015
|
|
This comment has been minimized.
This comment has been minimized.
s-panferov
commented
Feb 6, 2015
|
Always forget to update README.md in my projects |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
potentially relevant: rust-lang/rfcs#1990 |
carols10cents
added
C-feature-request
Command-test
labels
Sep 10, 2017
This comment has been minimized.
This comment has been minimized.
abonander
commented
Jan 23, 2019
•
|
The external docs include feature (RFC 1990) is definitely the best way to go about this, IMO. You could include your README.md as the docs for a hidden item and then |
This comment has been minimized.
This comment has been minimized.
abonander
commented
Jan 25, 2019
•
|
In case anyone missed it, I've got a proof-of-concept project for using the This can be done conditionally under a Cargo feature so it doesn't require nightly to test. |
huonw commentedAug 16, 2014
cargo testcould run (the equivalent of)rustdoc --test README.md, since people often have a basic example in it.