[−][src]Struct readme_sync::CMarkData
A CMarkItem
s container storing a list of events with multiple transformation functions.
Implementations
impl CMarkData
[src]
pub fn from_file(file: Arc<File>) -> Self
[src]
Creates CMarkData
from the specified File
.
pub fn from_file_docs(file_docs: Arc<FileDocs>) -> Self
[src]
Creates CMarkData
from the specified FileDocs
.
pub fn from_text_source(text_source: TextSource) -> Self
[src]
Creates CMarkData
from the specified TextSource
.
pub fn iter(&self) -> CMarkDataIter<'_>
[src]
Iterate over CMarkItem
s.
pub fn concat_texts(self) -> Self
[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.
impl CMarkData
[src]
pub fn increment_heading_levels(self) -> Self
[src]
Increment levels of all headings.
In readme, the first level heading is usually used only for the project title. The second level header is usually used in for text section headings in readme. Rustdoc automatically adds the header of a crate name and the first level headers are used for text sections.
So it is necessary to increase the level of all headings in the documentation in order to synchronize the headings.
pub fn add_title(self, text: &str) -> Self
[src]
Add a first level heading with the specified text.
This function could be useful after heading level incremented.
pub fn remove_images_only_paragraph<P>(self, predicate: P) -> Self where
P: FnMut(&[&str]) -> bool,
[src]
P: FnMut(&[&str]) -> bool,
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) -> Self
[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_documentation_section(self) -> Self
[src]
Remove sections with heading Documentation
and level 2.
impl CMarkData
[src]
pub fn disallow_absolute_blob_links(
self,
repository_url: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
[src]
self,
repository_url: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
Returns self if absolute blob links to the specified repository not found, otherwise returns an error.
pub fn disallow_absolute_docs_links(
self,
package_name: &str,
documentation_url: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
[src]
self,
package_name: &str,
documentation_url: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
Returns self if absolute docs links to the specified repository not found, otherwise returns an error.
pub fn disallow_urls_with_prefix(
self,
prefix: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
[src]
self,
prefix: &str
) -> Result<Self, DisallowUrlsWithPrefixError>
Returns self if links with the specified prefix not found, otherwise returns an error.
pub fn use_absolute_blob_urls(self, repository_url: &str) -> Self
[src]
Convert all relative links into absolute ones using the repository url as the root address.
pub fn use_absolute_docs_urls(
self,
package_name: &str,
documentation_url: &str
) -> Self
[src]
self,
package_name: &str,
documentation_url: &str
) -> Self
Convert all relative links into absolute ones using the package documentation url as the root address.
pub fn with_absolute_urls(self, prefix: &str) -> Self
[src]
Convert all relative links into absolute ones using specified url prefix.
impl CMarkData
[src]
pub fn remove_codeblock_tag(self, tag: &str) -> Self
[src]
Remove the specified fenced code block tag.
pub fn remove_codeblock_tags(self, tags: &[&str]) -> Self
[src]
Remove the specified fenced code block tags.
impl CMarkData
[src]
pub fn remove_codeblock_rust_test_tags(self) -> Self
[src]
Remove fenced code block tags that are used by cargo test
.
See https://doc.rust-lang.org/rustdoc/documentation-tests.html for more details.
pub fn use_default_codeblock_tag(self, tag: &str) -> Self
[src]
Use the specified codeblock tag, if they are not specified
impl CMarkData
[src]
pub fn use_default_codeblock_rust_tag(self) -> Self
[src]
Use rust fenced codeblock highlight as default.
pub fn remove_hidden_rust_code(self) -> Self
[src]
Remove hidden rust code from rust fenced codeblocks.
See https://doc.rust-lang.org/rustdoc/documentation-tests.html#hiding-portions-of-the-example for more details.
Trait Implementations
impl Clone for CMarkData
[src]
impl Debug for CMarkData
[src]
impl Default for CMarkData
[src]
impl PartialEq<CMarkData> for CMarkData
[src]
impl StructuralPartialEq for CMarkData
[src]
Auto Trait Implementations
impl RefUnwindSafe for CMarkData
impl Send for CMarkData
impl Sync for CMarkData
impl Unpin for CMarkData
impl UnwindSafe for CMarkData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,