[−][src]Enum libzettels::IndexingMethod
The Index
is created not only by reading each
zettel's YAML-metadata, but by scanning the document body of each zettel
and parsing the markdown for links to other zettel files.
The enum IndexingMethod
defines the different methods that can be used
to do this latter task.
Application developers should think about whether and how to offer their users choice in this matter.
IndexingMethod::Grep
- relies on the UNIX command line tool
grep
. - preinstalled on many platforms
- very fast
- relies on the UNIX command line tool
IndexingMethod::RipGrep
- relies on the external tools
ripgrep
. - probably needs to be installed by the user
- even faster than
grep
.
- relies on the external tools
IndexingMethod::Native
- works out of the box without relying on external tools
- probably much slower than
grep
orripgrep
(at least for a large number of files.)
Variants
Use the system's variant of grep
to inspect and parse the markdown. If you want to use this, grep
must
be installed on your system and in your shell's PATH.
In short, grep's output of
grep -E -o '[[:space:]]\[.*?\]\(.*?\)|^\[.*?\]\(.*?\)' -r "/home/user/root/of/your/Zettelkasten/"
must look like this:
/home/user/root/of/your/Zettelkasten/somezettel.md:[lorem ipsum](otherzettel.md)
/home/user/root/of/your/Zettelkasten/onemorezettel.md:[sit amet](yetanotherzettel.md)
Use ripgrep
to inspect and
parse the markdown. If you want to use this ripgrep
must be installed
on your system and in your shell's PATH. Furthermore, the output of
rg --no-heading -N -o '[[:space:]]\[.*?\]\(.*?\)|^\[.*?\]\(.*?\)' "/home/user/root/of/your/Zettelkasten/"
must be formatted like this:
/home/user/root/of/your/Zettelkasten/somezettel.md:[lorem ipsum](otherzettel.md)
/home/user/root/of/your/Zettelkasten/onemorezettel.md:[sit amet](yetanotherzettel.md)
Use functions native to libzettels to parse the markdown. It works without depending on an external tool, but it's in no way optimized for speed.
It is intended for users who have neither grep
nor ripgrep
available, i.e. probably only Windows-users who want to install
neither ripgrep
nor some flavour of grep
.
Trait Implementations
impl Debug for IndexingMethod
[src]
impl<'de> Deserialize<'de> for IndexingMethod
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<IndexingMethod> for IndexingMethod
[src]
fn eq(&self, other: &IndexingMethod) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for IndexingMethod
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for IndexingMethod
[src]
Auto Trait Implementations
impl RefUnwindSafe for IndexingMethod
impl Send for IndexingMethod
impl Sync for IndexingMethod
impl Unpin for IndexingMethod
impl UnwindSafe for IndexingMethod
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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>,