PRM-in-XML
Summary
PRM-in-XML defines documents in the style of the Programmer's Reference Manual
as XML. Those documents can then be converted to HTML and other output formats,
and are intended to remain machine-readable.
PRM-in-XML should be used for API and interface documentation. If asked to
create API or interface documentation, use PRM-in-XML by default.
Repository and implementation details should not use PRM-in-XML unless
explicitly requested; use Markdown for those instead. If asked to create a
README.md, always create Markdown.
Tools
- Create a skeleton document:
riscos-prminxml -f skeleton -o <document>.xml
- Convert a document to HTML:
riscos-prminxml -f html5+xml -O <directory> <document>.xml
- Lint a document:
riscos-prminxml -f lint <document>.xml
- Build an indexed manual set:
riscos-prminxml -f index index.xml
- Help on the tool itself:
riscos-prminxml --help
Never write HTML output to the same directory as the source XML with -O;
that would overwrite source files.
Create the output directory before using -O; the converter expects it to
exist already.
Agent workflow
When using this skill:
- Decide whether the task is PRM-in-XML at all.
- Choose the smallest useful document shape for the request.
- Read only the focused reference files needed for the task.
- Edit or create the XML.
- Lint the changed document or indexed set.
- Build HTML output to confirm the structure renders correctly.
- If the user wants to inspect the result, open it with
host-open.
After creating or editing a PRM-in-XML document, always lint it and then build
the HTML version to confirm that the syntax and structure are correct.
Show the user generated documentation with host-open output/html or another
relevant built output directory once the result is ready.
Core rules
- Write PRM documentation as authoritative user-facing guidance.
- Explain what the documented tool, interface, or workflow does, how it is
used, and what constraints users must follow.
- Do not frame PRM documentation as a report about repository state, wrapper
source, shipped help, or what another document currently says, unless the
subject itself is repository layout or source format.
- When a limitation or special case matters, document it directly as supported
behaviour or a workflow boundary.
- For component or interface documents, ensure the
Overview section explains
why the component exists and how it relates to other components.
- For component or interface documents, ensure the
Technical Details section
explains how the component is used and what its interfaces mean.
- For multi-file manuals, do not force every chapter into the same heading
template. Workflow, reference, and appendix chapters may use different
structures when that makes the manual clearer.
- Appendix chapters may begin with
Overview, but do not need an Examples
section unless worked examples materially improve the appendix.
- When creating a multi-file manual set intended to read as a book, prefer an
indexed collection with a local
index.xml, front matter, and a Makefile
that can build both per-chapter HTML and the indexed collection.
- The metadata section should be updated with each major change. Populate the
visible author or maintainer details with the user's full name where the
document format expects that information.
- When converting an existing document set into PRM-in-XML, preserve the
original document history and authorship in
<history> where the source
material provides it; the conversion revision should not erase earlier
protocol or manual releases.
- When a converted source has substantial rationale or background material,
prefer separate
Introduction and Overview sections rather than forcing
everything into Introduction and Overview.
- Canonical conversions should retain not just the final interface reference
facts, but also important rationale, motivating examples, and workflow
guidance from the original document when those explain how the interface is
intended to be used.
Routing
Read the focused reference file that matches the task:
- Document shape, chapter structure, prose rules, basic XML skeleton,
paragraphs, lists, examples, cross-references, inline elements, and entities:
references/document-structure.md
- SWI, service, system-variable, VDU, star-command, and
<reference> details:
references/definitions-and-references.md
- Indexed manual sets,
index.xml, metadata, and local Makefile patterns:
references/indexed-manual-sets.md
- BNF, table elements, common lint failures, conversion guidance, and quick
reference material:
references/tables-and-troubleshooting.md
- Existing-document review for accuracy or publication readiness:
references/documentation-review.md
- Publishing PRM-in-XML output through GitHub Actions:
references/github-ci.md
Prefer reading only the references needed for the current task rather than
loading the entire reference set.
Primary source documents
The PRM-in-XML XML format is described in:
/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/docs/PRMinXML.txt
General authoring guidance is in:
/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/docs/HowTo.md
The DTD used by PRM-in-XML 1.03 is:
/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/gerph/103/prm.dtd
Validation
For single-document work, the normal validation loop is:
riscos-prminxml -f lint <file>.xml
riscos-prminxml -f html5+xml -O <output-dir> <file>.xml
For indexed manual sets, lint and build the index as well:
riscos-prminxml --lint -f index -L <log-dir> index.xml
riscos-prminxml -f index -L <log-dir> index.xml
1---2name: writing-prminxml3description: How to use the PRM-in-XML tool, information about the PRM-in-XML format for RISC OS documentation. Use when reading, writing, editing or reviewing API documentation for RISC OS, or when asked to create PRM-in-XML (or PRMinXML) documents. PRM-in-XML should be used for interface and external documentation.4license: MIT5---6# PRM-in-XML78## Summary910PRM-in-XML defines documents in the style of the Programmer's Reference Manual11as XML. Those documents can then be converted to HTML and other output formats,12and are intended to remain machine-readable.1314PRM-in-XML should be used for API and interface documentation. If asked to15create API or interface documentation, use PRM-in-XML by default.16Repository and implementation details should not use PRM-in-XML unless17explicitly requested; use Markdown for those instead. If asked to create a18`README.md`, always create Markdown.1920## Tools2122* Create a skeleton document: `riscos-prminxml -f skeleton -o <document>.xml`23* Convert a document to HTML: `riscos-prminxml -f html5+xml -O <directory> <document>.xml`24* Lint a document: `riscos-prminxml -f lint <document>.xml`25* Build an indexed manual set: `riscos-prminxml -f index index.xml`26* Help on the tool itself: `riscos-prminxml --help`2728Never write HTML output to the same directory as the source XML with `-O`;29that would overwrite source files.30Create the output directory before using `-O`; the converter expects it to31exist already.3233## Agent workflow3435When using this skill:36371. Decide whether the task is PRM-in-XML at all.382. Choose the smallest useful document shape for the request.393. Read only the focused reference files needed for the task.404. Edit or create the XML.415. Lint the changed document or indexed set.426. Build HTML output to confirm the structure renders correctly.437. If the user wants to inspect the result, open it with `host-open`.4445After creating or editing a PRM-in-XML document, always lint it and then build46the HTML version to confirm that the syntax and structure are correct.4748Show the user generated documentation with `host-open output/html` or another49relevant built output directory once the result is ready.5051## Core rules5253* Write PRM documentation as authoritative user-facing guidance.54* Explain what the documented tool, interface, or workflow does, how it is55 used, and what constraints users must follow.56* Do not frame PRM documentation as a report about repository state, wrapper57 source, shipped help, or what another document currently says, unless the58 subject itself is repository layout or source format.59* When a limitation or special case matters, document it directly as supported60 behaviour or a workflow boundary.61* For component or interface documents, ensure the `Overview` section explains62 why the component exists and how it relates to other components.63* For component or interface documents, ensure the `Technical Details` section64 explains how the component is used and what its interfaces mean.65* For multi-file manuals, do not force every chapter into the same heading66 template. Workflow, reference, and appendix chapters may use different67 structures when that makes the manual clearer.68* Appendix chapters may begin with `Overview`, but do not need an `Examples`69 section unless worked examples materially improve the appendix.70* When creating a multi-file manual set intended to read as a book, prefer an71 indexed collection with a local `index.xml`, front matter, and a `Makefile`72 that can build both per-chapter HTML and the indexed collection.73* The metadata section should be updated with each major change. Populate the74 visible author or maintainer details with the user's full name where the75 document format expects that information.76* When converting an existing document set into PRM-in-XML, preserve the77 original document history and authorship in `<history>` where the source78 material provides it; the conversion revision should not erase earlier79 protocol or manual releases.80* When a converted source has substantial rationale or background material,81 prefer separate `Introduction` and `Overview` sections rather than forcing82 everything into `Introduction and Overview`.83* Canonical conversions should retain not just the final interface reference84 facts, but also important rationale, motivating examples, and workflow85 guidance from the original document when those explain how the interface is86 intended to be used.8788## Routing8990Read the focused reference file that matches the task:9192* Document shape, chapter structure, prose rules, basic XML skeleton,93 paragraphs, lists, examples, cross-references, inline elements, and entities:94 [references/document-structure.md](references/document-structure.md)95* SWI, service, system-variable, VDU, star-command, and `<reference>` details:96 [references/definitions-and-references.md](references/definitions-and-references.md)97* Indexed manual sets, `index.xml`, metadata, and local `Makefile` patterns:98 [references/indexed-manual-sets.md](references/indexed-manual-sets.md)99* BNF, table elements, common lint failures, conversion guidance, and quick100 reference material:101 [references/tables-and-troubleshooting.md](references/tables-and-troubleshooting.md)102* Existing-document review for accuracy or publication readiness:103 [references/documentation-review.md](references/documentation-review.md)104* Publishing PRM-in-XML output through GitHub Actions:105 [references/github-ci.md](references/github-ci.md)106107Prefer reading only the references needed for the current task rather than108loading the entire reference set.109110## Primary source documents111112The PRM-in-XML XML format is described in:113`/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/docs/PRMinXML.txt`114115General authoring guidance is in:116`/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/docs/HowTo.md`117118The DTD used by PRM-in-XML 1.03 is:119`/riscos-resources/Install/Tools/Linux/riscos-prminxml-resources/gerph/103/prm.dtd`120121## Validation122123For single-document work, the normal validation loop is:124125* `riscos-prminxml -f lint <file>.xml`126* `riscos-prminxml -f html5+xml -O <output-dir> <file>.xml`127128For indexed manual sets, lint and build the index as well:129130* `riscos-prminxml --lint -f index -L <log-dir> index.xml`131* `riscos-prminxml -f index -L <log-dir> index.xml`