Skip to content

Commit f925ca8

Browse files
committed
docs: Clarify how to use examples
When we restuctured the examples, we lost the notes on how they should be structured, so this adds it back in.
1 parent a0c8c7d commit f925ca8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
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!
44

5-
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 :)
6-
75
## Goals
86

97
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).

examples/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Examples
2+
3+
We try to focus our documentation on the [four types of
4+
documentation](https://documentation.divio.com/). Examples fit into this by
5+
providing:
6+
- [Cookbook / How-To Guides](https://docs.rs/clap/latest/clap/_cookbook/index.html)
7+
- Tutorials ([derive](https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html), [builder](https://docs.rs/clap/latest/clap/_tutorial/index.html)
8+
9+
This directory contains the source for the above.
10+
11+
## Contributing
12+
13+
New examples should fit within the above structure and support their narrative
14+
- Add the example to [Cargo.tom](../Cargo.toml) for any `required-features`
15+
- Document how the example works with a `.md` file which will be verified using [trycmd](https://docs.rs/trycmd)
16+
- Pull the `.rs` and `.md` file into the appropriate module doc comment to be accessible on docs.rs

0 commit comments

Comments
 (0)