Struct gutenberg::Page [] [src]

pub struct Page {
    pub file: FileInfo,
    pub meta: PageFrontMatter,
    pub raw_content: String,
    pub assets: Vec<PathBuf>,
    pub content: String,
    pub slug: String,
    pub path: String,
    pub permalink: String,
    pub summary: Option<String>,
    pub previous: Option<Box<Page>>,
    pub next: Option<Box<Page>>,
    pub toc: Vec<Header>,
}

Fields

All info about the actual file

The front matter meta-data

The actual content of the page, in markdown

All the non-md files we found next to the .md file

The HTML rendered of the page

The slug of that page. First tries to find the slug in the meta and defaults to filename otherwise

The URL path of the page

The full URL for that page

The summary for the article, defaults to None When is found in the text, will take the content up to that part as summary

The previous page, by whatever sorting is used for the index/section

The next page, by whatever sorting is used for the index/section

Toc made from the headers of the markdown file

Methods

impl Page
[src]

Parse a page given the content of the .md file Files without front matter or with invalid front matter are considered erroneous

Read and parse a .md file into a Page struct

We need access to all pages url to render links relative to content so that can't happen at the same time as parsing

Renders the page using the default layout, unless specified in front-matter

Trait Implementations

impl Clone for Page
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Page
[src]

Formats the value using the given formatter.

impl PartialEq for Page
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Page
[src]

Returns the "default value" for a type. Read more

impl Serialize for Page
[src]

Serialize this value into the given Serde serializer. Read more