Browse Source

vimwiki logs: use hashed paths in _logscratch/

main
Brennen Bearnes 8 months ago
parent
commit
5c208729d1
2 changed files with 9 additions and 2 deletions
  1. +4
    -2
      home/.vim/vimrc
  2. +5
    -0
      home/bin/notes-collect-metadata

+ 4
- 2
home/.vim/vimrc View File

@ -1012,12 +1012,14 @@ let mapleader = ","
\ })
endfunction
" XXX: Experimental - catenate log entries for current wiki page
" XXX: An ongoing experiment - catenate log entries for current wiki page
function! s:LogForFile()
let realpath = system('readlink -fn ' . shellescape(expand('%')))
let hash = sha256(realpath)
echom 'Finding logs for ' . realpath
botright new
edit ~/notes/vimwiki/_logscratch.wiki
" This should use the current wiki, not a harcoded path:
execute 'edit ~/notes/vimwiki/_logscratch/' . hash . '.wiki'
1,$d " delete everything in file
execute '$read !' . 'notes-logs-for ' . shellescape(realpath)
0delete " delete blank first line - get rid of this if you need debug msgs


+ 5
- 0
home/bin/notes-collect-metadata View File

@ -73,6 +73,11 @@ for input_file in sys.argv[1:]:
pagename = pagename.replace(vimwiki_dir + '/', '', 1)
pagename = os.path.splitext(pagename)[0]
# _logscratch is for ephemeral renderings of logs for other pages - skip
# collecting any metadata for these pages:
if pagename.startswith('_logscratch'):
continue;
with open(input_file) as page:
doc = convert_text(
page.read(),


Loading…
Cancel
Save