Skip to content

Commit 46963eb

Browse files
committed
Fix some missing docs
This removes the `allow(missing_docs)` and fixes any issues. There's probably more work to be done to improve the API docs. This was just a minor thing I wanted to clean up.
1 parent c948fe4 commit 46963eb

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ use once_cell::sync::Lazy;
2020
use regex::{Captures, Regex};
2121
use serde_json::json;
2222

23+
/// The HTML renderer for mdBook.
2324
#[derive(Default)]
2425
pub struct HtmlHandlebars;
2526

2627
impl HtmlHandlebars {
28+
/// Returns a new instance of [`HtmlHandlebars`].
2729
pub fn new() -> Self {
2830
HtmlHandlebars
2931
}

src/renderer/html_handlebars/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(missing_docs)] // FIXME: Document this
2-
31
pub use self::hbs_renderer::HtmlHandlebars;
42
pub use self::static_files::StaticFiles;
53

src/utils/fs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Filesystem utilities and helpers.
2+
13
use crate::errors::*;
24
use log::{debug, trace};
35
use std::fs::{self, File};
@@ -202,6 +204,7 @@ fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<()> {
202204
}
203205
}
204206

207+
/// Returns the name of the file used for HTTP 404 "not found" with the `.html` extension.
205208
pub fn get_404_output_file(input_404: &Option<String>) -> String {
206209
input_404
207210
.as_ref()

src/utils/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(missing_docs)] // FIXME: Document this
1+
//! Various helpers and utilities.
22
33
pub mod fs;
44
mod string;
@@ -194,6 +194,7 @@ pub fn render_markdown(text: &str, smart_punctuation: bool) -> String {
194194
render_markdown_with_path(text, smart_punctuation, None)
195195
}
196196

197+
/// Creates a new pulldown-cmark parser of the given text.
197198
pub fn new_cmark_parser(text: &str, smart_punctuation: bool) -> Parser<'_> {
198199
let mut opts = Options::empty();
199200
opts.insert(Options::ENABLE_TABLES);
@@ -207,6 +208,11 @@ pub fn new_cmark_parser(text: &str, smart_punctuation: bool) -> Parser<'_> {
207208
Parser::new_ext(text, opts)
208209
}
209210

211+
/// Renders markdown to HTML.
212+
///
213+
/// `path` should only be set if this is being generated for the consolidated
214+
/// print page. It should point to the page being rendered relative to the
215+
/// root of the book.
210216
pub fn render_markdown_with_path(
211217
text: &str,
212218
smart_punctuation: bool,

0 commit comments

Comments
 (0)