RISC OS Build EnvironmentROBE

Appendix54Appendix T: StrongHelp File Format

Overview

StrongHelp is the traditional hypertext manual format used on RISC OS. In the build environment, a manual is usually edited as a directory tree of page and resource files, then packaged into a single manual file of type &3D6.

This appendix summarises both the container form and the editable source-tree form that the build environment tools expose.

The source-tree form is the more complete part of the locally supplied documentation, so this appendix treats that as the canonical maintenance view and describes the binary container only to the extent that the shipped tools and references make it explicit.

StrongHelp formats

Container file

The packaged manual is a single file with StrongHelp filetype &3D6. The installed command help for riscos-strongcopy states that the file begins with the standard HELP header and then stores the manual content in StrongHelp directory blocks.

At a high level, the container consists of:

PartOccurrenceContents
11StrongHelp file header beginning with the text HELP.
21 or moreDirectory blocks describing pages, resources, and subdirectories.
3variableStored page and resource file data.

The build environment tools are intended to work with this format through extraction and rebuilding rather than by hand-editing the binary container.

In other words, the binary container is the publication form of a manual, not its preferred maintenance form within this environment.

The file header is:

OffsetSizeFieldContents
04magicThe text HELP.
44root_sizeSize of the root directory block.
84versionStrongHelp container version number.
124free_listOffset of the free-space list, or 0 if unused.
164root_offsetOffset of the root directory block from the start of the file.

Each directory block (the root, and any subdirectory) begins with a 12-byte header followed by a sequence of variable-length directory entries, one per contained file or subdirectory, running up to the block's declared used size:

OffsetSizeFieldContents
04magicThe text DIR$.
44dir_sizeTotal allocated size of the directory block.
84dir_usedBytes of the block actually used by directory entries (must not exceed dir_size, and must be at least 36 for a block containing one entry).
12variableentriesDirectory entries, packed consecutively from offset 12 up to dir_used.

Each directory entry has a fixed 24-byte header followed by a null-terminated leafname, the whole entry then padded so the next entry starts on a 4-byte boundary:

OffsetSizeFieldContents
04object_offsetOffset from the start of the file to this entry's own data block (a nested DIR$ block for a subdirectory, or a DATA block for a file).
44loadaddrRISC OS load address. When bits 20-31 are all set, bits 8-19 hold the file's 12-bit RISC OS filetype.
84execaddrRISC OS execution address.
124lengthLength of the entry's data, including the 8-byte DATA block header for files.
164flagsRISC OS attribute bits in the low byte, plus bit 8 set if this entry is a directory.
204reservedReserved.
24variableleafnameNull-terminated object name.

A file's own data block (pointed to by its directory entry's object_offset) begins with an 8-byte header:

OffsetSizeFieldContents
04magicThe text DATA.
44sizeTotal allocated size of the block, which must be at least the directory entry's length field.
8variabledataThe file's content, length minus 8 bytes long.

Editable source-tree form

For source control and host editing, the manual is represented as a directory tree. This is the form produced by riscos-shextract and consumed by riscos-strongcopy.

Common special files are:

NameMeaning
!RootRequired entry point page for the manual.
!ConfigureOptional manual configuration for fonts and styles.
!PreOptional helper code for keyword lookup preprocessing.
!MenuOptional iconbar menu definition for the main manual.
!rootDirectory-local default page within a subdirectory.

Page file structure

Each StrongHelp page is a text file. The local StrongHelp topic guidance describes the basic page structure as:

PartOccurrenceContents
11 linePage title on the first line.
2zero or more linesBody text, formatting commands, links, and optional sub-pages.

Formatting commands begin with # at the start of a line, or may appear in braces within text. Links are written in angle brackets. The local syntax guide recommends using #Parent on every page so that navigation remains consistent.

The supplied syntax reference further records:

ConstructMeaning
#StyleNameApplies a named style such as #H1 or #Code.
#StyleName:TextApplies a style to one inline span of text.
#SubpageBegins a sub-page held within the same file.
#Tag tagnameDeclares a target for tagged links.
#Include filenameIncludes another file during processing.
{...}Inline command form embedded within text.

The common link forms include:

FormMeaning
<PageName>Simple link to another page in the same manual.
<Display Text=>PageName>Link with explicit displayed text.
<Display Text=>Manual:PageName>External manual link.
<Display Text=>*OSCommand>Link which runs a command.
<Display Text=>PageName#tagname>Link to a named tag in a page.

Large manuals may be organised flat in one directory, grouped by prefix, or grouped by first-letter ranges such as [a-z]. Empty files named OLDNAME>NEWNAME can be used as redirections.

The local structure guidance also notes that a !root file within a subdirectory acts as that directory's default page.

Filename constraints

StrongHelp reserves additional characters beyond normal host filesystem conventions. The local guidance notes that names needing characters such as !, <, >, or # should use !xx hexadecimal escaping in filenames, where xx is the character's 2-digit hexadecimal ASCII code. For example, a page named Q&A would be stored as Q!26A, since & is character code &26.

The local structure notes give a broader reserved-character set for StrongHelp maintenance names:

! [ ] \ < > . $ % & ? # :

When extracted in the build environment, resource files retain their RISC OS filetypes through host-side comma suffixes such as SpriteFile,ff9.

Tooling workflow

The normal tooling workflow is:

  1. inspect the manual with riscos-shextract --list;
  2. extract it to a directory tree with riscos-shextract --extract-dir;
  3. edit pages and resources in that directory;
  4. rebuild the container with riscos-strongcopy -o Manual,3d6.

This is also the boundary between the two StrongHelp-related command roles in the environment: riscos-shextract turns the binary container into an editable tree, and riscos-strongcopy turns that tree back into a container.

Extraction and rebuild workflow

Extracting and rebuilding a manual

This is the normal source-controlled StrongHelp workflow.

riscos-shextract --extract-dir ./Manual-src Manual,3d6
riscos-strongcopy -o Manual,3d6 Manual-src