This commit is contained in:
Vadim Petrochenkov 2019-06-16 14:15:11 +03:00
parent ce51e653c7
commit 5a9643c95b
2 changed files with 21 additions and 18 deletions

View file

@ -1,5 +1,3 @@
// ignore-tidy-filelength
//! Contains infrastructure for configuring the compiler, including parsing //! Contains infrastructure for configuring the compiler, including parsing
//! command line options. //! command line options.

View file

@ -43,25 +43,30 @@ fn opts() -> Options {
Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES
} }
/// A unit struct which has the `fmt::Display` trait implemented. When /// A tuple struct that has the `fmt::Display` trait implemented.
/// formatted, this struct will emit the HTML corresponding to the rendered /// When formatted, this struct will emit the HTML corresponding to the rendered
/// version of the contained markdown string. /// version of the contained markdown string.
///
/// The second parameter is a list of link replacements.
///
/// The third is the current list of used header IDs.
///
/// The fourth is whether to allow the use of explicit error codes in doctest lang strings.
///
/// The fifth is what default edition to use when parsing doctests (to add a `fn main`).
pub struct Markdown<'a>( pub struct Markdown<'a>(
pub &'a str, pub &'a [(String, String)], pub RefCell<&'a mut IdMap>, pub ErrorCodes, pub Edition); pub &'a str,
/// A unit struct like `Markdown`, that renders the markdown with a /// A list of link replacements.
/// table of contents. pub &'a [(String, String)],
pub struct MarkdownWithToc<'a>(pub &'a str, pub RefCell<&'a mut IdMap>, pub ErrorCodes, pub Edition); /// The current list of used header IDs.
/// A unit struct like `Markdown`, that renders the markdown escaping HTML tags. pub RefCell<&'a mut IdMap>,
/// Whether to allow the use of explicit error codes in doctest lang strings.
pub ErrorCodes,
/// Default edition to use when parsing doctests (to add a `fn main`).
pub Edition,
);
/// A tuple struct like `Markdown` that renders the markdown with a table of contents.
pub struct MarkdownWithToc<'a>(
pub &'a str,
pub RefCell<&'a mut IdMap>,
pub ErrorCodes,
pub Edition,
);
/// A tuple struct like `Markdown` that renders the markdown escaping HTML tags.
pub struct MarkdownHtml<'a>(pub &'a str, pub RefCell<&'a mut IdMap>, pub ErrorCodes, pub Edition); pub struct MarkdownHtml<'a>(pub &'a str, pub RefCell<&'a mut IdMap>, pub ErrorCodes, pub Edition);
/// A unit struct like `Markdown`, that renders only the first paragraph. /// A tuple struct like `Markdown` that renders only the first paragraph.
pub struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [(String, String)]); pub struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [(String, String)]);
#[derive(Copy, Clone, PartialEq, Debug)] #[derive(Copy, Clone, PartialEq, Debug)]