HTML templates¶
Every page in an HTML disassembly is built from a single full-page template and several subtemplates defined by [Template:*] sections in the ref file.
A template may contain ‘replacement fields’ - identifiers enclosed by braces
({
and }
) - that are replaced by appropriate content (typically derived
from the skool file or a ref file section) when the template is formatted. The
following ‘universal’ identifiers are available in every template:
Game
- a dictionary of the parameters in the [Game] sectionSkoolKit
- a dictionary of parameters relevant to the page currently being built
The parameters in the SkoolKit
dictionary are:
index_href
- the relative path to the disassembly index pagepage_header
- the page header text (as defined in the [PageHeaders] section)page_id
- the page ID (e.g.GameIndex
,MemoryMap
)title
- the title of the page (as defined in the [Titles] section)
The parameters in a dictionary are accessed using the [param]
notation;
for example, wherever {Game[Copyright]}
appears in a template, it is
replaced by the value of the Copyright
parameter in the [Game]
section when the template is formatted.
In addition to the universal identifiers, the following page-level identifiers are available in every full-page template:
m_javascript
- replaced by any number of copies of the javascript subtemplatem_stylesheet
- replaced by one or more copies of the stylesheet subtemplatet_footer
- replaced by a copy of the footer subtemplate
Asm¶
The Asm
template is the full-page template that is used to build
disassembly pages.
It contains the following identifiers (in addition to the universal and page-level identifiers):
disassembly
- replaced by sequences of copies of the asm_instruction subtemplate, punctuated by copies of the asm_comment subtemplateentry
- a dictionary of parameters corresponding to the current memory map entry (see below)next_entry
- a dictionary of parameters corresponding to the next memory map entry (see below)prev_entry
- a dictionary of parameters corresponding to the previous memory map entry (see below)registers_input
- replaced by any number of copies of the asm_register subtemplateregisters_output
- replaced by any number of copies of the asm_register subtemplate
The parameters in the prev_entry
, entry
and next_entry
dictionaries
are:
address
- the address of the entry (may be in decimal or hexadecimal format, depending on how it appears in the skool file, and the options passed to skool2html.py)annotated
- ‘1’ if any instructions in the entry have a non-empty comment field, ‘0’ otherwisebyte
- the LSB of the entry addressdescription
- the entry descriptionexists
- ‘1’ if the entry exists, ‘0’ otherwisehref
- the relative path to the disassembly page for the entry (useful only forprev_entry
andnext_entry
)label
- the ASM label of the first instruction in the entrylabels
- ‘1’ if any instructions in the entry have an ASM label, ‘0’ otherwiselocation
- the address of the entry as a decimal numbermap_href
- the relative path to the entry on the ‘Memory Map’ pagepage
- the MSB of the entry addresssize
- the size of the entry in bytestitle
- the title of the entrytype
- the block type of the entry (‘b’, ‘c’, ‘g’, ‘s’, ‘t’, ‘u’ or ‘w’)
The entry
dictionary also contains the following parameters:
input
- ‘1’ if there are input register values defined, ‘0’ otherwiseoutput
- ‘1’ if there are output register values defined, ‘0’ otherwise
To see the default Asm
template, run the following command:
$ skool2html.py -r Template:Asm
GameIndex¶
The GameIndex
template is the full-page template that is used to build the
disassembly index page.
It contains the following identifier (in addition to the universal and page-level identifiers):
m_index_section
- replaced by any number of copies of the index_section subtemplate
To see the default GameIndex
template, run the following command:
$ skool2html.py -r Template:GameIndex
MemoryMap¶
The MemoryMap
template is the full-page template that is used to build
memory map pages and the ‘Game status buffer’ page.
It contains the following identifiers (in addition to the universal and page-level identifiers):
MemoryMap
- a dictionary of the parameters in the corresponding [MemoryMap:*] sectionm_map_entry
- replaced by one or more copies of the map_entry subtemplate
To see the default MemoryMap
template, run the following command:
$ skool2html.py -r Template:MemoryMap
Page¶
The Page
template is the full-page template that is used to build custom
pages defined by [Page:*] and [PageContent:*] sections.
It contains the following identifier (in addition to the universal and page-level identifiers):
content
- replaced by the value of thePageContent
parameter in the corresponding [Page:*] section
To see the default Page
template, run the following command:
$ skool2html.py -r Template:Page
Reference¶
The Reference
template is the full-page template that is used to build the
‘Bugs’, ‘Trivia’, ‘Pokes’, ‘Glossary’, ‘Graphic glitches’ and ‘Changelog’
pages.
It contains the following identifiers (in addition to the universal and page-level identifiers):
entries
- replaced by one or more copies of the changelog_entry subtemplate (on the ‘Changelog’ page), or the reference_entry subtemplate (on the ‘Bugs’, ‘Trivia’, ‘Pokes’, ‘Glossary’ and ‘Graphic glitches’ pages)m_contents_list_item
- replaced by one or more copies of the contents_list_item subtemplate
To see the default Reference
template, run the following command:
$ skool2html.py -r Template:Reference
anchor¶
The anchor
template is the subtemplate used to format a page anchor (by
default, a <span>
element with an id
attribute).
It contains the following identifier (in addition to the universal identifiers):
anchor
- the value of theid
attribute
To see the default anchor
template, run the following command:
$ skool2html.py -r Template:anchor
asm_comment¶
The asm_comment
template is the subtemplate used by the Asm
full-page template to format block start comments, mid-block comments and block
end comments.
It contains the following identifiers (in addition to the universal identifiers):
entry
- a dictionary of parameters corresponding to the current memory map entry (see Asm)m_paragraph
- replaced by one or more copies of the paragraph subtemplatet_anchor
- replaced by a copy of the anchor subtemplate (when formatting a block start comment or a mid-block comment), or by an empty string (when formatting a block end comment)
To see the default asm_comment
template, run the following command:
$ skool2html.py -r Template:asm_comment
asm_instruction¶
The asm_instruction
template is the subtemplate used by the Asm
full-page template to format an instruction (including its label, address,
operation and comment).
It contains the following identifiers (in addition to the universal identifiers):
address
- the address of the instruction (may be in decimal or hexadecimal format, depending on how it appears in the skool file, and the options passed to skool2html.py)annotated
- ‘1’ if the instruction has a comment field, ‘0’ otherwisecalled
- ‘2’ if the instruction is an entry point, ‘1’ otherwisecomment
- the text of the instruction’s comment fieldcomment_rowspan
- the number of instructions to which the comment field appliesentry
- a dictionary of parameters corresponding to the memory map entry that contains the instruction (see Asm)label
- the instruction’s ASM labeloperation
- the assembly language operation (e.g. ‘LD A,B’), with operand hyperlinked if appropriatet_anchor
- replaced by a copy of the anchor subtemplate
To see the default asm_instruction
template, run the following command:
$ skool2html.py -r Template:asm_instruction
asm_register¶
The asm_register
template is the subtemplate used by the Asm
full-page template to format each row in a table of input register values or
output register values.
It contains the following identifiers (in addition to the universal identifiers):
description
- the register’s description (as it appears in the register section for the current entry in the skool file)entry
- a dictionary of parameters corresponding to the current memory map entry (see Asm)name
- the register’s name (e.g. ‘HL’)
To see the default asm_register
template, run the following command:
$ skool2html.py -r Template:asm_register
changelog_entry¶
The changelog_entry
is the subtemplate used by the Reference
full-page template to format each entry on the ‘Changelog’ page.
It contains the following identifiers (in addition to the universal identifiers):
description
- the changelog entry intro textnum
- ‘1’ or ‘2’, depending on the order of the entry on the paget_anchor
- replaced by a copy of the anchor subtemplate (with the entry title as the anchor name)t_changelog_item_list
- replaced by a copy of the changelog_item_list subtemplatetitle
- the changelog entry title
To see the default changelog_entry
template, run the following command:
$ skool2html.py -r Template:changelog_entry
changelog_item_list¶
The changelog_item_list
template is the subtemplate used by the
changelog_entry subtemplate to format a list of changelog items, and
also by the changelog_item
or list_item subtemplate to format a
list of subitems or subsubitems etc.
It contains the following identifiers (in addition to the universal identifiers):
indent
- the indentation level of the item list: ‘’ (blank string) for the list of top-level items, ‘1’ for a list of subitems, ‘2’ for a list of subsubitems etc.m_changelog_item
- replaced by one or more copies of thechangelog_item
subtemplate if it exists, or the list_item subtemplate otherwise
To see the default changelog_item_list
template, run the following
command:
$ skool2html.py -r Template:changelog_item_list
contents_list_item¶
The contents_list_item
template is the subtemplate used by the
Reference full-page template to format each item in the contents list
on the ‘Bugs’, ‘Trivia’, ‘Pokes’, ‘Glossary’, ‘Graphic glitches’ and
‘Changelog’ pages.
It contains the following identifiers (in addition to the universal identifiers):
href
- the URL to the entry on the pagetitle
- the entry title
To see the default contents_list_item
template, run the following command:
$ skool2html.py -r Template:contents_list_item
img¶
The img
template is the subtemplate used to format <img>
elements.
It contains the following identifiers (in addition to the universal identifiers):
alt
- the ‘alt’ text for the imagesrc
- the relative path to the image file
To see the default img
template, run the following command:
$ skool2html.py -r Template:img
index_section¶
The index_section
template is the subtemplate used by the
GameIndex full-page template to format each group of links on the
disassembly index page.
It contains the following identifiers (in addition to the universal identifiers):
header
- the header text for the group of links (as defined in the name of the [Index:*:*] section)m_index_section_item
- replaced by one or more copies of the index_section_item subtemplate
To see the default index_section
template, run the following command:
$ skool2html.py -r Template:index_section$
index_section_item¶
The index_section_item
template is the subtemplate used by the
index_section subtemplate to format each link in a link group on the
disassembly index page.
It contains the following identifiers (in addition to the universal identifiers):
href
- the relative path to the page being linked tolink_text
- the link text for the page (as defined in the [Links] section)other_text
- the supplementary text displayed alongside the link (as defined in the [Links] section)
To see the default index_section_item
template, run the following
command:
$ skool2html.py -r Template:index_section_item
javascript¶
The javascript
template is the subtemplate used by the full-page templates
to format each <script>
element in the head of a page.
It contains the following identifier (in addition to the universal identifiers):
src
- the relative path to the JavaScript file
To see the default javascript
template, run the following command:
$ skool2html.py -r Template:javascript
link¶
The link
template is the subtemplate used to format the hyperlinks created
by the #BUG, #FACT, #POKE, #LINK and #R macros,
and the hyperlinks in instruction operands on disassembly pages.
It contains the following identifiers (in addition to the universal identifiers):
href
- the relative path to the page being linked tolink_text
- the link text for the page
To see the default link
template, run the following command:
$ skool2html.py -r Template:link
list¶
The list
template is used by the #LIST macro to format a list.
It contains the following identifiers (in addition to the universal identifiers):
class
- the CSS class name for the listm_list_item
- replaced by any number of copies of the list_item subtemplate
To see the default list
template, run the following command:
$ skool2html.py -r Template:list$
New in version 4.2.
list_item¶
The list_item
template is the subtemplate used by the list
template to format each item in the list, and also by the
changelog_item_list subtemplate to format each item in a changelog
item list.
It contains the following identifier (in addition to the universal identifiers):
item
- replaced by the text of the list item
To see the default list_item
template, run the following command:
$ skool2html.py -r Template:list_item
New in version 4.2.
map_entry¶
The map_entry
template is the subtemplate used by the MemoryMap
full-page template to format each entry on the memory map pages and the ‘Game
status buffer’ page.
It contains the following identifiers (in addition to the universal identifiers):
MemoryMap
- a dictionary of parameters from the corresponding [MemoryMap:*] sectionentry
- a dictionary of parameters corresponding to the current memory map entry
The parameters in the entry
dictionary are:
address
- the address of the entry (may be in decimal or hexadecimal format, depending on how it appears in the skool file, and the options passed to skool2html.py)byte
- the LSB of the entry addressdescription
- the entry descriptionexists
- ‘1’href
- the relative path to the disassembly page for the entrylabel
- the ASM label of the first instruction in the entrylabels
- ‘1’ if any instructions in the entry have an ASM label, ‘0’ otherwiselocation
- the address of the entry as a decimal numberpage
- the MSB of the entry addresssize
- the size of the entry in bytestitle
- the title of the entrytype
- the block type of the entry (‘b’, ‘c’, ‘g’, ‘s’, ‘t’, ‘u’ or ‘w’)
To see the default map_entry
template, run the following command:
$ skool2html.py -r Template:map_entry
paragraph¶
The paragraph
template is the subtemplate used to format each paragraph in
the following items:
- memory map entry descriptions (on disassembly pages and memory map pages)
- mid-block comments and block end comments on disassembly pages
- entries on the ‘Bugs’, ‘Trivia’, ‘Pokes’, ‘Glossary’, ‘Graphic glitches’ and ‘Changelog’ pages
It contains the following identifier (in addition to the universal identifiers):
paragraph
- the text of the paragraph
To see the default paragraph
template, run the following command:
$ skool2html.py -r Template:paragraph
reference_entry¶
The reference_entry
template is the subtemplate used by the
Reference full-page template to format each entry on the ‘Bugs’,
‘Trivia’, ‘Pokes’, ‘Glossary’ and ‘Graphic glitches’ pages.
It contains the following identifiers (in addition to the universal identifiers):
contents
- replaced by the pre-formatted contents of the relevant [Bug:*:*], [Fact:*:*], [Poke:*:*], [Glossary:*] or [GraphicGlitch:*:*] sectionnum
- ‘1’ or ‘2’, depending on the order of the entry on the pagetitle
- the entry title
To see the default reference_entry
template, run the following command:
$ skool2html.py -r Template:reference_entry
reg¶
The reg
template is the subtemplate used by the #REG macro to format
a register name.
It contains the following identifier (in addition to the universal identifiers):
reg
- the register name (e.g. ‘HL’)
To see the default reg
template, run the following command:
$ skool2html.py -r Template:reg
stylesheet¶
The stylesheet
template is the subtemplate used by the full-page templates
to format each <link>
element for a CSS file in the head of a page.
It contains the following identifier (in addition to the universal identifiers):
href
- the relative path to the CSS file
To see the default stylesheet
template, run the following command:
$ skool2html.py -r Template:stylesheet
table¶
The table
template is used by the #TABLE macro to format a table.
It contains the following identifiers (in addition to the universal identifiers):
class
- the CSS class name for the tablem_table_row
- replaced by any number of copies of the table_row subtemplate
To see the default table
template, run the following command:
$ skool2html.py -r Template:table$
New in version 4.2.
table_cell¶
The table_cell
template is the subtemplate used by the table_row
template to format each non-header cell in the table row.
It contains the following identifiers (in addition to the universal identifiers):
class
- the CSS class name for the cellcolspan
- the number of columns spanned by the cellcontents
- the contents of the cellrowspan
- the number of rows spanned by the cell
To see the default table_cell
template, run the following command:
$ skool2html.py -r Template:table_cell
New in version 4.2.
table_header_cell¶
The table_header_cell
template is the subtemplate used by the
table_row template to format each header cell in the table row.
It contains the following identifiers (in addition to the universal identifiers):
colspan
- the number of columns spanned by the cellcontents
- the contents of the cellrowspan
- the number of rows spanned by the cell
To see the default table_header_cell
template, run the following command:
$ skool2html.py -r Template:table_header_cell
New in version 4.2.
table_row¶
The table_row
template is the subtemplate used by the table
template to format each row in the table.
It contains the following identifier (in addition to the universal identifiers):
cells
- replaced by one or more copies of the table_cell or table_header_cell subtemplate
To see the default table_row
template, run the following command:
$ skool2html.py -r Template:table_row
New in version 4.2.