Skip to content

Commit

Permalink
docs: Clarify how to use examples
Browse files Browse the repository at this point in the history
When we restuctured the examples, we lost the notes on how they should
be structured, so this adds it back in.
  • Loading branch information
epage committed Sep 27, 2022
1 parent a0c8c7d commit f925ca8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -2,8 +2,6 @@

Contributions are always welcome! And there is a multitude of ways in which you can help depending on what you like to do, or are good at. Anything from documentation, code cleanup, issue completion, new features, you name it, even filing issues is contributing and greatly appreciated!

Another really great way to help is if you find an interesting, or helpful way in which to use `clap`. You can either add it to the [examples/](examples) directory, or file an issue and tell me. I'm all about giving credit where credit is due :)

## Goals

There are a few goals of `clap` that I'd like to maintain throughout contributions. If your proposed changes break, or go against any of these goals we'll discuss the changes further before merging (but will *not* be ignored, all contributes are welcome!). These are by no means hard-and-fast rules, as I'm no expert and break them myself from time to time (even if by mistake or ignorance :P).
Expand Down
16 changes: 16 additions & 0 deletions examples/README.md
@@ -0,0 +1,16 @@
# Examples

We try to focus our documentation on the [four types of
documentation](https://documentation.divio.com/). Examples fit into this by
providing:
- [Cookbook / How-To Guides](https://docs.rs/clap/latest/clap/_cookbook/index.html)
- Tutorials ([derive](https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html), [builder](https://docs.rs/clap/latest/clap/_tutorial/index.html)

This directory contains the source for the above.

## Contributing

New examples should fit within the above structure and support their narrative
- Add the example to [Cargo.tom](../Cargo.toml) for any `required-features`
- Document how the example works with a `.md` file which will be verified using [trycmd](https://docs.rs/trycmd)
- Pull the `.rs` and `.md` file into the appropriate module doc comment to be accessible on docs.rs

0 comments on commit f925ca8

Please sign in to comment.