Skip to content

Commit 6261e15

Browse files
authored
docs(subscriber): use H1 headers in builder API docs (#204)
This changes the `Builder` API docs to use H1 (`#`) markdown headers rather than H2 (`##`) headers for top-level sections in the documentation. It turns out that when the docs are on a function/method, RustDoc makes the H2 headers really small and it looks weird. **Before**: ![image](https://user-images.githubusercontent.com/2796466/146258971-27d08d26-f862-4185-838c-526b46e3ac96.png) Note how weirdly tiny the header text is. **After**: ![image](https://user-images.githubusercontent.com/2796466/146259132-1af30df4-7196-418c-91f5-ea2a1158ead1.png) Now, the header text is a more normal size!
1 parent 1aa9b59 commit 6261e15

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

console-subscriber/src/builder.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl Builder {
175175
/// for your application. If you need to add additional layers to a subscriber,
176176
/// see [`spawn`].
177177
///
178-
/// ## Panics
178+
/// # Panics
179179
///
180180
/// * If the subscriber's background thread could not be spawned.
181181
/// * If the [default `tracing` subscriber][default] has already been set.
@@ -185,7 +185,7 @@ impl Builder {
185185
/// [`tracing_subscriber::fmt`]: https://docs.rs/tracing-subscriber/latest/tracing-subscriber/fmt/index.html
186186
/// [`Server`]: crate::Server
187187
///
188-
/// ## Configuration
188+
/// # Configuration
189189
///
190190
/// Tokio console subscriber is configured with sensible defaults for most
191191
/// use cases. If you need to tune these parameters, several environmental
@@ -199,7 +199,7 @@ impl Builder {
199199
/// | `TOKIO_CONSOLE_RECORD_PATH` | The file path to save a recording | None |
200200
/// | `RUST_LOG` | Configures what events are logged events. See [`Targets`] for details. | "error" |
201201
///
202-
/// ## Further customization
202+
/// # Further customization
203203
///
204204
/// To add additional layers or replace the format layer, replace
205205
/// `console_subscriber::Builder::init` with:
@@ -251,16 +251,16 @@ impl Builder {
251251
/// [`Layer`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/layer/trait.Layer.html
252252
/// [`Server`]: crate::Server
253253
///
254-
/// ## Panics
254+
/// # Panics
255255
///
256256
/// * If the subscriber's background thread could not be spawned.
257257
///
258-
/// ## Configuration
258+
/// # Configuration
259259
///
260260
/// `console_subscriber::build` supports all of the environmental
261261
/// configuration described at [`console_subscriber::init`].
262262
///
263-
/// ## Differences from `init`
263+
/// # Differences from `init`
264264
///
265265
/// Unlike [`console_subscriber::init`], this function does *not* add a
266266
/// [`tracing_subscriber::fmt`] layer to the configured `Subscriber`. This means
@@ -271,7 +271,7 @@ impl Builder {
271271
/// You must call [`.init()`] on the final subscriber in order to [set the
272272
/// subscriber as the default][default].
273273
///
274-
/// ## Examples
274+
/// # Examples
275275
///
276276
/// ```rust
277277
/// use tracing_subscriber::prelude::*;
@@ -352,7 +352,7 @@ impl Builder {
352352
/// for your application. If you need to add additional layers to a subscriber,
353353
/// see [`spawn`].
354354
///
355-
/// ## Panics
355+
/// # Panics
356356
///
357357
/// * If the subscriber's background thread could not be spawned.
358358
/// * If the [default `tracing` subscriber][default] has already been set.
@@ -362,7 +362,7 @@ impl Builder {
362362
/// [`tracing_subscriber::fmt`]: https://docs.rs/tracing-subscriber/latest/tracing-subscriber/fmt/index.html
363363
/// [`Server`]: crate::Server
364364
///
365-
/// ## Configuration
365+
/// # Configuration
366366
///
367367
/// Tokio console subscriber is configured with sensible defaults for most
368368
/// use cases. If you need to tune these parameters, several environmental
@@ -376,7 +376,7 @@ impl Builder {
376376
/// | `TOKIO_CONSOLE_RECORD_PATH` | The file path to save a recording | None |
377377
/// | `RUST_LOG` | Configures what events are logged events. See [`Targets`] for details. | "error" |
378378
///
379-
/// ## Further customization
379+
/// # Further customization
380380
///
381381
/// To add additional layers or replace the format layer, replace
382382
/// `console_subscriber::init` with:
@@ -425,16 +425,16 @@ pub fn init() {
425425
/// [`Layer`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/layer/trait.Layer.html
426426
/// [`Server`]: crate::Server
427427
///
428-
/// ## Panics
428+
/// # Panics
429429
///
430430
/// * If the subscriber's background thread could not be spawned.
431431
///
432-
/// ## Configuration
432+
/// # Configuration
433433
///
434434
/// `console_subscriber::build` supports all of the environmental
435435
/// configuration described at [`console_subscriber::init`].
436436
///
437-
/// ## Differences from `init`
437+
/// # Differences from `init`
438438
///
439439
/// Unlike [`console_subscriber::init`], this function does *not* add a
440440
/// [`tracing_subscriber::fmt`] layer to the configured `Layer`. This means
@@ -445,7 +445,7 @@ pub fn init() {
445445
/// You must call [`.init()`] on the final subscriber in order to [set the
446446
/// subscriber as the default][default].
447447
///
448-
/// ## Examples
448+
/// # Examples
449449
///
450450
/// ```rust
451451
/// use tracing_subscriber::prelude::*;

0 commit comments

Comments
 (0)