-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo new: create a README #3506
Comments
The format that bundler is not what I would put. I think the SYNOPSIS approach pioneered by cpan and largely copied by many npm packages is the most important thing to have in a readme. Always at the top with a short code example that shows how to use the package. Starting with how to install a package is less helpful because when somebody first encounters a package, they don't know if a package appropriately solves their problem yet. |
Yeah, I'm not saying we should literally copy Bundler. |
Sounds like a great idea to me! |
In the survey we ran, people also mentioned going to the documentation and wanting to see readme-like content (purpose and an example) on the front page of the docs. I think we could encourage better documentation front pages by adding a module comment to the top of the generated
The text talks about where it lives and where you'll see it so that if you're looking at that file, you'll know where the text ends up, and if you're looking at your generated docs, you'll know where to go to edit the text you see on the front page. |
Creating any file as part of a project template implies that the file should be standardized in format, IMO. This is hard to do for informal/semi-structured data such as documentation. Also, the default markup language itself needs to be settled, which will lead to discussion. |
While this is true, there's some stuff that's common to all projects, and if it doesn't work for you, you can delete it.
This is already markdown, by the vast majority.
We've had two of those! https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md being the most recent, that built on that one. |
Disagree on your first point. The same is true for e.g. an issue template on GitHub, ultimately rejected (rust-lang/rust#33164) because it would inconvenience those who feel it mismatches with their issue. Perhaps more people find the Mildly disagree with your second point. AsciiDoctor is another format that is IMO far more appropriate for software documentation than Markdown (some motivation via https://news.ycombinator.com/item?id=11292280). Discussion about this even in the Rust context is normal (https://internals.rust-lang.org/t/rustdoc-asciidoctor-vs-markdown/4161). I am not referring to API documentation, but to user documentation. Do you agree it should be decided what content is actually ‘common to all projects’, next how to optimally present it, based on a study of evidence, before putting out |
I'd be happy to take this up. I'd like to establish the scope of this particular issue. Would this be the default behaviour with the My understanding of the scope so far is that there is to be a template for a README.md and a standard template for module level documentation comments. Have we agreed on a standard format regarding the format of the former? Did we also want to warn the user on a |
I am not on the Cargo team, but I'd expect it to be part of the default behavior of I just became aware of https://github.com/RichardLitt/standard-readme, I haven't actually read it yet though. |
That project looks good, I'll take a look at it. Did we want a flag to disable default documentation creation? |
@vignesh-sankaran: Can you please address @carols10cents comment on the doc comment template? To me that is far less controversial and more productive than creating a Creating a |
An argument can be made that standard tools (e.g., |
I'm not going to be able to work on this until mid November due to university and not wanting to overwork myself. If anyone else wants to take up this issue they are more than welcome to do so, otherwise I'll be able to take this up in a month's time. |
@sanmai-NL can that argument actually be supported? Windows doesn't have I also don't agree that |
More on topic, I have been thinking a lot about how nice it would be to have These thoughts together have led me to wonder if $ cargo new which would also allow users to elect to have a library+binary crate, which is an increasingly popular way of structuring Rust projects. Obviously, this is a very rough sketch of an idea that I feel is an extension of the idea proposed in this issue. I could open another issue, if desired, or there might already be one for this, but I didn't see one. |
On
|
Ok so I'm back, the interactive mode sounds like a good idea, but we should also have a way around it for more experienced users. At this point, should we be considering an RFC for this issue, or at least some sort of scope definition so that I know what to work on? @carols10cents's suggestion regarding doc comments does sound like a great idea, maybe I could get started with that in the mean time? |
Nominating for discussion at the next Cargo meeting: while it is clear that we want to encourage and simplify documentation of Rust crates, it's not clear what is the best way to achieve this. In particular, creating a dummy Readme.md and/or top-level comment is not a clear win, because:
An alternative approach would be to add "preflight checks" on |
As suggested by @matklad, we could have warnings regarding missing documentation that are run as checks prior to an initial publish. Perhaps we could also run these checks subsequently if it failed them initially until they are resolved or indefinitely. Checks that come to mind that we could run include:
|
I actually don't see much benefit in spending a lot of effort to prevent publishing of crates with default docs/readme... if you're intending for other people to consume your crate, you're going to change those, and if you're not ready or ever intending other people to want to use your crate, they likely won't if you publish with the default docs :) |
I originally shared @carols10cents's sentiment, but when I thought about it more I realized that at least in node, I quite often quickly create a templated package and publish it immediately. I think that's still a desirable thing to be able to do, and I loathe the way that Rubygems forces me to fix a bunch of pointless TODO templating in its default gemspec, so I was thinking maybe a middle ground would be to detect the template and not render its contents? That way people who publish the template are no worse off than today, but we also give people a nice starting point for documentation. |
@matklad: I kindly remind everyone that I’m in favor of having # Maintenance: `status` is required Available options are `actively-developed`,
# `passively-maintained`, `as-is`, `none`, `experimental`, `looking-for-maintainer`
# and `deprecated`.
maintenance = { status = "..." } This helps programmers filter out a lot of crates when browsing crates.io depending on their requirements. After that, the API docs are relevant, only when that is okay that a |
@sanmai-NL We could default to
I'm generally opposed to warnings without teeth, as my experience in other ecosystems is that people come to ignore them habitually, and they just add to the noise level of the general experience. As the noise level gets worse, there is "noise inflation" as people try to get "the really important stuff" to be loud enough to be seen, which creates a vicious cycle. If we want to stop people from publishing crates with QA issues, we should stop them. If we want to do this, we should also probably give some thought to automating the process of fixing the QA issues. |
@wycats: Agree about warnings vs. errors, but I find many people oppose vehemently to be forced to comply with best practices. |
For what it's worth, I think that we do have such a definition right now, encoded (as you suggest) through publication-time errors. They include a restriction on the use of |
I'm on the Cargo team, don't work for Mozilla, and my primary interest, like yours, is my use of Rust in production. We even advertise the fact that we use Rust as an important feature in our product: I don't disagree that it can be difficult for production users to provide good input into the process, because being a production users by definition means you don't have time to review issues and respond as much as what you're calling "hobby users". I also believe that the process, for this reason, is a little too tilted towards people who have time to write a lot of comments on issues, and it's something that I think there's a lot of appetite for improving. I'd be very happy to talk with you (publicly or privately) about these concerns and ways that we can improve our process to address them. (I also don't believe that production users are well served by turning many small decisions into RFCs, because the current RFC process is dominated by what you're calling "hobby users", simply because they have more time to respond many times per day to an RFC thread) |
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
I still think this is worth doing, but it seems to have been mired in tangential discussions and then the conversation dwindled to a halt. |
I think this is blocked on the larger RFC-sized #5151 about cargo templates in general, which I think was on the agenda but got pushed for other edition priorities. |
@coder543: tangential discussion, or rather critical discussion whether adding this feature is what we really need. |
If the decision at rust-lang/rfcs#2549 (comment) is upheld by the teem then this should be closed asswell. |
@Eh2406 I don't see why. Editorconfig is a niche technology. READMEs are a rather fundamental thing. Since the README is used as part of crates.io, it's arguably a minimal file needed to create a new Rust project. Not to mention that |
There's an argument (for example, as presented by @withoutboats in #2039 (comment)) that things should be, hmm, less "dictated" by crates.io. |
Imo, the arguments made in rust-lang/rfcs#2549 also apply here, cargo should remain lightweight and only do build system and dependency management related things. Anything extra, like README, Editorconfig, CONTRIBUTING, etc. should be an ergonomic opt in with cargo templates. A popular one could be an OSS template, that has the 3 aforementioned files plus LICENSE. If we start making exceptions for things like README, where do we draw the line? Also the cargo template story might be less clear, teaching that for anything that is not related to building the software like README files you can use cargo templates, is simple. Unfortunately there are already exceptions to this, like vcs, let's not make the situation worse. |
@steveklabnik See https://github.com/ashleygwilliams/cargo-generate and https://github.com/livioribeiro/cargo-readme. Now that solutions for the issues discussed here have sprung from the OSS ecosystem, I think it's better to close this issue, since it proposes new work, and instead focus on improving and/or integrating them into Cargo. |
@steveklabnik any updates on this? if needed we can mark this as e-easy and get some volunteers to do it :D |
I’m not aware of any, let’s do it!
… On Dec 23, 2019, at 12:47 AM, Dylan DPC ***@***.***> wrote:
@steveklabnik any updates on this? if needed we can mark this as e-easy and get some volunteers to do it :D
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@steveklabnik I don't have permissions on this repo so you (or someone else) will have to do it :) |
Hey @Dylan-DPC and @steveklabnik. I'm a Cargo user and noob to the open source project. I'd like to take a crack at this if you can give me some guidance as to the implementation plan. After reading through the comments here it looks like there are quite a few opinions as to what approach to take. |
I am not on the cargo team, so I cannot really make that call. |
Per some discussion and guidance in #8029, I'm going to start working on an RFC. |
I posted a Pre-RFC on internals. Here's a link in case anyone would like to participate in the discussion: |
Based on this comment
So I'm going to close this likewise |
Was talking with @ceejbot about Rust and docs on twitter, and she had a great idea:
Bundler, for example, already does this:
The text was updated successfully, but these errors were encountered: