1
0
forked from aniani/vim

runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)

* Makefile for the Vim documentation on Windows

* Corrected comments

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Restorer 2023-11-04 08:57:09 +00:00 committed by GitHub
parent 15d270019e
commit b23c1fc596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 861 additions and 348 deletions

View File

@ -13,337 +13,9 @@ VIMEXE = vim
# AWK, used for "make html". Comment this out if the include gives problems.
include ../../src/auto/config.mk
DOCS = \
arabic.txt \
autocmd.txt \
builtin.txt \
change.txt \
channel.txt \
cmdline.txt \
debug.txt \
debugger.txt \
develop.txt \
diff.txt \
digraph.txt \
editing.txt \
eval.txt \
farsi.txt \
filetype.txt \
fold.txt \
ft_ada.txt \
ft_context.txt \
ft_mp.txt \
ft_ps1.txt \
ft_raku.txt \
ft_rust.txt \
ft_sql.txt \
gui.txt \
gui_w32.txt \
gui_x11.txt \
hangulin.txt \
hebrew.txt \
help.txt \
helphelp.txt \
howto.txt \
if_cscop.txt \
if_lua.txt \
if_mzsch.txt \
if_ole.txt \
if_perl.txt \
if_pyth.txt \
if_ruby.txt \
if_sniff.txt \
if_tcl.txt \
indent.txt \
index.txt \
insert.txt \
intro.txt \
map.txt \
mbyte.txt \
message.txt \
mlang.txt \
motion.txt \
netbeans.txt \
options.txt \
os_390.txt \
os_amiga.txt \
os_beos.txt \
os_dos.txt \
os_haiku.txt \
os_mac.txt \
os_mint.txt \
os_msdos.txt \
os_os2.txt \
os_qnx.txt \
os_risc.txt \
os_unix.txt \
os_vms.txt \
os_win32.txt \
pattern.txt \
pi_getscript.txt \
pi_gzip.txt \
pi_logipat.txt \
pi_netrw.txt \
pi_paren.txt \
pi_spec.txt \
pi_tar.txt \
pi_vimball.txt \
pi_zip.txt \
popup.txt \
print.txt \
quickfix.txt \
quickref.txt \
quotes.txt \
recover.txt \
remote.txt \
repeat.txt \
rileft.txt \
russian.txt \
scroll.txt \
sign.txt \
spell.txt \
sponsor.txt \
starting.txt \
syntax.txt \
tabpage.txt \
tagsrch.txt \
term.txt \
terminal.txt \
testing.txt \
textprop.txt \
tips.txt \
todo.txt \
uganda.txt \
undo.txt \
userfunc.txt \
usr_01.txt \
usr_02.txt \
usr_03.txt \
usr_04.txt \
usr_05.txt \
usr_06.txt \
usr_07.txt \
usr_08.txt \
usr_09.txt \
usr_10.txt \
usr_11.txt \
usr_12.txt \
usr_20.txt \
usr_21.txt \
usr_22.txt \
usr_23.txt \
usr_24.txt \
usr_25.txt \
usr_26.txt \
usr_27.txt \
usr_28.txt \
usr_29.txt \
usr_30.txt \
usr_31.txt \
usr_32.txt \
usr_40.txt \
usr_41.txt \
usr_42.txt \
usr_43.txt \
usr_44.txt \
usr_45.txt \
usr_50.txt \
usr_51.txt \
usr_52.txt \
usr_90.txt \
usr_toc.txt \
various.txt \
version4.txt \
version5.txt \
version6.txt \
version7.txt \
version8.txt \
version9.txt \
vi_diff.txt \
vim9.txt \
vim9class.txt \
visual.txt \
windows.txt \
workshop.txt
HTMLS = \
arabic.html \
autocmd.html \
builtin.html \
change.html \
channel.html \
cmdline.html \
debug.html \
debugger.html \
develop.html \
diff.html \
digraph.html \
editing.html \
eval.html \
farsi.html \
filetype.html \
fold.html \
ft_ada.html \
ft_context.html \
ft_mp.html \
ft_ps1.html \
ft_raku.html \
ft_rust.html \
ft_sql.html \
gui.html \
gui_w32.html \
gui_x11.html \
hangulin.html \
hebrew.html \
helphelp.html \
howto.html \
if_cscop.html \
if_lua.html \
if_mzsch.html \
if_ole.html \
if_perl.html \
if_pyth.html \
if_ruby.html \
if_sniff.html \
if_tcl.html \
indent.html \
index.html \
insert.html \
intro.html \
map.html \
mbyte.html \
message.html \
mlang.html \
motion.html \
netbeans.html \
options.html \
os_390.html \
os_amiga.html \
os_beos.html \
os_dos.html \
os_haiku.html \
os_mac.html \
os_mint.html \
os_msdos.html \
os_os2.html \
os_qnx.html \
os_risc.html \
os_unix.html \
os_vms.html \
os_win32.html \
pattern.html \
pi_getscript.html \
pi_gzip.html \
pi_logipat.html \
pi_netrw.html \
pi_paren.html \
pi_spec.html \
pi_tar.html \
pi_vimball.html \
pi_zip.html \
popup.html \
print.html \
quickfix.html \
quickref.html \
quotes.html \
recover.html \
remote.html \
repeat.html \
rileft.html \
russian.html \
scroll.html \
sign.html \
spell.html \
sponsor.html \
starting.html \
syntax.html \
tabpage.html \
tagsrch.html \
term.html \
terminal.html \
testing.html \
textprop.html \
tips.html \
todo.html \
uganda.html \
undo.html \
userfunc.html \
usr_01.html \
usr_02.html \
usr_03.html \
usr_04.html \
usr_05.html \
usr_06.html \
usr_07.html \
usr_08.html \
usr_09.html \
usr_10.html \
usr_11.html \
usr_12.html \
usr_20.html \
usr_21.html \
usr_22.html \
usr_23.html \
usr_24.html \
usr_25.html \
usr_26.html \
usr_27.html \
usr_28.html \
usr_29.html \
usr_30.html \
usr_31.html \
usr_32.html \
usr_40.html \
usr_41.html \
usr_42.html \
usr_43.html \
usr_44.html \
usr_45.html \
usr_50.html \
usr_51.html \
usr_52.html \
usr_90.html \
usr_toc.html \
various.html \
version4.html \
version5.html \
version6.html \
version7.html \
version8.html \
version9.html \
vi_diff.html \
vimindex.html \
vim9.html \
vim9class.html \
visual.html \
windows.html \
workshop.html
CONVERTED = \
vim-fr.UTF-8.1 \
evim-fr.UTF-8.1 \
vimdiff-fr.UTF-8.1 \
vimtutor-fr.UTF-8.1 \
xxd-fr.UTF-8.1 \
vim-it.UTF-8.1 \
evim-it.UTF-8.1 \
vimdiff-it.UTF-8.1 \
vimtutor-it.UTF-8.1 \
xxd-it.UTF-8.1 \
vim-pl.UTF-8.1 \
evim-pl.UTF-8.1 \
vimdiff-pl.UTF-8.1 \
vimtutor-pl.UTF-8.1 \
xxd-pl.UTF-8.1 \
vim-ru.UTF-8.1 \
evim-ru.UTF-8.1 \
vimdiff-ru.UTF-8.1 \
vimtutor-ru.UTF-8.1 \
xxd-ru.UTF-8.1 \
vim-tr.UTF-8.1 \
evim-tr.UTF-8.1 \
vimdiff-tr.UTF-8.1 \
vimtutor-tr.UTF-8.1
# 17.10.23, added by Restorer
# Common components
include makefile_all.mak
.SUFFIXES:
.SUFFIXES: .c .o .txt .html
@ -476,6 +148,18 @@ os_win32.txt:
# Note that $< works with GNU make while $> works for BSD make.
# Is there a solution that works for both??
vim-da.UTF-8.1: vim-da.1 # 17.10.23, added by Restorer
iconv -f latin1 -t utf-8 $< >$@
vimdiff-da.UTF-8.1: vimdiff-da.1 # 17.10.23, added by Restorer
iconv -f latin1 -t utf-8 $< >$@
vimtutor-da.UTF-8.1: vimtutor-da.1 # 17.10.23, added by Restorer
iconv -f latin1 -t utf-8 $< >$@
vim-de.UTF-8.1: vim-de.1 # 17.10.23, added by Restorer
iconv -f latin1 -t utf-8 $< >$@
vim-fr.UTF-8.1: vim-fr.1
iconv -f latin1 -t utf-8 $< >$@

View File

@ -0,0 +1,338 @@
# makefile with common components
DOCS = \
arabic.txt \
autocmd.txt \
builtin.txt \
change.txt \
channel.txt \
cmdline.txt \
debug.txt \
debugger.txt \
develop.txt \
diff.txt \
digraph.txt \
editing.txt \
eval.txt \
farsi.txt \
filetype.txt \
fold.txt \
ft_ada.txt \
ft_context.txt \
ft_mp.txt \
ft_ps1.txt \
ft_raku.txt \
ft_rust.txt \
ft_sql.txt \
gui.txt \
gui_w32.txt \
gui_x11.txt \
hangulin.txt \
hebrew.txt \
help.txt \
helphelp.txt \
howto.txt \
if_cscop.txt \
if_lua.txt \
if_mzsch.txt \
if_ole.txt \
if_perl.txt \
if_pyth.txt \
if_ruby.txt \
if_sniff.txt \
if_tcl.txt \
indent.txt \
index.txt \
insert.txt \
intro.txt \
map.txt \
mbyte.txt \
message.txt \
mlang.txt \
motion.txt \
netbeans.txt \
options.txt \
os_390.txt \
os_amiga.txt \
os_beos.txt \
os_dos.txt \
os_haiku.txt \
os_mac.txt \
os_mint.txt \
os_msdos.txt \
os_os2.txt \
os_qnx.txt \
os_risc.txt \
os_unix.txt \
os_vms.txt \
os_win32.txt \
pattern.txt \
pi_getscript.txt \
pi_gzip.txt \
pi_logipat.txt \
pi_netrw.txt \
pi_paren.txt \
pi_spec.txt \
pi_tar.txt \
pi_vimball.txt \
pi_zip.txt \
popup.txt \
print.txt \
quickfix.txt \
quickref.txt \
quotes.txt \
recover.txt \
remote.txt \
repeat.txt \
rileft.txt \
russian.txt \
scroll.txt \
sign.txt \
spell.txt \
sponsor.txt \
starting.txt \
syntax.txt \
tabpage.txt \
tagsrch.txt \
term.txt \
terminal.txt \
testing.txt \
textprop.txt \
tips.txt \
todo.txt \
uganda.txt \
undo.txt \
userfunc.txt \
usr_01.txt \
usr_02.txt \
usr_03.txt \
usr_04.txt \
usr_05.txt \
usr_06.txt \
usr_07.txt \
usr_08.txt \
usr_09.txt \
usr_10.txt \
usr_11.txt \
usr_12.txt \
usr_20.txt \
usr_21.txt \
usr_22.txt \
usr_23.txt \
usr_24.txt \
usr_25.txt \
usr_26.txt \
usr_27.txt \
usr_28.txt \
usr_29.txt \
usr_30.txt \
usr_31.txt \
usr_32.txt \
usr_40.txt \
usr_41.txt \
usr_42.txt \
usr_43.txt \
usr_44.txt \
usr_45.txt \
usr_50.txt \
usr_51.txt \
usr_52.txt \
usr_90.txt \
usr_toc.txt \
various.txt \
version4.txt \
version5.txt \
version6.txt \
version7.txt \
version8.txt \
version9.txt \
vi_diff.txt \
vim9.txt \
vim9class.txt \
visual.txt \
windows.txt \
workshop.txt
HTMLS = \
arabic.html \
autocmd.html \
builtin.html \
change.html \
channel.html \
cmdline.html \
debug.html \
debugger.html \
develop.html \
diff.html \
digraph.html \
editing.html \
eval.html \
farsi.html \
filetype.html \
fold.html \
ft_ada.html \
ft_context.html \
ft_mp.html \
ft_ps1.html \
ft_raku.html \
ft_rust.html \
ft_sql.html \
gui.html \
gui_w32.html \
gui_x11.html \
hangulin.html \
hebrew.html \
helphelp.html \
howto.html \
if_cscop.html \
if_lua.html \
if_mzsch.html \
if_ole.html \
if_perl.html \
if_pyth.html \
if_ruby.html \
if_sniff.html \
if_tcl.html \
indent.html \
index.html \
insert.html \
intro.html \
map.html \
mbyte.html \
message.html \
mlang.html \
motion.html \
netbeans.html \
options.html \
os_390.html \
os_amiga.html \
os_beos.html \
os_dos.html \
os_haiku.html \
os_mac.html \
os_mint.html \
os_msdos.html \
os_os2.html \
os_qnx.html \
os_risc.html \
os_unix.html \
os_vms.html \
os_win32.html \
pattern.html \
pi_getscript.html \
pi_gzip.html \
pi_logipat.html \
pi_netrw.html \
pi_paren.html \
pi_spec.html \
pi_tar.html \
pi_vimball.html \
pi_zip.html \
popup.html \
print.html \
quickfix.html \
quickref.html \
quotes.html \
recover.html \
remote.html \
repeat.html \
rileft.html \
russian.html \
scroll.html \
sign.html \
spell.html \
sponsor.html \
starting.html \
syntax.html \
tabpage.html \
tagsrch.html \
term.html \
terminal.html \
testing.html \
textprop.html \
tips.html \
todo.html \
uganda.html \
undo.html \
userfunc.html \
usr_01.html \
usr_02.html \
usr_03.html \
usr_04.html \
usr_05.html \
usr_06.html \
usr_07.html \
usr_08.html \
usr_09.html \
usr_10.html \
usr_11.html \
usr_12.html \
usr_20.html \
usr_21.html \
usr_22.html \
usr_23.html \
usr_24.html \
usr_25.html \
usr_26.html \
usr_27.html \
usr_28.html \
usr_29.html \
usr_30.html \
usr_31.html \
usr_32.html \
usr_40.html \
usr_41.html \
usr_42.html \
usr_43.html \
usr_44.html \
usr_45.html \
usr_50.html \
usr_51.html \
usr_52.html \
usr_90.html \
usr_toc.html \
various.html \
version4.html \
version5.html \
version6.html \
version7.html \
version8.html \
version9.html \
vi_diff.html \
vimindex.html \
vim9.html \
vim9class.html \
visual.html \
windows.html \
workshop.html
CONVERTED = \
vim-da.UTF-8.1 \
vimdiff-da.UTF-8.1 \
vimtutor-da.UTF-8.1 \
vim-de.UTF-8.1 \
vim-fr.UTF-8.1 \
evim-fr.UTF-8.1 \
vimdiff-fr.UTF-8.1 \
vimtutor-fr.UTF-8.1 \
xxd-fr.UTF-8.1 \
vim-it.UTF-8.1 \
evim-it.UTF-8.1 \
vimdiff-it.UTF-8.1 \
vimtutor-it.UTF-8.1 \
xxd-it.UTF-8.1 \
vim-pl.UTF-8.1 \
evim-pl.UTF-8.1 \
vimdiff-pl.UTF-8.1 \
vimtutor-pl.UTF-8.1 \
xxd-pl.UTF-8.1 \
vim-ru.UTF-8.1 \
evim-ru.UTF-8.1 \
vimdiff-ru.UTF-8.1 \
vimtutor-ru.UTF-8.1 \
xxd-ru.UTF-8.1 \
vim-tr.UTF-8.1 \
evim-tr.UTF-8.1 \
vimdiff-tr.UTF-8.1 \
vimtutor-tr.UTF-8.1

View File

@ -0,0 +1,460 @@
#
# Makefile for the Vim documentation on Windows
#
# 17.11.23, Restorer, <restorer@mail2k.ru>
# Common components
!INCLUDE makefile_all.mak
# TODO: to think about what to use instead of awk. PowerShell?
#AWK =
#
VIMEXE = D:\Programs\Vim\vim90\vim.exe
#
GETTEXT_PATH = D:\Programs\GetText\bin
# In case some package like GnuWin32, UnixUtils
# or something similar is installed on the system.
# If the "touch" program is installed on the system, but it is not registered
# in the %PATH% environment variable, then specify the full path to this file.
!IF EXIST ("touch.exe")
TOUCH = touch.exe $@
!ELSE
TOUCH = @if exist $@ ( copy /b $@+,, ) else ( type nul >$@ )
!ENDIF
# In case some package like GnuWin32, UnixUtils, gettext
# or something similar is installed on the system.
# If the "iconv" program is installed on the system, but it is not registered
# in the %PATH% environment variable, then specify the full path to this file.
!IF EXIST ("iconv.exe")
ICONV = iconv.exe
!ELSEIF EXIST ("$(GETTEXT_PATH)\iconv.exe")
ICONV="$(GETTEXT_PATH)\iconv.exe"
!ENDIF
RM = del /q
.SUFFIXES :
.SUFFIXES : .c .o .txt .html
all : tags perlhtml $(CONVERTED)
# Use "doctags" to generate the tags file. Only works for English!
tags : doctags $(DOCS)
doctags $(DOCS) | sort /L C /O tags
powershell -nologo -noprofile -Command\
"(Get-Content -Raw tags | Get-Unique | % {$$_ -replace \"`r\", \"\"}) |\
New-Item -Force -Path . -ItemType file -Name tags"
doctags : doctags.c
$(CC) doctags.c
# Use Vim to generate the tags file. Can only be used when Vim has been
# compiled and installed. Supports multiple languages.
vimtags : $(DOCS)
$(VIMEXE) --clean -esX -V1 -u doctags.vim
uganda.nsis.txt : uganda.*
!powershell -nologo -noprofile -Command\
$$ext=(Get-Item $?).Extension; (Get-Content $? ^| \
% {$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''})\
^| Set-Content $*$$ext
!powershell -nologo -noprofile -Command\
$$ext=(Get-Item $?).Extension;\
(Get-Content -Raw $(@B)$$ext).Trim() -replace '(\r\n){3,}', '$$1$$1'\
^| Set-Content $(@B)$$ext
# TODO:
#html: noerrors tags $(HTMLS)
# if exist errors.log (more errors.log)
# TODO:
#noerrors:
# $(RM) errors.log
# TODO:
#.txt.html:
# TODO:
#index.html: help.txt
# TODO:
#vimindex.html: index.txt
# TODO:
#tags.ref tags.html: tags
# Perl version of .txt to .html conversion.
# There can't be two rules to produce a .html from a .txt file.
# Just run over all .txt files each time one changes. It's fast anyway.
perlhtml : tags $(DOCS)
vim2html.pl tags $(DOCS)
# Check URLs in the help with "curl" or "powershell".
test_urls :
$(VIMEXE) -S test_urls.vim
clean :
$(RM) doctags.exe doctags.obj
$(RM) *.html vim-stylesheet.css
arabic.txt :
$(TOUCH)
farsi.txt :
$(TOUCH)
hebrew.txt :
$(TOUCH)
russian.txt :
$(TOUCH)
gui_w32.txt :
$(TOUCH)
if_ole.txt :
$(TOUCH)
os_390.txt :
$(TOUCH)
os_amiga.txt :
$(TOUCH)
os_beos.txt :
$(TOUCH)
os_dos.txt :
$(TOUCH)
os_haiku.txt :
$(TOUCH)
os_mac.txt :
$(TOUCH)
os_mint.txt :
$(TOUCH)
os_msdos.txt :
$(TOUCH)
os_os2.txt :
$(TOUCH)
os_qnx.txt :
$(TOUCH)
os_risc.txt :
$(TOUCH)
os_win32.txt :
$(TOUCH)
convert-all : $(CONVERTED)
!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
!ERROR The program "PowerShell" version 3.0 or higher is required to work
!ENDIF
vim-da.UTF-8.1 : vim-da.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-da.UTF-8.1 : vimdiff-da.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-da.UTF-8.1 : vimtutor-da.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-de.UTF-8.1 : vim-de.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
evim-fr.UTF-8.1 : evim-fr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-fr.UTF-8.1 : vim-fr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-fr.UTF-8.1 : vimdiff-fr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-fr.UTF-8.1 : vimtutor-fr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t utf-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
xxd-fr.UTF-8.1 : xxd-fr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
evim-it.UTF-8.1 : evim-it.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-it.UTF-8.1 : vim-it.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-it.UTF-8.1 : vimdiff-it.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-it.UTF-8.1 : vimtutor-it.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
xxd-it.UTF-8.1 : xxd-it.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
evim-pl.UTF-8.1 : evim-pl.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-pl.UTF-8.1 : vim-pl.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-pl.UTF-8.1 : vimdiff-pl.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-pl.UTF-8.1 : vimtutor-pl.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
xxd-pl.UTF-8.1 : xxd-pl.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
evim-ru.UTF-8.1 : evim-ru.1
!IF DEFINED (ICONV)
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-ru.UTF-8.1 : vim-ru.1
!IF DEFINED (ICONV)
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-ru.UTF-8.1 : vimdiff-ru.1
!IF DEFINED (ICONV)
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-ru.UTF-8.1 : vimtutor-ru.1
!IF DEFINED (ICONV)
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
xxd-ru.UTF-8.1 : xxd-ru.1
!IF DEFINED (ICONV)
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
evim-tr.UTF-8.1 : evim-tr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
! IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
! ERROR Для работы требуется программа «PowerShell» версии 3.0 или выше
! ENDIF
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vim-tr.UTF-8.1 : vim-tr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimdiff-tr.UTF-8.1 : vimdiff-tr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
vimtutor-tr.UTF-8.1 : vimtutor-tr.1
!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command\
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^|\
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make:

View File

@ -6,21 +6,41 @@
" Written by Christian Brabandt.
func Test_check_URLs()
"20.10.23, added by Restorer
if has("win32")
echoerr "Doesn't work on MS-Windows"
return
let s:outdev = 'nul'
else
let s:outdev = '/dev/null'
endif
" Restorer: For Windows users. If "curl" or "weget" is installed on the system
" but not in %PATH%, add the full routes for them to this environment variable.
if executable('curl')
" Note: does not follow redirects!
let s:command = 'curl --silent --fail --output /dev/null --head '
let s:command1 = 'curl --silent --fail --output ' ..s:outdev.. ' --head '
let s:command2 = ""
elseif executable('wget')
" Note: only allow a couple of redirects
let s:command = 'wget --quiet -S --spider --max-redirect=2 --timeout=5 --tries=2 -O /dev/null '
let s:command1 = 'wget --quiet -S --spider --max-redirect=2 --timeout=5 --tries=2 -O ' ..s:outdev.. ' '
let s:command2 = ""
elseif has("win32") "20.10.23, added by Restorer
if executable('powershell')
if 2 == system('powershell -nologo -noprofile "$psversiontable.psversion.major"')
echoerr 'To work in OS Windows requires the program "PowerShell" version 3.0 or higher'
return
endif
let s:command1 =
\ "powershell -nologo -noprofile \"{[Net.ServicePointManager]::SecurityProtocol = 'Tls12, Tls11, Tls, Ssl3'};try{(Invoke-WebRequest -MaximumRedirection 2 -TimeoutSec 5 -Uri "
let s:command2 = ').StatusCode}catch{exit [int]$Error[0].Exception.Status}"'
endif
else
echoerr 'Only works when "curl" or "wget" is available'
echoerr 'Only works when "curl" or "wget", or "powershell" is available'
return
endif
" Do the testing.
set report =999
set nomore shm +=s
let pat='\(https\?\|ftp\)://[^\t* ]\+'
exe 'helpgrep' pat
helpclose
@ -36,22 +56,21 @@ func Test_check_URLs()
put =urls
" remove some more invalid items
" empty lines
v/./d
"20.10.23, Restorer: '_' is a little faster, see `:h global`
v/./d _
" remove # anchors
%s/#.*$//e
" remove trailing stuff (parenthesis, dot, comma, quotes), but only for HTTP
" links
g/^h/s#[.,)'"/>][:.]\?$##
g#^[hf]t\?tp:/\(/\?\.*\)$#d
silent! g/ftp://,$/d
silent! g/=$/d
g/^h/s#[.),'"`/>][:.,]\?$##
g#^[hf]t\?tp:/\(/\?\.*\)$#d _
silent! g/ftp://,$/d _
silent! g/=$/d _
let a = getline(1,'$')
let a = uniq(sort(a))
%d
%d _
call setline(1, a)
" Do the testing.
set nomore
%s/.*/\=TestURL(submatch(0))/
" highlight the failures
@ -61,8 +80,10 @@ endfunc
func TestURL(url)
" Relies on the return code to determine whether a page is valid
echom printf("Testing URL: %d/%d %s", line('.'), line('$'), a:url)
call system(s:command . shellescape(a:url))
call system(s:command1 .. shellescape(a:url) .. s:command2)
return printf("%s %d", a:url, v:shell_error)
endfunc
call Test_check_URLs()
" vim: sw=2 sts=2 et

View File

@ -6,11 +6,21 @@
# Sun Feb 24 14:49:17 CET 2002
use strict;
use warnings;
use vars qw/%url $date/;
%url = ();
$date = `date`;
chop $date;
# 30.11.23, Restorer:
# This command does not work in OS Windows.
# The "date" command in Windows is different from its counterpart in UNIX-like systems.
# The closest analog is the "date /t" command, but how it would work in UNIX,
# I don't know. I've corrected it as best I can. I don't know Perl.
#$date = `date`;
#chop $date;
my ($year) = 1900 + (localtime())[5];
my ($month) = 1 + (localtime())[4];
my ($day) = (localtime())[3];
#$date = localtime(); # outputs like this Fri Nov 3 00:56:59 2023
sub maplink
{
@ -164,7 +174,7 @@ EOF
}
print OUT<<EOF;
</pre>
<p><i>Generated by vim2html on $date</i></p>
<p><i>Generated by vim2html on $day.$month.$year</i></p>
</body>
</html>
EOF