
1. Document
1.1. Record & record-level tags
1.1.1. <record [recordId="recordId" customHeading="true" level="level type" class="level type" ]>
1.1.1.1. <RD:[ID,{recordId}],[CH],[{level type}]>
1.1.2. <record-attribute groups="group" />
1.1.2.1. <GR:"group">
1.1.3. <record-attribute level="level" class="level" />
1.1.3.1. <LV:"level">
1.1.4. </span type="recordHeading">
1.1.4.1. <EH>
1.1.5. <span type="recordHeading">
1.1.5.1. <BH>
1.2. Popups, Notes, Named popups
1.2.1. <popupLink [ title="title" width="x" height="y" ] >
1.2.1.1. <PW:["Title",x,y]>
1.2.2. <note [ title="title" width="x" height="y" ] >
1.2.2.1. <NT:["Title",x,y]>
1.2.3. <end-popup-contents/>
1.2.3.1. <LT>
1.2.4. NOTE: Folio Views has an export bug, which sometimes merges following tags into the popup/note. These are placed in the extraTags="" attribute.
1.2.5. </note>
1.2.5.1. </NT>
1.2.6. </popupLink>
1.2.6.1. </PW>
1.2.7. Named Popups are Definition tags
1.3. Paragraphs
1.3.1. <paragraph-attribute style="css pairs" />
1.3.1.1. AP|BP|JU|BR|KT|KN|LH|LS|LW|SD|TS|IN|KN|KT
1.3.2. <paragraph-attribute class="styleName" />
1.3.2.1. <PS:"Style">
1.3.3. <parabreak />
1.3.3.1. <HR>
1.3.4. <br />
1.3.4.1. <CR>
1.4. Character styles
1.4.1. <span type="bold|italic|hidden|strikeout|underline|condensed|outline|shadow|font-family|font-size|background-color|foreground-color|subsuperscript" style="css-equivalent">
1.4.1.1. BD, IT, HD, SO, UN, CD, OU, SH, FT, PT, BC, FC, SB, SP, SS
1.4.2. </span type="bold|italic|hidden|strikeout|underline|condensed|outline|shadow|font-family|font-size|background-color|foreground-color|subsuperscript">
1.4.2.1. Closing BD, IT, HD, SO, UN, CD, OU, SH, FT, PT, BC, FC, SB, SP, SS
1.5. Fields
1.5.1. <span type="field name" class="field name">
1.5.1.1. <FD:"field name">
1.5.2. </span type="field name">
1.5.2.1. </FD:"field name">
1.6. Character style applications
1.6.1. <span type="characterstyle" class="style name">
1.6.1.1. <CS:"style name">
1.6.2. </span type="characterstyle">
1.6.2.1. </CS>
1.7. Highlighter applications
1.7.1. <span type="highlighter" class="style name">
1.7.1.1. <PN:"style name">
1.7.2. </span type="highlighter">
1.7.2.1. </PN>
1.8. Folio entities
1.8.1. Character references
1.8.1.1. —
1.8.1.1.1. <CH:$97>
1.8.1.2. —
1.8.1.2.1. <CH:151>
1.8.2. 	
1.8.2.1. <TB>
1.8.3.
1.8.3.1. <HS>
1.9. Bookmarks and Jump destinations
1.9.1. <bookmark name="bookmark name" />
1.9.1.1. <BK:"bookmark name">
1.9.2. <bookmark name="_jump destination" />
1.9.2.1. <JD:"jump destination">
1.10. Proximity tokens
1.10.1. <se />
1.10.1.1. <SE>
1.10.2. <pp />
1.10.2.1. <PP>
1.11. Tables
1.11.1. </table>
1.11.1.1. </TA>
1.11.2. </td>
1.11.2.1. </CE> (rare)
1.11.3. </tr>
1.11.3.1. </RO> (rare)
1.11.4. <table colWidths="4.3,5,3" cellspacing="0" style="looots of css">
1.11.4.1. <TA:3,4.3,5,3,[paragraph opts and more]> The first number is the column count. If 0, columns are auto-sized.
1.11.5. <td style="lots" [rowspan="x" colspan="y" columnIsHeader="true"] >
1.11.5.1. <CE:MD:x,MR,y,HC,SD:shade,BR...etc>
1.11.6. <tr [rowIsHeader="true"]>
1.11.6.1. <RO[:HE]>
1.12. Objects
1.12.1. <obj name="My Photo Name" type="folio|ole" style="width:x;height:y;border:opts;background-color:black;" />
1.12.1.1. <OB:FO|OL,width,height,SD:shadow,BR:bordder opts>
1.13. Links
1.13.1. </link>
1.13.2. UL|QL|PL|OL|PX|WW|JL|EN|DL|ML
1.13.3. <link ... >
1.13.3.1. Finish docs
1.14. Printing tokens
1.14.1. <pagebreak />
1.14.1.1. <PB>
2. Use tab to create a child, enter for sibling. Del deletes.
3. Irrelevant
3.1. <!-- <UX:user, info, etc> -->
3.1.1. <UX:user, info, etc>
3.2. <!-- <UL:user link info> -->
3.2.1. <UL:user link info>
3.3. <!-- </UL> -->
3.3.1. </UL>
4. Definition (root record)
4.1. replaceDefinition
4.1.1. RP+, RP (true)
4.1.2. RP- (false)
4.1.3. Every definition tag gets the attribute parsed and removed from the end. If present, the replaceDefinition="" attr is added to the token, regardless of type.
4.2. Tags that support child elements. Only opening tags are shown, but closing tags are translated with the same attributes.
4.2.1. <infobase-meta type=\"header\">
4.2.1.1. <HE>
4.2.2. <infobase-meta type=\"footer\">
4.2.2.1. <FO>
4.2.3. <infobase-meta type=\"author\">
4.2.3.1. <AU>
4.2.4. <infobase-meta type=\"abstract\">
4.2.4.1. <AS>
4.2.5. <infobase-meta type=\"remark\">
4.2.5.1. <RM>
4.2.6. <infobase-meta type=\"subject\">
4.2.6.1. <SU>
4.2.7. Ditto for all closing tags. (</SU>, </RM>, </AS>, </AU>, </FO>, </HE>
4.2.8. Generate codes. These can only be used inside these tags.
4.2.8.1. <!-- GP|GT|GD|GM|GI|GA|GF|GQ -->
4.2.8.1.1. <GP|GT|GD|GM|GI|GA|GF|GQ>
4.2.8.2. Generate page number, current time, date, last modified, title, author, filename, current query.
4.2.9. Most support all child "Document" elements. Except records..
4.3. Self-closing tags
4.3.1. <infobase-meta type=\"revision-date\" content="revision date" />
4.3.1.1. <RE:"revision date">
4.3.2. <infobase-meta type="title" content="infobase title" />
4.3.2.1. <TT:"Infobase title">
4.3.3. <infobase-meta type=\"version\" data="Folio" filetype="FFF|DEF" version="X.X.X" />
4.3.3.1. <VI:Folio, File Type, Version Number>
4.3.4. <infobase-meta type=\"levels\" content="Book,Section,Chapter,Heading 1,Heading 2,Heading 3" />
4.3.4.1. <LN:Book,Section,Chapter,"Heading 1","Heading 2","Heading 3">
4.3.5. style-def
4.3.5.1. <style-def type="highlighter" class="highlighter name" style="css" />
4.3.5.1.1. <PD:"highlighter name",OPTS..>
4.3.5.2. <style-def type="level" class="level name" style="css" />
4.3.5.2.1. <LE:"level name",OPTS...>
4.3.5.3. <style-def type="paragraph" class="style name" style="css" />
4.3.5.3.1. <PA:"paragraph style name", OPTS...>
4.3.5.4. <style-def type="character-style" class="style name" style="css" />
4.3.5.4.1. <ST:CS,"character style name",OPTS...>
4.3.5.5. <style-def type="link" class="style name" style="css" />
4.3.5.5.1. <ST:LK:"link style name",OPTS...>
4.3.5.6. <style-def type="field" class="field name" fieldType="text|date|time|integer|decimal" [format="field format"] [indexOptions="TF,|PF,|TE,|NO,|PR,|DT,|FP,|SW", style="" />
4.3.5.6.1. <FE:"field name", Field Type (TX|DT|TM|IR|FP), [ "Field Format" ], [ IX:Index Options (multiple allowed, comma-delim) ], OPTS...>
4.3.6. <object-def name="object name" src="path" type="folio|data-link|ole|class-object" [ handler="Bitmap|Metafile|HyperGraphics|Picture" mime="mime-type" | version="2.0" | className="class name" ] [OLE options: linked="true" iconOnly="true"] />
4.3.6.1. <OD:FO:"Object name", Object Handler, "File Name>
4.3.6.2. <OD:DL,"Object name", "MIME type", "File Name">
4.3.6.3. <OD:OL,"Object name", Version,"File Name", LI, IC>
4.3.6.4. <OD:CL:"Object name", Class Name, "File Name">
4.4. <!-- HL|QT|RC|WP|TP -->
4.4.1. Hit list, Query Template, Reconcile Shadow File, Wallpaper, Title Page
4.4.2. HL|QT|RC|WP|TP (options not shown, but there are many for each)
4.5. Named Popup Definitions
4.5.1. <namedPopup title="title" [ width="x" height="y ] >
4.5.1.1. <DP:"Title",[x,y]>
4.6. </namedPopup>
4.6.1. </DP>
5. Both
5.1. <!-- -->
5.1.1. <CM></CM>
5.1.2. Comments coming from folio are encoded. "--" is converted to --
5.2. Text
5.2.1. Text and < > ' " & <<
5.2.2. Special chars < > ' " & are encoded in the text, but not split into separate tokens. Don't know what is happing to <<. Make unit test