pub enum MarkupLanguage {
Markdown,
Restructuredtext,
Html,
PlainText,
PlainTextNoViewer,
Unkown,
None,
}Expand description
The Markup language of the note content.
Variants§
Markdown
Restructuredtext
Html
PlainText
PlainTextNoViewer
The exporter renders this, but the viewer is disabled.
Unkown
This is a Tp-Note file, but we are not able to determine the MarkupLanguage at this point.
None
This is not a Tp-Note file.
Implementations§
source§impl MarkupLanguage
impl MarkupLanguage
sourcepub fn mine_type(&self) -> Option<&'static str>
pub fn mine_type(&self) -> Option<&'static str>
Returns the MIME type for all Markup Languages.is_tpnote_file()==true.
Otherwise, for MarkupLanguage::None this returns None.
sourcepub fn is_some(&self) -> bool
pub fn is_some(&self) -> bool
As we identify a markup language by the file’s extension, we
can also tell, in case Markuplanguage::from(ext).is_some(),
that a file with the extension ext is a Tp-Note file.
sourcepub fn is_none(&self) -> bool
pub fn is_none(&self) -> bool
As we identify a markup language by the file’s extension, we
can also tell, in case Markuplanguage::from(ext).is_none(),
that a file with the extension ext is NOT a Tp-Note file.
sourcepub fn render(&self, input: &str) -> String
pub fn render(&self, input: &str) -> String
Every MarkupLanguage variant has an own internal HTML renderer:
Markdownis rendered according the “CommonMark” standard.- Currently only as small subset of ReStructuredText is rendered for
Restructuredtext. This feature is experimental. - The
Htmlrenderer simply forwards the input without modification. PlainTextis rendered as raw text. Hyperlinks in Markdown, ReStructuredText, AsciiDoc and WikiText syntax are detected and are displayed in the rendition with their link text. All hyperlinks are clickable.Unknownis rendered likePlainText, hyperlinks are also clickable, but they are displayed as they appear in the input.- For the variant
Nonethe result is always the empty string whatever the input may be.
Trait Implementations§
source§impl Clone for MarkupLanguage
impl Clone for MarkupLanguage
source§fn clone(&self) -> MarkupLanguage
fn clone(&self) -> MarkupLanguage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MarkupLanguage
impl Debug for MarkupLanguage
source§impl Default for MarkupLanguage
impl Default for MarkupLanguage
source§fn default() -> MarkupLanguage
fn default() -> MarkupLanguage
source§impl<'de> Deserialize<'de> for MarkupLanguage
impl<'de> Deserialize<'de> for MarkupLanguage
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 From<&Path> for MarkupLanguage
impl From<&Path> for MarkupLanguage
source§impl From<&str> for MarkupLanguage
impl From<&str> for MarkupLanguage
source§impl Hash for MarkupLanguage
impl Hash for MarkupLanguage
source§impl PartialEq for MarkupLanguage
impl PartialEq for MarkupLanguage
source§fn eq(&self, other: &MarkupLanguage) -> bool
fn eq(&self, other: &MarkupLanguage) -> bool
self and other values to be equal, and is used
by ==.source§impl Serialize for MarkupLanguage
impl Serialize for MarkupLanguage
impl Copy for MarkupLanguage
impl Eq for MarkupLanguage
impl StructuralEq for MarkupLanguage
impl StructuralPartialEq for MarkupLanguage
Auto Trait Implementations§
impl RefUnwindSafe for MarkupLanguage
impl Send for MarkupLanguage
impl Sync for MarkupLanguage
impl Unpin for MarkupLanguage
impl UnwindSafe for MarkupLanguage
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.