[][src]Enum libzettels::IndexingMethod

pub enum IndexingMethod {
    Grep,
    RipGrep,
    Native,
}

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.

  1. IndexingMethod::Grep
    • relies on the UNIX command line tool grep.
    • preinstalled on many platforms
    • very fast
  2. IndexingMethod::RipGrep
    • relies on the external tools ripgrep.
    • probably needs to be installed by the user
    • even faster than grep.
  3. IndexingMethod::Native
    • works out of the box without relying on external tools
    • probably much slower than grep or ripgrep (at least for a large number of files.)

Variants

Grep

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)
RipGrep

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)
Native

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]

impl PartialEq<IndexingMethod> for IndexingMethod[src]

impl Serialize for IndexingMethod[src]

impl StructuralPartialEq for IndexingMethod[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.