Skip to content

Commit 6beaaad

Browse files
committed
vimhelp: Add custom MacVim filter to show a nice header at gui_mac.txt
Add custom logic to locate the "MACVIM REFERENCE MANUAL" and replace with a logo and header. This is a somewhat hacky solution rather than a principled markup based method, but it works. No need to overcomplicate things.
1 parent 80423aa commit 6beaaad

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

vimhelp/static/MacVim.png

32 KB
Loading

vimhelp/vimhelp/vimh2h.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ def to_html(self, filename, contents):
280280
)
281281
lastpos = 0
282282

283+
# Custom MacVim filters
284+
if filename == "gui_mac.txt":
285+
if re.fullmatch("\s*MACVIM REFERENCE MANUAL\s*", line) != None:
286+
out.append("<h1><img src=MacVim.png width=64px>\nMacVim Reference Manual</h1>")
287+
line = ""
288+
283289
tab_fixer = TabFixer()
284290

285291
for match in RE_TAGWORD.finditer(line):

0 commit comments

Comments
 (0)