Read Microsoft QuickHelp .HLP databases and get the text back out. No
DOS, no DOSBox, no copy of QH.EXE needed.
quickhelp show ALANG.HLP MOV
Title: Move Data Flags: O D I T S Z A P C
Syntax: MOV dest,src -none-
See also: MOVS, MOVSX, MOVZX, MOV Special, LEA, XCHG
Description:
Moves the value in the source operand to the destination operand.
Microsoft shipped this format with most of its DOS development tools from the
late eighties onwards. HELPMAKE.EXE built the files and the QuickHelp viewer
read them, either standalone or from inside an editor. The documentation for a
whole generation of Microsoft tools is still sitting in these files, and as far
as I can find, nothing written since reads them.
Anything whose first two bytes are LN. On my own DOS installation that is:
| File | What is in it |
|---|---|
ALANG.HLP |
the MASM 6.11 assembly language reference, 1,228 topics |
ML.HLP, LINK.HLP, CV.HLP |
the assembler, linker and CodeView manuals |
PWB.HLP, UTILS.HLP |
Programmer's WorkBench and the build tools |
QB45QCK.HLP, QB45ADVR.HLP |
the QuickBASIC 4.5 language reference |
BAS7QCK.HLP, BAS7ADVR.HLP |
the same for BASIC 7 PDS |
Check a file with:
head -c 2 SOMETHING.HLP
If it says LN, this will read it.
This is not the later Windows .HLP format, which is a different thing
entirely and has its own tools.
quickhelp info FILE # topic, context and keyword counts
quickhelp list FILE # every context name, with its topic number
quickhelp show FILE TOPIC # one topic, by context name or number
quickhelp show FILE TOPIC --body # the same, without the viewer's menu bar
quickhelp dump FILE -o DIR # every topic, one text file each
dump is the one to reach for if you want to grep a manual. The MASM language
reference comes out as 1,228 files; the QuickBASIC reference as about 11,500
lines of text with its code examples intact.
pip install -e .
Python 3.9 or newer. No dependencies.
pytest
The tests that read a real help file skip unless there is one to hand, since
Microsoft's cannot be redistributed. Point QUICKHELP_TEST_DIR at a directory
of .HLP files to run those too. The rest do not skip: they build a genuine
QuickHelp file, Huffman tree and all, so the decoding is covered wherever the
tests run.
Every LN file I have opens, and the text comes out clean: no control
characters left in any line, and code examples reproduced exactly as the
manuals print them.
Some things are approximate, and docs/format.md says which:
- A hyperlink's display text is held in a table rather than inline, so a line containing one loses those few characters.
- The first line of a topic is the viewer's menu bar.
--bodydrops it. - A wrapped heading can pick up one stray character where two records join.
docs/format.md describes the layout: the header and its six sections, the
Huffman coding, the keyword dictionary that compresses the text a second time,
and the control codes that carry the display layout. It was worked out from
the files themselves, and it says where something is a guess rather than a
result.
If you want to write your own reader, or port this, start there.
Apache 2.0. See LICENSE.