insanum / sncli

Simplenote CLI
MIT License
397 stars 34 forks source link

if you want to configure 'cfg_pager' to show formatted markdown files #41

Closed s5unty closed 7 years ago

s5unty commented 7 years ago
  1. install mdv
  2. make a wrapper /usr/local/sbin/mdless
    #!/bin/zsh
    # https://superuser.com/questions/1059781/what-exactly-is-in-bash-and-in-zsh
    /usr/bin/less -R -c =(mdv "$1")
    # /usr/bin/less -R -c =(mdv -A "$1") # light background (not yet supported)
  3. set it in ~/.snclirc
    cfg_pager = /usr/local/sbin/mdless
samuelallan72 commented 7 years ago

@s5unty Thanks! This looks like it will be useful. 👍

I added this to the wiki on Github: https://github.com/insanum/sncli/wiki/Tips-and-Tricks

Feel free to edit it there if it requires changes, or add other tips/tricks/tutorials! 😄

N0ury commented 3 years ago

Hello, I reopen this issue. I have tried this today. It works fine with a file created with VI but not with a sncli note.

Here's the content of the json file I've used:

{
  "localkey": "91f11e44d8e848e683be6e8730ac0f37",
  "content": "Markdown test note\n\nThis is **bold**\n\n* line 1\n    * line 11\n    * line 12\n    * line 13\n\nTest table\n\n First Header  | Second Header\n  ------------- | -------------\n  Content Cell  | Content Cell\n  Content Cell  | Content Cell\n  Content Cell  | Content Cell\n  Content Cell  | Content Cell\n\n\n",
  "deleted": false,
  "modificationDate": 1628620589.920994,
  "creationDate": 1628620485.484973,
  "savedate": 1628620542.557101,
  "syncdate": 1628620589.925049,
  "tags": [],
  "shareURL": "",
  "publishURL": "",
  "systemTags": [
    "markdown"
  ],
  "version": 4,
  "key": "91f11e44d8e848e683be6e8730ac0f37"
}

It is displayed as ordinary text. Am I doing something wrong? When I say it works with a file, I mean there is only the content part, and \n is replaced with a real linefeed.

N0ury commented 3 years ago

I have found. I had forgotten thi:

# view note in `cfg_pager`
kb_view_note_ext = meta enter

It's all ok now!