[][src]Struct mdblog::Mdblog

pub struct Mdblog { /* fields omitted */ }

blog object

Implementations

impl Mdblog[src]

pub fn new<P: AsRef<Path>>(root: P) -> Result<Mdblog>[src]

create from the root path.

pub fn load_customize_settings(&mut self) -> Result<()>[src]

load blog customize settings.

layered configuration system:

  • default settings
  • config.toml
  • BLOG_ prefix environment variable

pub fn load_posts(&mut self) -> Result<()>[src]

load blog posts.

pub fn init(&mut self) -> Result<()>[src]

init blog directory.

pub fn build(&mut self) -> Result<()>[src]

build the blog html files to build_dir directory.

pub fn serve(&mut self, port: u16) -> Result<()>[src]

serve the blog static files in the build_dir directory.

pub fn rebuild(&mut self) -> Result<()>[src]

rebuild blog

pub fn build_root_dir(&self) -> Result<PathBuf>[src]

blog build directory absolute path.

pub fn theme_root_dir(&self) -> Result<PathBuf>[src]

blog theme root directory absolute path.

pub fn media_root_dir(&self) -> Result<PathBuf>[src]

blog media root directory absolute path.

pub fn post_root_dir(&self) -> Result<PathBuf>[src]

blog posts root directory.

pub fn ignore_patterns(&self) -> Result<Vec<Pattern>>[src]

blog glob ignore patterns.

the patterns are used when :

  • mdblog new command, the post path is checked
  • mdblog serve command, the modified file path is checked

pub fn create_post(&self, path: &Path, tags: &[String]) -> Result<()>[src]

create a new sample post.

pub fn export_config(&self) -> Result<()>[src]

export blog config.toml file.

pub fn export_media(&self) -> Result<()>[src]

export blog media files.

pub fn export_static(&self) -> Result<()>[src]

export blog static files.

pub fn export_posts(&self) -> Result<()>[src]

export blog posts.

pub fn export_index(&self) -> Result<()>[src]

export blog index page.

pub fn export_tag(&self, tag: &Tag) -> Result<()>[src]

export blog tag index page.

pub fn export_atom(&self) -> Result<()>[src]

export blog atom.xml

pub fn render_post(&self, post: &Post) -> Result<String>[src]

render blog post html.

pub fn render_index(
    &self,
    posts: &[&Rc<Post>],
    prev_name: &str,
    next_name: &str
) -> Result<String>
[src]

render index page html.

pub fn render_tag(
    &self,
    title: &str,
    posts: &[Rc<Post>],
    prev_name: &str,
    next_name: &str
) -> Result<String>
[src]

render tag pages html.

pub fn list_blog_theme(&self) -> Result<()>[src]

list blog themes.

pub fn create_blog_theme(&self, name: &str) -> Result<()>[src]

create a new blog theme as same as the current blog theme.

pub fn delete_blog_theme(&self, name: &str) -> Result<()>[src]

delete a blog theme.

pub fn set_blog_theme(&mut self, name: &str) -> Result<()>[src]

set blog theme.

Auto Trait Implementations

impl !RefUnwindSafe for Mdblog

impl !Send for Mdblog

impl !Sync for Mdblog

impl Unpin for Mdblog

impl !UnwindSafe for Mdblog

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,