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.
This commit is contained in:
parent
c948fe4d6a
commit
46963ebf65
4 changed files with 12 additions and 3 deletions
|
|
@ -20,10 +20,12 @@ use once_cell::sync::Lazy;
|
||||||
use regex::{Captures, Regex};
|
use regex::{Captures, Regex};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
|
/// The HTML renderer for mdBook.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct HtmlHandlebars;
|
pub struct HtmlHandlebars;
|
||||||
|
|
||||||
impl HtmlHandlebars {
|
impl HtmlHandlebars {
|
||||||
|
/// Returns a new instance of [`HtmlHandlebars`].
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
HtmlHandlebars
|
HtmlHandlebars
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
#![allow(missing_docs)] // FIXME: Document this
|
|
||||||
|
|
||||||
pub use self::hbs_renderer::HtmlHandlebars;
|
pub use self::hbs_renderer::HtmlHandlebars;
|
||||||
pub use self::static_files::StaticFiles;
|
pub use self::static_files::StaticFiles;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Filesystem utilities and helpers.
|
||||||
|
|
||||||
use crate::errors::*;
|
use crate::errors::*;
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
|
|
@ -202,6 +204,7 @@ fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the name of the file used for HTTP 404 "not found" with the `.html` extension.
|
||||||
pub fn get_404_output_file(input_404: &Option<String>) -> String {
|
pub fn get_404_output_file(input_404: &Option<String>) -> String {
|
||||||
input_404
|
input_404
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![allow(missing_docs)] // FIXME: Document this
|
//! Various helpers and utilities.
|
||||||
|
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
mod string;
|
mod string;
|
||||||
|
|
@ -194,6 +194,7 @@ pub fn render_markdown(text: &str, smart_punctuation: bool) -> String {
|
||||||
render_markdown_with_path(text, smart_punctuation, None)
|
render_markdown_with_path(text, smart_punctuation, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates a new pulldown-cmark parser of the given text.
|
||||||
pub fn new_cmark_parser(text: &str, smart_punctuation: bool) -> Parser<'_> {
|
pub fn new_cmark_parser(text: &str, smart_punctuation: bool) -> Parser<'_> {
|
||||||
let mut opts = Options::empty();
|
let mut opts = Options::empty();
|
||||||
opts.insert(Options::ENABLE_TABLES);
|
opts.insert(Options::ENABLE_TABLES);
|
||||||
|
|
@ -207,6 +208,11 @@ pub fn new_cmark_parser(text: &str, smart_punctuation: bool) -> Parser<'_> {
|
||||||
Parser::new_ext(text, opts)
|
Parser::new_ext(text, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Renders markdown to HTML.
|
||||||
|
///
|
||||||
|
/// `path` should only be set if this is being generated for the consolidated
|
||||||
|
/// print page. It should point to the page being rendered relative to the
|
||||||
|
/// root of the book.
|
||||||
pub fn render_markdown_with_path(
|
pub fn render_markdown_with_path(
|
||||||
text: &str,
|
text: &str,
|
||||||
smart_punctuation: bool,
|
smart_punctuation: bool,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue