#task-management #text-format #note #plain-text #quick #language #line

bin+lib patto

🐙 Yet another plain text format for quick note taking and task management

2 releases

new 0.1.2 Nov 24, 2024
0.1.1 Nov 23, 2024
0.1.0 Nov 23, 2024

#761 in Parser implementations

Download history 308/week @ 2024-11-20

308 downloads per month

MIT license

140KB
3K SLoC

Rust 2.5K SLoC // 0.1% comments Vim Script 163 SLoC // 0.2% comments TypeScript 107 SLoC // 0.2% comments Pest 75 SLoC // 0.1% comments

🐙 Patto Note

Yet another plain text format for quick note taking and task management.

Description

Patto Note is a Cosense (formerly Scrapbox)-inspired text format. This enables quick note taking and task management in your favorite editor powered by Language Server Protocol. Unlike markdown format, newline "\n" literally create a new line, and a leading (hard) tab "\t" itemize the line.

Features

  • Primary Zettelkasten support
  • Task management support by line property (please refer to the syntax section below)
  • Integrated vim plugin
  • Language server protocol
    • asynchronous workspace scanning
    • diagnostics
    • jumping between notes by go-to definition
    • note/anchor completion

Installation

Install lsp server using cargo

cargo install patto

Setup vim with vim-lsp

Plug 'ompugao/patto', {'for': 'patto'}

Setup vscode extension

To be released

Syntax

Hello world.
	itemize lines with a leading hard tab `\t'
		that can be nested
	the second element  #sampleanchor
	the third element
	[@quote]
		quoted text must be indented with '\t'

Task Management
	a task {@task status=todo}
	another task with deadline {@task status=todo due=2030-12-31T23:59:00}
	a completed task {@task status=done}

Decoration:
	[* bold text]
	[/ italic text]
	[*/ bold italic text]

Links:
	[other note]
		link to other note in a workspace
	[other note#anchor]
		direct link to an anchored line
	[#sampleanchor]
		self note link to the anchored line
	url link:
		[https://google.com url title]
	title and url can be flipped:
		[url title https://google.com]
	link to an image
		[@img https://via.placeholder.com/50 width=300 height=300]

Code highlight with highlight.js
	[@code python]
		import numpy as np
		print(np.sum(10))
	[` inline code `]

Math with katex
	[@math]
		O(n^2)\\
		sum_{i=0}^{10}{i} = 55
	inline math: [$ O(n log(n)) $]

Upcoming features:

parser

  • link to localfile

lsp

  • semantic tokens
  • document backlinks using find references

renderer

  • markdown export
  • math expression rendering

Misc

unix command utilities

sort tasks with grep and sort

rg --vimgrep '.*@task.*todo' . | awk '{match($0, /due=([0-9:\-T]+)/, m); if (RLENGTH>0) print m[1], $0; else print "9999-99-99", $0}' |sort |cut -d' ' -f2-
# or, in vim
cgetexpr system('rg --vimgrep ".*@task.*todo" . | awk "{match(\$0, /due=([0-9T:\-]+)/, m); if (RLENGTH>0) print m[1], \$0; else print \"9999-99-99\", \$0}" |sort|cut -d" " -f2-')|copen

Dependencies

~14–26MB
~377K SLoC