Enum tpnote_lib::config::LocalLinkKind
source · pub enum LocalLinkKind {
Off,
Short,
Long,
}Expand description
Defines the way the HTML exporter rewrites local links.
The enum LocalLinkKind allows you to fine tune how local links are written
out. Valid variants are: off, short and long. In order to achieve
this, the user must respect the following convention concerning absolute
local links in Tp-Note documents: The base of absolute local links in Tp-
Note documents must be the directory where the marker file .tpnoteroot
resides (or / in non exists). The option --export-link- rewriting
decides how local links in the Tp-Note document are converted when the
HTML is generated. If its value is short, then relative local links are
converted to absolute links. The base of the resulting links is where the
.tpnoteroot file resides (or / if none exists). Consider the following
example:
- The Tp-Note file
/my/docs/car/bill.mdcontains - the absolute link
/car/scan.jpg. - and the relative link
./photo.jpg. - The document root marker is:
/my/docs/.tpnoteroot.
The images in the resulting HTML will appear as
/car/scan.jpg./car/photo.jpg.
For LocalLinkKind::long, in addition to the above, all absolute
local links are rebased to /’. Consider the following example:
- The Tp-Note file
/my/docs/car/bill.mdcontains - the absolute link
/car/scan.jpg. - and the relative link
./photo.jpg. - The document root marker is:
/my/docs/.tpnoteroot.
The images in the resulting HTML will appear as
/my/docs/car/scan.jpg./my/docs/car/photo.jpg.
Variants§
Off
Do not rewrite links.
Short
Rewrite relative local links. Base: “.tpnoteroot”
Long
Rewrite all local links. Base: “/”
Trait Implementations§
source§impl Clone for LocalLinkKind
impl Clone for LocalLinkKind
source§fn clone(&self) -> LocalLinkKind
fn clone(&self) -> LocalLinkKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LocalLinkKind
impl Debug for LocalLinkKind
source§impl Default for LocalLinkKind
impl Default for LocalLinkKind
source§fn default() -> LocalLinkKind
fn default() -> LocalLinkKind
source§impl<'de> Deserialize<'de> for LocalLinkKind
impl<'de> Deserialize<'de> for LocalLinkKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl FromStr for LocalLinkKind
impl FromStr for LocalLinkKind
source§impl Hash for LocalLinkKind
impl Hash for LocalLinkKind
source§impl PartialEq<LocalLinkKind> for LocalLinkKind
impl PartialEq<LocalLinkKind> for LocalLinkKind
source§fn eq(&self, other: &LocalLinkKind) -> bool
fn eq(&self, other: &LocalLinkKind) -> bool
self and other values to be equal, and is used
by ==.source§impl Serialize for LocalLinkKind
impl Serialize for LocalLinkKind
impl Copy for LocalLinkKind
impl Eq for LocalLinkKind
impl StructuralEq for LocalLinkKind
impl StructuralPartialEq for LocalLinkKind
Auto Trait Implementations§
impl RefUnwindSafe for LocalLinkKind
impl Send for LocalLinkKind
impl Sync for LocalLinkKind
impl Unpin for LocalLinkKind
impl UnwindSafe for LocalLinkKind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.