chipsenkbeil / vimwiki.nvim

Neovim plugin that offers enhanced and alternative functionality for the vimwiki language.
BSD 2-Clause "Simplified" License
50 stars 0 forks source link

Support parsing metadata #6

Open chipsenkbeil opened 4 years ago

chipsenkbeil commented 4 years ago

Main purpose of adding multiline comments to vimwiki was so we could properly find and parse metadata that wouldn't be included in the HTML output (and can also be concealed, etc).

What format should the metadata take? We will be using the multiline comment syntax to start of %%+ and +%%.

Proposal 1: Emacs Org Mode Drawer Mode + Clocking

Drawer Mode Reference: Link Clocking Reference: Link Example Video of Clocking: Link Org-Pomodoro Plugin: Link

Pros

Cons

Examples

** This is a headline
     Still outside the drawer
     :CLOCKING:
     CLOCK: [2020-08-01 18:32]
     :END:
     After the drawer.
- [ ] Some task
   %%+ :CLOCKING: 
   CLOCK: [2020-08-01 18:32]
   :END: +%%

with extra properties if we make stuff up

- [ ] Some task
   %%+ :CLOCKING: 
   CLOCK: [2020-08-01 18:32]
   POMODORO: 3
   :END: +%%

Proposal 2: Embed JSON

Still need a way to determine if metadata, so would need some indication when beginning multiline comment.

Could do %%++ or some variant like that. Or could have a special keyword like %%+:meta:.

Pros

Cons

Examples

- [ ] Some task %%++ {"clock": "2020-08-01 18:32"} +%%

with extra properties if we make stuff up

- [ ] Some task %%++ {"clock": "2020-08-01 18:32","pomodoro": 3} +%%

Proposal 3: Custom Human Readable

Pros

Cons

Examples

- [ ] Some task %%+:clock=2020-08-01 18:32:+%%

with extra properties if we make stuff up

- [ ] Some task %%+:clock=2020-08-01 18:32:pomodoro=3:+%%
chipsenkbeil commented 4 years ago

While I kind of prefer option 3, I think the fastest and scalable solution is option 2 as I don't have to build out a custom parser for metadata.