[][src]Struct readme_sync::CMarkReadme

pub struct CMarkReadme<P, M> { /* fields omitted */ }

Parsed readme Markdown with optionally specified package path and package manifest.

Implementations

impl<'a> CMarkReadme<&'a Path, &'a Manifest>[src]

pub fn from_package(
    package: &'a Package
) -> Result<Self, CMarkReadmeFromPackageError>
[src]

Creates readme from package.

It reads readme file by path specified in the package manifest.

impl<'a> CMarkReadme<(), ()>[src]

pub fn from_file(file: Arc<File>) -> Self[src]

Creates readme from file.

impl<'a, P, M> CMarkReadme<P, M>[src]

pub fn with_package_path(
    self,
    package_path: &'a Package
) -> CMarkReadme<&'a Package, M>
[src]

Adding the specified package path to the readme.

pub fn with_manifest(
    self,
    manifest: &'a Manifest
) -> CMarkReadme<P, &'a Manifest>
[src]

Adding the specified manifest to the readme.

pub fn from_file_and_package_path_and_manifest(
    file: Arc<File>,
    package_path: P,
    manifest: M
) -> Self
[src]

Creates readme from file, package path and manifest.

pub fn from_data_and_package_path_and_manifest(
    data: CMarkData,
    package_path: P,
    manifest: M
) -> Self
[src]

Creates readme from CMark items, package path and manifest.

pub fn data(&self) -> &CMarkData[src]

Returns CMark items.

pub fn package_path(&self) -> &P[src]

Returns the package path.

pub fn manifest(&self) -> &M[src]

Returns the manifest.

pub fn iter(&self) -> CMarkDataIter<'_>[src]

Iterate over CMarkItems.

pub fn concat_texts(self) -> CMarkReadme<P, M>[src]

Concatenate adjacent text events.

Use this transformation if you deleted some nodes manually and want to merge the neighboring text nodes.

This transformation is always applied right after readme and docs parsing, because some text events remain ununited. For example Rust attribute parser generate seperate text events for every line of source code, and pulldown_cmark generate seperate text events for character entity reference.

pub fn remove_images_only_paragraph<F>(self, predicate: F) -> CMarkReadme<P, M> where
    F: FnMut(&[&str]) -> bool
[src]

Removes first paragraph that contains only images and image-links, if the specified predicate returns true when passing image urls to it.

pub fn remove_badges_paragraph(self) -> CMarkReadme<P, M>[src]

Removes first paragraph that contains only badges.

pub fn remove_section(self, heading: &str, level: u32) -> Self[src]

Remove section with the specified heading text and level and its subsections.

pub fn remove_codeblock_tag(self, tag: &str) -> CMarkReadme<P, M>[src]

Remove the specified fenced code block tag.

pub fn remove_codeblock_tags(self, tags: &[&str]) -> CMarkReadme<P, M>[src]

Remove the specified fenced code block tags.

pub fn remove_documentation_section(self) -> Self[src]

Remove sections with heading Documentation and level 2.

Returns self if absolute blob links to the specified repository not found, otherwise returns an error.

pub fn use_absolute_blob_urls(self, repository_url: &str) -> CMarkReadme<P, M>[src]

Convert all relative links into absolute ones using the repository url as the root address.

impl<'a, P> CMarkReadme<P, &'a Manifest>[src]

Returns self if absolute blob links to the manifest repository not found, otherwise returns an error.

pub fn use_absolute_repository_blob_urls(
    self
) -> Result<CMarkReadme<P, &'a Manifest>, UseAbsoluteRepositoryBlobUrlsError>
[src]

Convert all relative links into absolute ones using the manifest repository url as the root address.

Trait Implementations

impl<P: Clone, M: Clone> Clone for CMarkReadme<P, M>[src]

impl<P: Debug, M: Debug> Debug for CMarkReadme<P, M>[src]

impl<P: Default, M: Default> Default for CMarkReadme<P, M>[src]

impl<P: PartialEq, M: PartialEq> PartialEq<CMarkReadme<P, M>> for CMarkReadme<P, M>[src]

impl<P, M> StructuralPartialEq for CMarkReadme<P, M>[src]

Auto Trait Implementations

impl<P, M> RefUnwindSafe for CMarkReadme<P, M> where
    M: RefUnwindSafe,
    P: RefUnwindSafe

impl<P, M> Send for CMarkReadme<P, M> where
    M: Send,
    P: Send

impl<P, M> Sync for CMarkReadme<P, M> where
    M: Sync,
    P: Sync

impl<P, M> Unpin for CMarkReadme<P, M> where
    M: Unpin,
    P: Unpin

impl<P, M> UnwindSafe for CMarkReadme<P, M> where
    M: UnwindSafe,
    P: UnwindSafe

Blanket Implementations

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.