mailcap: use dump-docx.py to dump .docx files

This commit is contained in:
2025-12-08 14:27:16 +00:00
parent 6e083d64f1
commit c415bc54da
3 changed files with 25 additions and 0 deletions

14
bin/dump-docx.py Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python
import sys
# python-docx
import docx
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} <document> [document ...]")
for fn in sys.argv[1:]:
print(f"\n{fn}:\n")
doc = docx.Document(fn)
for p in doc.paragraphs:
print(p.text)

View File

@@ -16,3 +16,5 @@ application/pgp-encrypted; gpg -q -d ; copiousoutput
# text/calendar; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s # text/calendar; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s
# application/ics; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s # application/ics; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s
application/pdf; mupdf %s application/pdf; mupdf %s
application/vnd.openxmlformats-officedocument.wordprocessingml.document; dump-docx.py %s; copiousoutput

9
vimrc
View File

@@ -167,6 +167,15 @@ set background=dark
" colorscheme dracula " colorscheme dracula
colorscheme solarized8 colorscheme solarized8
" For packages, versions 8.2 and later will autoload `start` packages
" correctly even in your vimrc.
if v:version < 802
packadd! dracula_pro
endif
syntax enable
let g:dracula_colorterm = 0
" colorscheme dracula_pro
set ignorecase smartcase set ignorecase smartcase
set incsearch set incsearch