A couple of things happened when preparing to release 3.0
- We needed derive documentation
- I had liked how serde handled theres
- I had bad experiences finding things in structopt's documentation
- The examples were broken and we needed tests
- The examples seemed to follow a pattern of having tutorial content and
cookbook content
- We had been getting bug reports from people looking at master and
thinking they were looking at what is currently released
- We had gotten feedback to keep down the number of places that
documentation was located
From this, we went with a mix of docs.rs and github
- We kept the number of content locations at 2 rather than 3 by not
having an external site like serde
- We rewrote the examples into explicit tutorials and cookbooks to align
with the 4 styles of documentation
- We could test our examples by running `console` code blocks with
trycmd
- Documentation was versioned and the README pointed to the last release
This had downsides
- The tutorials didn't have the code inlined
- Users still had a hard time finding and navigating between the
different forms of documentation
- In practice, we were less likely to cross-link between the different
types of documentation
Moving to docs.rs would offer a lot of benefits, even if it is only
designed for Rust-reference documentation and isn't good for Rust derive
reference documentation, tutorials, cookbooks, etc. The big problem was
keeping the examples tested to keep maintenance costs down. Maybe its
just me but its easy to overlook
- You can pull documentation from a file using `#[doc = "path"]`
- Repeated doc attributes get concatenated rather than first or last
writer winning
Remember these when specifically thinking about Rust documentation made
me realize that we could get everything into docs.rs.
When doing this
- Tutorial code got brought in as was one of the aims
- We needed to split the lib documentation and the README to have all of
the linking work. This allowed us to specialize them according to
their rule (user vs contributor)
- We needed to avoid users getting caught up in making a decision
between Derive and Builder APIs so we put the focus on the derive API
with links to the FAQ to help users decide when to use one or the
other.
- Improved cross-referencing between different parts of the
documentation
- Limited inline comments were added to example code
- Introductory example code intentionally does not have teaching
comments in it as its meant to give a flavor or sense of things and
not meant to teach on its own.
This is a first attempt. There will be a lot of room for further
improvement. Current know downsides:
- Content source is more split up for the tutorials
This hopefully addresses #3189
This adds a new `Cargo.toml` feature named `deprecated` that opts
controls whether deprecation warnings show up. This is starting off as
non-default though that may change (see below).
Benefits
- Allows a staged rollout so a smaller subset of users see new
deprecations and can report their experience with them before everyone
sees them. For example, this reduces the number of people who have to
deal with #3822.
- This allows people to defer responding to each new batch of
deprecations and instead do it at once. This means we should
reconsider #3616.
The one risk is people who don't follow blog posts and guides having a
harder time upgrading to the next breaking release without the warnings
on by default. For these users, we reserve the right to make the
`deprecated` feature `default`. This is most likely to happen in a
minor release that is released in conjunction with the next major
release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables
deprecations by default). By using a feature, users can still disable
this if they want.
Thanks @joshtriplett for the idea
`multicall` allows you to have one binary expose itself as multiple
programs, like busybox does. This also works well for user clap for
parsing REPLs.
Fixes#2861
`-h` (short help) still shows the same.
This gates it behind an `unstable-v4` feature flag to avoid disrupting users who set the help without knowing where all it shows up (particularly derive users where `ArgEnum` is automatically extracting the help).
Fixes#3312
3468325b8d and afd0342a added extra context to the README's example. However, when browsing it at docs.rs, the builder link just links back to the page you are own, offering little value.
Instead we'll now link to the tutorial which works as a next step from the example and resolves the "what do we link for the builder api" question.