TW5 Navi cheatsheet

access the snippets in your notes directly from the command line

Screencast for Navi cheatsheet

17th May 2021 at 4:47pm

Scroll down for details.

(0 Comments)

$:/plugins/bimlas/navi-cheatsheet

navi-cheatsheet: Navi cheatsheets in your wiki

$:/plugins/bimlas/navi-cheatsheet

1.0.1

Navi cheatsheets in your wiki

Invoke snippets and one-liners stored in Node.js TiddlyWiki directly from the command line.

Navi is an interactive cheatsheet tool for the command-line: it allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands. This is a great way to replace aliases, one-liners and short scripts with a searchable "snippet database".

Many keep these snippets in their own description of the related program. This plugin helps you to access the snippets in your notes directly from the command line using Navi.

You can keep the snippets among your notes, so you can give a more detailed explanation, and they will be categorized due to the structure of your notes (table of contents, links, etc.). If, on the other hand, you need the code snippet on the command line, you don't have to search through your notes, just search for the right keywords in Navi.

Its advantage over keeping snippets in a separate Navi cheatsheet file is that there is no duplication: if you realize that you need to add another parameter to a command in a snippet, you only have to edit it in your notes, but you don't have to update the separate Navi file as well.

To transform a code block into a Navi cheatsheet, simply add navi: tags CSS style to it and convert the formatting to Navi cheatsheet syntax (you do not have to enter the Navi % tags in the code, instead you have to specify them in the @@navi: line).

Let’s say the code snippet below (which converts a single HTML wiki to a Node.js wiki) is in your notes and you want to make it available from the command line.

```
$ npm install -g tiddlywiki
$ tiddlywiki DIRNAME --init server
$ tiddlywiki DIRNAME --load /PATH/TO/SINGLE_HTML_WIKI.html
```

Converted to Navi cheatsheet format:

@@navi: tiddlywiki;
```
# Convert a single HTML wiki to a Node.js wiki
npm install -g tiddlywiki;
tiddlywiki <dirname> --init server;
tiddlywiki <dirname> --load <path_to_single_html_wiki>;
```
@@

Do not forget about the trailing semicolon on the end of the @@navi: line.

When you save the change, the snippet is immediately available in Navi.

Installation instructions

To add the plugin to your own Node.js based TiddlyWiki5, just drag this link to the browser window and restart the server, refreshing the page is not enough:

$:/plugins/bimlas/navi-cheatsheet

The plugin does not work in the single HTML wiki, you must first convert it to a Node.js wiki.

Check the path of the Navi cheatsheet file in the settings (next tab) after the installation of the plugin.

For other installation options see the repositories above.

(0 Comments)