Skip to content

Commit b7df92d

Browse files
srukbknapp
authored andcommitted
docs: clean up some formatting
1 parent d7233bf commit b7df92d

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

src/lib.rs

+23-22
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
//!
2626
//! The following examples show a quick example of some of the very basic functionality of `clap`.
2727
//! For more advanced usage, such as requirements, exclusions, groups, multiple values and
28-
//! occurrences see the [video tutorials](https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv),
29-
//! [documentation](http://kbknapp.github.io/clap-rs/clap/index.html), or [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples)
30-
//! directory of this repository.
28+
//! occurrences see the [video tutorials][video tutorials], [documentation][docs], or
29+
//! [examples/][examples] directory of this crate's repository.
3130
//!
3231
//! **NOTE:** All these examples are functionally the same, but show three different styles in
3332
//! which to use `clap`
@@ -90,8 +89,7 @@
9089
//! The following example is functionally the same as the one above, but this method allows more
9190
//! advanced configuration options (not shown in this small example), or even dynamically
9291
//! generating arguments when desired. Both methods can be used together to get the best of both
93-
//! worlds (see the documentation, [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples),
94-
//! or video tutorials).
92+
//! worlds (see the documentation, [examples/][examples], or video tutorials).
9593
//!
9694
//! ```no_run
9795
//! // (Full example with detailed comments in examples/01b_quick_example.rs)
@@ -222,7 +220,7 @@
222220
//! tidy. First, create the `cli.yml` file to hold your CLI options, but it could be called
223221
//! anything we like (we'll use the same both examples above to keep it functionally equivilant):
224222
//!
225-
//! ```ignore
223+
//! ```yaml
226224
//! name: myapp
227225
//! version: 1.0
228226
//! author: Kevin K. <[email protected]>
@@ -307,7 +305,7 @@
307305
//! may not need. Simply change your `clap = "1"` to `clap = {version = "1", features = ["yaml"]}`
308306
//! in your `Cargo.toml` to use the YAML version.
309307
//!
310-
//! ```ignore
308+
//! ```text
311309
//! $ myapp --help
312310
//! myapp 1.0
313311
//! Kevin K. <[email protected]>
@@ -352,7 +350,7 @@
352350
//! * Create a new cargo project `$ cargo new fake --bin && cd fake`
353351
//! * Add `clap` to your `Cargo.toml`
354352
//! *
355-
//! ```ignore
353+
//! ```toml
356354
//! [dependencies]
357355
//! clap = "1"
358356
//! ```
@@ -375,21 +373,21 @@
375373
//!
376374
//! For full usage, add `clap` as a dependency in your `Cargo.toml` file to use from crates.io:
377375
//!
378-
//! ```ignore
376+
//! ```toml
379377
//! [dependencies]
380378
//! clap = "1"
381379
//! ```
382380
//! Or track the latest on the master branch at github:
383381
//!
384-
//! ```ignore
382+
//! ```toml
385383
//! [dependencies.clap]
386384
//! git = "https://github.com/kbknapp/clap-rs.git"
387385
//! ```
388386
//!
389387
//! Add `extern crate clap;` to your crate root.
390388
//!
391-
//! Define a list of valid arguments for your program (see the [documentation](https://kbknapp.github.io/clap-rs/index.html)
392-
//! or [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples) directory of this repo)
389+
//! Define a list of valid arguments for your program (see the [documentation][docs] or
390+
//! [examples/][examples] directory of this repo)
393391
//!
394392
//! Then run `cargo build` or `cargo update && cargo build` for your project.
395393
//!
@@ -398,15 +396,15 @@
398396
//! If you'd like to keep your dependency list to **only** `clap`, you can disable any features
399397
//! that require an additional dependency. To do this, add this to your `Cargo.toml`:
400398
//!
401-
//! ```ignore
399+
//! ```toml
402400
//! [dependencies.clap]
403401
//! version = "1"
404402
//! default-features = false
405403
//! ```
406404
//!
407405
//! You can also selectively enable only the features you'd like to include, by adding:
408406
//!
409-
//! ```ignore
407+
//! ```toml
410408
//! [dependencies.clap]
411409
//! version = "1"
412410
//! default-features = false
@@ -434,16 +432,14 @@
434432
//!
435433
//! ### More Information
436434
//!
437-
//! You can find complete documentation on the [github-pages site](http://kbknapp.github.io/clap-rs/clap/index.html)
438-
//! for this project.
435+
//! You can find complete documentation on the [github-pages site][docs] for this project.
439436
//!
440-
//! You can also find usage examples in the [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples)
441-
//! directory of this repo.
437+
//! You can also find usage examples in the [examples/][examples] directory of this repo.
442438
//!
443439
//! #### Video Tutorials
444440
//!
445-
//! There's also the video tutorial series [Argument Parsing with Rust](https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv)
446-
//! that I've been working on.
441+
//! There's also the video tutorial series [Argument Parsing with Rust][video tutorials] that I've
442+
//! been working on.
447443
//!
448444
//! *Note*: Two new videos have just been added ([08 From Usage](https://youtu.be/xc6VdedFrG0), and
449445
//! [09 Typed Values](https://youtu.be/mZn3C1DnD90)), if you're already familiar with `clap` but
@@ -457,15 +453,20 @@
457453
//!
458454
//! If contributing, you can run the tests as follows (assuming you're in the `clap-rs` directory)
459455
//!
460-
//! ```ignore
456+
//! ```sh
461457
//! cargo test --features yaml && make -C clap-tests test
462458
//! ```
463459
//!
464460
//! ## License
465461
//!
466-
//! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT](https://raw.githubusercontent.com/kbknapp/clap-rs/master/LICENSE-MIT)
462+
//! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT][license]
467463
//! file in
468464
//! this repository for more information.
465+
//!
466+
//! [examples]: https://github.com/kbknapp/clap-rs/tree/master/examples
467+
//! [docs]: http://kbknapp.github.io/clap-rs/clap/index.html
468+
//! [video tutorials]: https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv
469+
//! [license]: https://raw.githubusercontent.com/kbknapp/clap-rs/master/LICENSE-MIT
469470
470471
#![crate_type= "lib"]
471472
#![cfg_attr(feature = "nightly", feature(plugin))]

0 commit comments

Comments
 (0)