Skip to content

Commit 7f33cf2

Browse files
committed
feat(docs): add cargo.toml dependency information
Fixes #10
1 parent bec5cd5 commit 7f33cf2

3 files changed

Lines changed: 51 additions & 20 deletions

File tree

gen/youtube3/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ The `doit()` method performs the actual communication with the server and return
7070

7171
# Usage
7272

73+
## Setting up your Project
74+
75+
To use this library, you would put the following lines into your `Cargo.toml` file:
76+
77+
```toml
78+
[dependencies]
79+
youtube3 = "0.0.1"
80+
```
81+
7382
## A complete example
7483

7584
```Rust
@@ -82,13 +91,14 @@ use std::default::Default;
8291
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
8392
use youtube3::YouTube;
8493

85-
// Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`,
86-
// among other things.
94+
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
95+
// `client_secret`, among other things.
8796
let secret: ApplicationSecret = Default::default();
8897
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
89-
// unless you replace `None` with the desired Flow
90-
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on
91-
// You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage.
98+
// unless you replace `None` with the desired Flow.
99+
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
100+
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
101+
// retrieve them from storage.
92102
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
93103
hyper::Client::new(),
94104
<MemoryStorage as Default>::default(), None);

gen/youtube3/src/lib.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@
6969
//!
7070
//! # Usage
7171
//!
72+
//! ## Setting up your Project
73+
//!
74+
//! To use this library, you would put the following lines into your `Cargo.toml` file:
75+
//!
76+
//! ```toml
77+
//! [dependencies]
78+
//! youtube3 = "0.0.1"
79+
//! ```
80+
//!
7281
//! ## A complete example
7382
//!
7483
//! ```test_harness,no_run
@@ -82,13 +91,14 @@
8291
//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
8392
//! use youtube3::YouTube;
8493
//!
85-
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`,
86-
//! // among other things.
94+
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
95+
//! // `client_secret`, among other things.
8796
//! let secret: ApplicationSecret = Default::default();
8897
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
89-
//! // unless you replace `None` with the desired Flow
90-
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on
91-
//! // You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage.
98+
//! // unless you replace `None` with the desired Flow.
99+
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
100+
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
101+
//! // retrieve them from storage.
92102
//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
93103
//! hyper::Client::new(),
94104
//! <MemoryStorage as Default>::default(), None);
@@ -267,13 +277,14 @@ impl Default for Scope {
267277
/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
268278
/// use youtube3::YouTube;
269279
///
270-
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`,
271-
/// // among other things.
280+
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
281+
/// // `client_secret`, among other things.
272282
/// let secret: ApplicationSecret = Default::default();
273283
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
274-
/// // unless you replace `None` with the desired Flow
275-
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on
276-
/// // You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage.
284+
/// // unless you replace `None` with the desired Flow.
285+
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
286+
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
287+
/// // retrieve them from storage.
277288
/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
278289
/// hyper::Client::new(),
279290
/// <MemoryStorage as Default>::default(), None);

src/mako/lib/lib.mako

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ The `${api.terms.action}()` method performs the actual communication with the se
102102

103103
# Usage
104104

105+
${'##'} Setting up your Project
106+
107+
To use this library, you would put the following lines into your `Cargo.toml` file:
108+
109+
```toml
110+
[dependencies]
111+
${util.library_name()} = "${cargo.build_version}"
112+
```
113+
105114
${'##'} A complete example
106115

107116
${self.hub_usage_example(c, rust_doc, fr=fr)}\
@@ -157,15 +166,16 @@ use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, Mem
157166
use ${util.library_name()}::${hub_type};
158167
159168
% if comments:
160-
// Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`,
161-
// among other things.
169+
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
170+
// `client_secret`, among other things.
162171
% endif
163172
let secret: ApplicationSecret = Default::default();
164173
% if comments:
165174
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
166-
// unless you replace `None` with the desired Flow
167-
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on
168-
// You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage.
175+
// unless you replace `None` with the desired Flow.
176+
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
177+
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
178+
// retrieve them from storage.
169179
% endif
170180
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
171181
hyper::Client::new(),

0 commit comments

Comments
 (0)