[][src]Struct libimagentrymarkdown::processor::LinkProcessor

pub struct LinkProcessor { /* fields omitted */ }

A link Processor which collects the links from a Markdown and passes them on to libimagentrylink functionality

The processor can be configured to

  • Process internal links (from store entry to store entry)
  • Process internal links with automatically creating targets If an internal link is encountered, the corrosponding target must be present in the store. If it is not, it will either be created or the processing fails
  • Process external links (from store entry to URL)
  • Process refs (from store entry to files on the filesystem and outside of the store) (default: false)

Note

There's no LinkProcessor::new() function, please use LinkProcessor::default().

Methods

impl LinkProcessor[src]

Switch internal link processing on/off

Internal links are links which are simply dirctory/file, but not /directory/file, as beginning an id with / is discouraged in imag.

pub fn create_internal_targets(self, b: bool) -> Self[src]

Switch internal link target creation on/off

If a link points to a non-existing imag entry, a false here will cause the processor to return an error from process(). A true setting will create the entry and then fetch it to link it to the processed entry.

Switch external link processing on/off

An external link must start with https:// or http://.

pub fn process_refs(self, b: bool) -> Self[src]

Switch ref processing on/off

A Ref is to be expected beeing a link with file::/// at the beginning.

pub fn process<'a>(&self, entry: &mut Entry, store: &'a Store) -> Result<()>[src]

Process an Entry for its links

Warning

When LinkProcessor::create_internal_targets() was called to set the setting to true, this function returns all errors returned by the Store.

Trait Implementations

impl Default for LinkProcessor[src]

Auto Trait Implementations

Blanket Implementations

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

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

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self