mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 03:58:32 +02:00
Added Recipe for visualizing Markdown in the CLI, fixed some typos and added backticks in all references of jrnl
This commit is contained in:
parent
6f6ee7b54f
commit
95d53a7b84
1 changed files with 54 additions and 26 deletions
|
@ -28,7 +28,7 @@ You can do things like
|
|||
jrnl @fixed -starred -n 10 -to "jan 2013" --short
|
||||
```
|
||||
|
||||
To get a short summary of the 10 most recent, favourited entries before
|
||||
To get a short summary of the 10 most recent, favourite entries before
|
||||
January 1, 2013 that are tagged with `@fixed`.
|
||||
|
||||
### Statistics
|
||||
|
@ -52,8 +52,8 @@ print exactly one line per entry).
|
|||
|
||||
### Importing older files
|
||||
|
||||
If you want to import a file as an entry to jrnl, you can just do `jrnl < entry.ext`. But what if you want the modification date of the file to
|
||||
be the date of the entry in jrnl? Try this
|
||||
If you want to import a file as an entry to `jrnl`, you can just do `jrnl < entry.ext`. But what if you want the modification date of the file to
|
||||
be the date of the entry in `jrnl`? Try this
|
||||
|
||||
```sh
|
||||
echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' entry.txt` `cat entry.txt` | jrnl
|
||||
|
@ -91,7 +91,7 @@ Body:
|
|||
```
|
||||
|
||||
The `template.txt` file could be used to create a new entry with these
|
||||
command line arguements:
|
||||
command line arguments:
|
||||
|
||||
```sh
|
||||
jrnl < template.txt # Imports template.txt as the most recent entry
|
||||
|
@ -164,7 +164,7 @@ jrnl now --config-override editor:""
|
|||
|
||||
Bind this to a keyboard shortcut.
|
||||
|
||||
Map `Super+Alt+J` to launch the terminal with jrnl prompt
|
||||
Map `Super+Alt+J` to launch the terminal with `jrnl` prompt
|
||||
|
||||
- **xbindkeys**
|
||||
In your `.xbindkeysrc`
|
||||
|
@ -180,6 +180,34 @@ Mod4+Mod1+j
|
|||
bindsym Mod4+Mod1+j exec --no-startup-id alacritty -t floating-jrnl -e jrnl --config-override editor:""
|
||||
for_window[title="floating *"] floating enable
|
||||
```
|
||||
### Visualize Formatted Markdown in the CLI
|
||||
|
||||
Out of the box, `jrnl` can output journal entries in Markdown. However, in order to visualize it you often need to resort to an external Markdown visualizer on your Desktop. But what if you could render your Markdown straight from the CLI? [mdless](https://github.com/ttscoff/mdless) and piping is the answer.
|
||||
|
||||
`mdless` is a `less` like tool that allows you to visualize your Markdown text with formatting and syntax highlighting from the CLI. You can use this in any shell that supports piping. In Linux/Unix any shell supports this, but on Windows you will have to use `PowerShell` or an alternative one that supports piping.
|
||||
|
||||
The simplest way to visualize your Markdown output with `mdless` is as follows:
|
||||
```sh
|
||||
jrnl --export md | mdless
|
||||
```
|
||||
|
||||
This will render your Markdown output in the whole screen.
|
||||
|
||||
Fortunately `mdless` has an option that allows you to adjust the screen width by using the `-w` option as follows:
|
||||
|
||||
```sh
|
||||
jrnl --export md | mdless -w 70
|
||||
```
|
||||
|
||||
If you want Markdown to be your default display format, you can define this in your config file as follows:
|
||||
|
||||
```yaml
|
||||
display_format: md
|
||||
# or
|
||||
display_format: markdown
|
||||
```
|
||||
|
||||
For more information on how `jrnl` outputs your entries in Markdown, please visit the [Formats](./formats.md) section.
|
||||
|
||||
## External editors
|
||||
|
||||
|
@ -201,7 +229,7 @@ tools for Sublime Text and configure your `jrnl.yaml` like this:
|
|||
editor: "subl -w"
|
||||
```
|
||||
|
||||
Note the `-w` flag to make sure jrnl waits for Sublime Text to close the
|
||||
Note the `-w` flag to make sure `jrnl` waits for Sublime Text to close the
|
||||
file before writing into the journal.
|
||||
|
||||
### Visual Studio Code
|
||||
|
@ -252,20 +280,20 @@ grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist
|
|||
### Notepad++ on Windows
|
||||
|
||||
To set [Notepad++](http://notepad-plus-plus.org/) as your editor, edit
|
||||
the jrnl config file (`jrnl.yaml`) like this:
|
||||
the `jrnl` config file (`jrnl.yaml`) like this:
|
||||
|
||||
```yaml
|
||||
editor: "C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession"
|
||||
```
|
||||
|
||||
The double backslashes are needed so jrnl can read the file path
|
||||
correctly. The `-multiInst -nosession` options will cause jrnl to open
|
||||
The double backslashes are needed so `jrnl` can read the file path
|
||||
correctly. The `-multiInst -nosession` options will cause `jrnl` to open
|
||||
its own Notepad++ window.
|
||||
|
||||
|
||||
### emacs
|
||||
|
||||
To use `emacs` as your editor, edit the jrnl config file (`jrnl.yaml`) like this:
|
||||
To use `emacs` as your editor, edit the `jrnl` config file (`jrnl.yaml`) like this:
|
||||
|
||||
```yaml
|
||||
editor: emacsclient -a "" -c
|
||||
|
|
Loading…
Add table
Reference in a new issue