feat: html rendering
This commit is contained in:
33
src/sh/notmuch.sh
Normal file
33
src/sh/notmuch.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
# Wrapper around notmuch
|
||||
|
||||
# Print the message id of the last message within a thread.
|
||||
# @argument $1: thread id
|
||||
nm_last_message_in_thread() {
|
||||
$NOTMUCH search --output=messages --offset=-1 thread:"$1" | sed 's/^...//'
|
||||
}
|
||||
|
||||
# Print the header of a message (with trailing empty line)
|
||||
# @argument $1: message id
|
||||
nm_message_header() {
|
||||
$NOTMUCH show --body=false id:"$1" | awk "$AWK_MESSAGEHEADER"
|
||||
}
|
||||
|
||||
# Print the message parts (with indents)
|
||||
# @argument $1: message id
|
||||
nm_message_parts() {
|
||||
$NOTMUCH show --body=true id:"$1" | awk "$AWK_MESSAGEPARTS"
|
||||
}
|
||||
|
||||
# Print the message part number for text/plain or text/html
|
||||
# @argument $1: message id
|
||||
# @argument $2: if set, then the html part number will be printed
|
||||
nm_message_part_nr() {
|
||||
$NOTMUCH show --body=true id:"$1" | awk -v html="${2:-}" "$AWK_PARTNR"
|
||||
}
|
||||
|
||||
# Print part of message
|
||||
# @argument $1: message id
|
||||
# @argument $2: part number
|
||||
nm_message_get_part() {
|
||||
$NOTMUCH show --part="$2" id:"$1"
|
||||
}
|
||||
Reference in New Issue
Block a user