[−][src]Struct libimagentrymarkdown::processor::LinkProcessor
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]
pub fn process_internal_links(self, b: bool) -> Self
[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.
pub fn process_external_links(self, b: bool) -> Self
[src]
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
impl Send for LinkProcessor
impl Sync for LinkProcessor
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self