diff --git a/404.html b/404.html index 354044c..c392eee 100644 --- a/404.html +++ b/404.html @@ -148,12 +148,66 @@
  • - - Cadmus! + + What does it do
  • + + + + + +
  • + + Find + +
  • + + + + + + + +
  • + + + + + +
  • + + diff --git a/Tools/New.html b/Tools/New.html new file mode 100644 index 0000000..d1af8e3 --- /dev/null +++ b/Tools/New.html @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + New Note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + Skip to content + + +
    +
    + +
    + +
    + +
    + +
    + + + + + + +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + + + + + + +

    New Note

    + + + + + + + + + +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/find.html b/find.html new file mode 100644 index 0000000..a64b608 --- /dev/null +++ b/find.html @@ -0,0 +1,547 @@ + + + + + + + + + + + + + + + + + + Find + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + Skip to content + + +
    +
    + +
    + +
    + +
    + +
    + + + + + + +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + + + + + + +

    Find

    + +
    +

    Note

    +

    Start this with cadmus find

    +
    +

    What does it do

    +

    This starts a find dialog with a preview of the note on the side.

    +

    How Do I use it

    +

    After running the command type in the name or directory of a note and the fuzzy matches will be presented with an instant preview to the side.

    +

    Press Ctrl+Q to toggle searching inside the note for a string, any matches will be highlighted.

    +

    Pressing Enter on a note will open it in the default app, 1 if you want to do something else with it copy the path to the clipboard with Alt+w as described below in Keyboard Shortcuts.

    +

    Keyboard Shortcuts

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeysDescription
    PgUp / PgDnScroll Preview
    Ctrl-wCopy Absolute path to note 2
    Alt-wCopy Relative path to note
    Ctrl-oOpen the note in the default app without exiting
    Alt-yCopy File Contents to Clipboard 3
    +

    How does it Work

    +

    So essentially this just uses skim and bat to filter/preview the notes, the interactive command is used with ripgrep and piping (that took me forever to figure out!!) to highlight the match in the preview.4 This is the code that achieves it:

    +
    sk --ansi -m -c 'rg -l -t markdown --ignore-case "{}"'    \
    +    --preview "bat {} 2> /dev/null                             \
    +        --color=always --line-range :500                       \
    +        --terminal-width 80                                    \
    +        --theme=TwoDark                                       |\
    +            rg --pretty --colors  --context 20 {cq}                \
    +                --no-line-number --ignore-case                     \
    +                --colors 'match:fg:21,39,200'                      \
    +                --colors 'line:style:nobold'                       \
    +                --colors 'match:style:bold'                        \
    +                --colors 'match:bg:30,200,30'"                     \
    +     --bind 'ctrl-f:interactive,pgup:preview-page-up,pgdn:preview-page-down'    \
    +     --bind 'ctrl-w:execute-silent(echo {}    |\
    +         xargs realpath                       |\
    +         xclip -selection clipboard)'                                           \
    +     --bind 'alt-w:execute-silent(echo {} | xclip -selection clipboard)'        \
    +     --bind 'alt-v:execute-silent(code -a {}),alt-e:execute-silent(emacs {})'   \
    +     --bind 'ctrl-o:execute-silent(xdg-open {})'                                \
    +     --bind 'alt-y:execute-silent(cat {} | xclip -selection clipboard)'         \
    +     --bind 'alt-o:execute-silent(cat {}      |\
    +         pandoc -f markdown -t html --mathml  |\
    +         xclip -selection clipboard)' \
    +     --bind 'alt-f:execute-silent(echo {}        |\
    +         xargs dirname                           |\
    +         xargs cd; cat {}                        |\
    +         pandoc -f markdown -t dokuwiki --mathml |\
    +         xclip -selection clipboard)'            \
    +     --color=fg:#f8f8f2,bg:-1,matched:#6272a4,current_fg:#50fa7b,current_bg:#381070,border:#ff79c6,prompt:#bd93f9,query:#bd93f9,marker:#f1fa8c,header:#f1fa8c
    +
    + +

    When Would This Be Used

    +

    Imagine you're sitting at your desk and all of a sudden you're required to, I don't know, solve a linear recurrence relation, you're solution is cadmus find and then type something like math mod then Ctrl-Q linear.

    +
    +
    +
      +
    1. +

      xdg-open / open on Linux/Mac respectively 

      +
    2. +
    3. +

      TODO: this only works on Xorg at the moment 

      +
    4. +
    5. +

      This is really good for Zulip / Discord 

      +
    6. +
    7. +

      This highlighting works with both bat and MDCat, I prefer MDCat but there is a bug with footnotes preventing me from being able to use it right at the moment. 

      +
    8. +
    +
    + + + + + + + + + +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 47d4c48..259c876 100644 --- a/index.html +++ b/index.html @@ -162,14 +162,14 @@ - - Cadmus! + + What does it do @@ -290,6 +290,60 @@ + + + + + +
  • + + Find + +
  • + + + + + + + +
  • + + + + + +
  • + + @@ -427,8 +481,18 @@ -

    Cadmus!

    + + +

    Cadmus!

    Cadmus is a knowledge management tool in your terminal.

    +

    What does it do

    Cadmus provides command driven interface to find and edit Markdown files, such as finding by name, searching for terms, filtering by tags, generating backlinks and generating relative links to other notes.

    How does it Work

    @@ -596,6 +660,27 @@ This was a dependency but I switched to java script