Demo for downloading formatted docs

Written for MacOS, more useful for Windows (but I'm not writing that).
This commit is contained in:
nhkeni
2025-01-31 21:48:15 -05:00
parent 3ffbfc724c
commit cfe39900ca
3 changed files with 27 additions and 1 deletions

8
doc/.gitignore vendored
View File

@@ -14,4 +14,10 @@ Guidebook.pdf
Guidebook.ps Guidebook.ps
Guidebook.dated.* Guidebook.dated.*
*.synctex.* *.synctex.*
# files that might appear from "make fetch-docs"
dlb.pdf
makedefs.pdf
mn.pdf
mnh.pdf
nethack.pdf
recover.pdf

View File

@@ -2766,6 +2766,7 @@ healers gain experience by healing pets
blessed scroll of destroy armor asks which armor to destroy blessed scroll of destroy armor asks which armor to destroy
archeologists' fedora is lucky archeologists' fedora is lucky
telepathic hero can discern which particular monster just read a scroll telepathic hero can discern which particular monster just read a scroll
add "make fetch-docs" to download pre-formatted documentation
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features

View File

@@ -397,6 +397,25 @@ fetch-lua-http:
tar zxf lua-$(LUA_VERSION).tar.gz && \ tar zxf lua-$(LUA_VERSION).tar.gz && \
rm -f lua-$(LUA_VERSION).tar.gz ) rm -f lua-$(LUA_VERSION).tar.gz )
#
# This is not part of the dependency build hierarchy.
# It requires an explicit "make fetch-docs".
fetch-docs:
@FDroot=https://www.nethack.org; \
FDvmajor=`awk '/VERSION_MAJOR/{print $$3}' < include/patchlevel.h`; \
FDvminor=`awk '/VERSION_MINOR/{print $$3}' < include/patchlevel.h`; \
RDIR="NetHack-$${FDvmajor}.$${FDvminor}"; \
echo "Fetching directory information for $${RDIR}"; \
RDOCFILES=`curl --no-progress-meter $${FDroot}/cgi-bin/lsautodocs?$$RDIR`; \
FDbase="$${FDroot}/autodocs/$${RDIR}"; \
set -- $${RDOCFILES}; \
echo "Fetching $$# files"; \
while [ $$# -gt 0 ]; do \
echo "Downloading: '$$1' from '$${FDbase}/$$1'"; \
curl --no-progress-meter -R $${FDbase}/$$1 -o doc/$$1; \
shift; \
done
# 'make update' can be used to install a revised version after making # 'make update' can be used to install a revised version after making
# customizations or such. Unlike 'make install', it doesn't delete everything # customizations or such. Unlike 'make install', it doesn't delete everything
# from the target directory to have a clean start. # from the target directory to have a clean start.