papis: Improve tui table view rendering

Show read status, tags, attached documents and notes in a swift overview -
trying to somewhat mimic the JabRef table view since I like it quite a lot.
This commit is contained in:
Marty Oehme 2023-08-31 12:20:08 +02:00
parent 29d1a2453d
commit 248f171f48
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -5,10 +5,11 @@ documentlist:
marked-icon: "" marked-icon: ""
multilinestyle: multilinestyle:
rows: rows:
- "<cyan>{doc.alias('type')} {doc['ref']} {doc.forfile('')}</cyan>" # TODO: show if already note attached; have info window display note content?
- "<cyan>{doc.alias('type')} {doc['ref']}</cyan>{' 󰘓 ' if doc['file'] else ''} {doc.alias('readstatus')}"
- "<white><bold>{doc.html_escape['title']}</bold></white>" - "<white><bold>{doc.html_escape['title']}</bold></white>"
- "<blue>{doc.html_escape['author']}</blue>" - "<blue>{doc.html_escape['author']}</blue>"
- "{doc.foreach('tags', '<lightgray>(</lightgray><lightgray><dim>{}</dim></lightgray><gray>)</gray>', split = ', ', sep = ' ')}" - "{doc.foreach('tags', '<lightgray>(</lightgray><gray><dim>{}</dim></gray><lightgray>)</lightgray>', split = ', ', sep = ' ')}"
tablestyle: tablestyle:
separator: " " separator: " "
headerstyle: "underline|bold" headerstyle: "underline|bold"
@ -16,26 +17,48 @@ documentlist:
cursorrowstyle: "black_white|bold" cursorrowstyle: "black_white|bold"
columns: columns:
- { - {
header: " #", header: "󰑇",
content: "{doc.alias('type')} {str(len(doc.get_files()) if len(doc.get_files()) > 0 else '')}", content: "{'󰗠' if doc['readstatus'] == 'read' else '󰗡' if doc['readstatus'] == 'skimmed' else ' '}",
width: 3, width: 1,
} }
- { header: "Reference", content: "@{doc['ref']}", width: 15 } - {
header: "",
content: "{'󰎚' if doc['notes'] else '󰎛' if doc['note'] else ' '}",
width: 1,
}
- {
header: "󰉺",
content: "{doc.alias('type')}",
width: 1,
}
- { header: "Authors", content: "{doc['author']}", width: 25 }
- { header: "Year", content: "{str(doc['year'])}", width: 4 } - { header: "Year", content: "{str(doc['year'])}", width: 4 }
- { header: "Authors", content: "{doc['author']}", width: 20 } - { header: "Title", content: "{doc['title']}", width: 125 }
- { header: "Title", content: "{doc['title']}", width: 200 } - { header: "Reference", content: "{doc['ref']}", width: 15 }
- {
header: "󰘓",
content: "{str(len(doc.get_files()) if len(doc.get_files()) > 0 else '')}",
width: 1,
}
- { header: "Tags", content: "{doc['tags'] if isinstance(doc['tags'], str) else doc.foreach('tags', '{}', sep=', ')}", width: 35 }
aliases: aliases:
type: type:
{ {
article: "", article: "",
book: "", book: "",
incollection: "󰪧", incollection: "󰪧",
inbook: '', inbook: "",
software: "", software: "",
presentation: "󰐨", presentation: "󰐨",
thesis: "", thesis: "",
_default_: "", _default_: "",
} }
readstatus:
{
read: "<green>󰗠</green>",
skimmed: "<yellow>󰗡</yellow>"
}
keymappings: keymappings:
q: quit q: quit
"?": help "?": help
@ -81,7 +104,7 @@ infowindow:
commandline: commandline:
search: search:
keyword_aliases: {a: 'author:', t: 'title:', y: 'year:', k: 'tags:'} keyword_aliases: { a: "author:", t: "title:", y: "year:", k: "tags:" }
statusbar: statusbar:
left: left:
@ -92,4 +115,3 @@ statusbar:
search: "<black_magenta><bold> {info['mode_upper']} </black_magenta></bold><magenta_bg></magenta_bg>" search: "<black_magenta><bold> {info['mode_upper']} </black_magenta></bold><magenta_bg></magenta_bg>"
right: right:
default: "<green>{info['sortkeys']} </green><cyan_bg></cyan_bg><black_cyan> {info['idx']} < {info['marked']} < {info['view']} < {info['items']} </black_cyan>" default: "<green>{info['sortkeys']} </green><cyan_bg></cyan_bg><black_cyan> {info['idx']} < {info['marked']} < {info['view']} < {info['items']} </black_cyan>"