pub struct Page {
pub title: String,
pub page_path: PagePath,
pub md_file_path: PathBuf,
}Fields§
§title: String§page_path: PagePath§md_file_path: PathBufImplementations§
Source§impl Page
impl Page
pub fn new(title: String, page_path: PagePath, md_file_path: PathBuf) -> Self
Sourcepub fn write_html_head(
&self,
html: &mut String,
project: &Project,
) -> DdResult<()>
pub fn write_html_head( &self, html: &mut String, project: &Project, ) -> DdResult<()>
Write the variable parts of the HTML <head>: the links to CSS, JS, meta tags, title, etc.
§Errors
Return DdError variants on write errors, not on project config/data errors
Write the HTML content for a navigation directory (header or footer)
Sourcepub fn write_html_article(
&self,
html: &mut String,
md: &str,
project: &Project,
) -> DdResult<()>
pub fn write_html_article( &self, html: &mut String, md: &str, project: &Project, ) -> DdResult<()>
Write the part of the HTML generated from the page’s Markdown content
The resulting html contains,
- at top level: an
<article>element, which contains:<nav class=page-toc>: the table of contents for the page<main>: the main content of the page
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more