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
paths in local links in Tp-Note documents: When a document contains a
local link with an absolute path, the base of this path
is considered to be the 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 local links with relative
paths are converted to absolute paths. The base of the resulting path is
where the .tpnoteroot file resides (or / if none exists).
Consider the following example LocalLinkKind::Short:
- The Tp-Note file
/my/docs/car/bill.mdcontains - a local link with an absolute path:
/car/scan.jpg, - and another link with a relative path:
./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 paths in
local links are rebased to /’. Consider the following example:
- The Tp-Note file
/my/docs/car/bill.mdcontains - a link with an absolute path:
/car/scan.jpg, - and another link with a relative path:
./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 for LocalLinkKind
impl PartialEq 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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.