From: Thomas Walker Lynch Date: Tue, 4 Aug 2026 13:44:49 +0000 (+0000) Subject: dictionary compress / shrink wrap working X-Git-Url: https://git.reasoningtechnology.com/%27%20%20%20window.RT.dirpr_library%20%20%20%27/%27%20%20%20key%20%20%20%27?a=commitdiff_plain;h=fc774cafd4a645f89364307593ae4268c4ba9eee;p=RT-Style dictionary compress / shrink wrap working --- diff --git a/developer/authored/Manuscript.copy/Document/manual.html b/developer/authored/Manuscript.copy/Document/manual.html index 2080181..a20912e 100644 --- a/developer/authored/Manuscript.copy/Document/manual.html +++ b/developer/authored/Manuscript.copy/Document/manual.html @@ -47,28 +47,17 @@ Top-level semantic environments. These boundaries enforce the rendering constraints for all scoped content, encompassing both custom RT elements and standard HTML tags.

- - - - - - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·article>Standard technical document architecture.
<RT·memo>Strict print layout constraint (6.5-inch width boundary, serif typography, monochrome execution).
<RT·book>Multi-chapter architecture. (Implementation pending; currently routes through the article layout).
+ + + Standard technical document architecture. + + + Strict print layout constraint (6.5-inch width boundary, serif typography, monochrome execution). + + + Multi-chapter architecture. (Implementation pending; currently routes through the article layout). + +

Article manuscript

@@ -98,319 +87,201 @@

Decorators

- - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·term> - Semantic anchor for technical terminology. Formats the initial occurrence and registers the element ID for index generation. Authors must mark all occurrences of the term.
-
- Attributes:
- id: (Default: Auto-generated slug, e.g., "def-my-term") -
-
<RT·neologism> - Semantic anchor for a novel term coined within the current document boundaries. Registers the ID for index generation.
-
- Attributes:
- id: (Default: Auto-generated slug, e.g., "def-neo-my-term") -
-
+ + + Semantic anchor for technical terminology. Formats the initial occurrence and registers the element ID for index generation. Authors must mark all occurrences of the term.
+
+
Attributes:
+ id: (Default: Auto-generated slug, e.g., "def-my-term") +
+
+ + Semantic anchor for a novel term coined within the current document boundaries. Registers the ID for index generation.
+
+
Attributes:
+ id: (Default: Auto-generated slug, e.g., "def-neo-my-term") +
+
+

Layout environments

Context-aware formatting blocks. Valid inline or as distinct structural segments.

- - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·code>Code span or pre-formatted code block. Automatically dedents structural alignment spaces and inherits theme boundaries.
<RT·math>Injects mathematical layout evaluation via the MathJax rendering engine.
+ + + Code span or pre-formatted code block. Automatically dedents structural alignment spaces and inherits theme boundaries. + + + Injects mathematical layout evaluation via the MathJax rendering engine. + +

Grid environments

These structures map semantic data into an internal Cartesian grid state prior to CSS projection, isolating the markup from physical layout mechanics.

- - - - - - - - - - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·grid> - Base Cartesian coordinate grid. Projects child <RT·e> elements based on explicitly defined x and y index geometries.
-
- Attributes:
- model: Projection strategy. "html-grid-direct" or "html-grid-transpose". (Default: "html-grid-direct")
- major: Carriage return trigger direction. "x" or "y". (Default: "x")
-
- Child Element: <RT·e>
- x: Target x-axis index or index range (e.g., "0-2", where 2 is the maximum index extent).
- y: Target y-axis index or index range.
- type: Decoration type. "data", "x-label", "y-label", or "name". (Default: "data") -
-
<RT·dictionary> - Two-column associative layout mapping explicitly declared keys to their scoped definitions.
-
- Attributes:
- key: Header text for the identifier column.
- definition: Header text for the data payload column.
-
- Child Element: <RT·entry>
- key: The term being defined. The scoped HTML of the entry forms the definition value. -
-
<RT·relation> - Relational algebra layout formatter. Enforces multi-line text wrapping limits, calculates row distinction boundaries, and restricts column headers to the tuple scope.
-
- Attributes:
- layout-intention: "row-tuple" or "column-tuple". (Default: "row-tuple")
-
- Child Elements:
- <RT·tuple-meta>: Container for <RT·e> elements establishing the tuple field headers.
- <RT·tuple>: Data tuple boundaries. Permits an <RT·name> identifier, followed by <RT·e> field values. -
-
<RT·matrix> - Linear algebraic matrix representation. Enforces rigid structural padding, brackets mathematical delimiters, and suppresses the exterior grid coordinate layout.
-
- Attributes:
- layout-intention: "row-vector" or "column-vector". (Default: "row-vector")
-
- Child Elements:
- <RT·vector-meta>: Container for <RT·label> elements defining the vector components/basis.
- <RT·vector>: Vector boundary. Permits an <RT·name> identifier, followed by <RT·e> scalar values. -
-
+ + + Base Cartesian coordinate grid. Projects child <RT·e> elements based on explicitly defined x and y index geometries.
+
+
Attributes:
+ model: Projection strategy. "html-grid-direct" or "html-grid-transpose". (Default: "html-grid-direct")
+ major: Carriage return trigger direction. "x" or "y". (Default: "x")
+
+ Child Element: <RT·e>
+ x: Target x-axis index or index range (e.g., "0-2", where 2 is the maximum index extent). Default when no y value, is to auto increment, default with a y value is to reset to 0.
+ y: Target y-axis index or index range. Default is to keep the prior value.
+ type: Decoration type. "data", "x-label", "y-label", or "name". (Default: "data") +
+
+ + Two-column associative layout mapping explicitly declared keys to their scoped definitions.
+
+
Attributes:
+ key: Header text for the identifier column.
+ definition: Header text for the data payload column.
+
+ Child Element: <RT·entry>
+ key: The term being defined. The scoped HTML of the entry forms the definition value. +
+
+ + Relational algebra layout formatter. Enforces multi-line text wrapping limits, calculates row distinction boundaries, and restricts column headers to the tuple scope.
+
+
Attributes:
+ layout-intention: "row-tuple" or "column-tuple". (Default: "row-tuple")
+
+ Child Elements:
+ <RT·tuple-meta>: Describes the components rather than providing them. E.g.<RT·label> provides a component label.
+ <RT·tuple>: Container for components. Each <RT·name> is taken as a first component. If there is more than one <RT·name>, they are concatenated with a newline separator. If any tupple has a <RT·name>, then the name column is reserved. Missing names in the name column are given a visual placeholder value of '•'. Component data values are given in <RT·e> tags, these are taken in the order they occur. +
+
+ + Linear algebraic matrix representation. Enforces rigid structural padding, brackets mathematical delimiters, and suppresses the exterior grid coordinate layout.
+
+
Attributes:
+ layout-intention: "row-vector" or "column-vector". (Default: "row-vector")
+
+ Child Elements:
+ <RT·vector-meta>: Describes the components rather than providing them. E.g. <RT·label> provides a component label.
+ <RT·vector>: Container for components. Each <RT·name> is taken as a first component. If there is more than one <RT·name>, they are concatenated with a newline separator. If any vector has a <RT·name>, then the name column is reserved. Missing names in the name column are given a visual placeholder value of '•'. Component scalar values are given in <RT·e> tags, these are taken in the order they occur. +
+
+

Generators

Data-injection nodes. These elements do not wrap content; execution is governed strictly by the attributes provided.

- - - - - - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·title> - Constructs the primary document header block.
-
- Attributes:
- title: (Default: "Untitled Document")
- author: (Default: None)
- date: (Default: None)
- copyright: (Default: None) -
-
<RT·TOC> - Compiles an automated Table of Contents by scanning the document's header hierarchy depth.
-
- Attributes:
- level: Target heading index "N" or range "A-B". (Default: Context-aware. Scans backward for the nearest heading H(N) and evaluates targets at H(N+1)). -
-
<RT·endnotes>Generates the numeric list of endnote payloads. Replaces all inline endnote citations with bracketed indices.
- + + + Constructs the primary document header block.
+
+
Attributes:
+ title: (Default: "Untitled Document")
+ author: (Default: None)
+ date: (Default: None)
+ copyright: (Default: None) +
+
+ + Compiles an automated Table of Contents by scanning the document's header hierarchy depth.
+
+
Attributes:
+ level: Target heading index "N" or range "A-B". (Default: Context-aware. Scans backward for the nearest heading H(N) and evaluates targets at H(N+1)). +
+
+ + Generates the numeric list of endnote payloads. Replaces all inline endnote citations with bracketed indices. + +

Counters

Counters operate as explicit state machines. Initialization requires a unique identifier. Execution evaluates scope depth and increments the state. The layout engine maintains a single internal representation but maps it to multiple visual styles upon request.

- - - - - - - - - - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·Counter·make> - Initializes the named counter state machine.
-
- Attributes:
- counter: Required state identifier.
- style: Single style string, or comma-separated hierarchy defining formats at each nesting depth. The terminal format applies to all deeper nestings. Valid arguments: "NaturalNumber", "CountingNumber", "Roman", "roman", "Alpha", "alpha". The "outline" flag translates to a standard mixed document array. (Default: "NaturalNumber")
- on-first-step: The initial base value. (Default: "0")
- separator: String appended between depth sequence levels. (Default: ".")
- separator-placement: "embedded" or "embedded-after". (Default: "embedded")
- mode: "scoped" (content embedded between count boundaries receives the parent scope's value) or "milestone" (state carries forward sequentially irrespective of lexical depth). -
-
- <RT·Counter·step> - - Increments the counter block. Executing a step inside an existing step boundary pushes the state to the next depth index.
-
- Attributes:
- counter: Required state identifier. -
-
<RT·Counter·snapshot> - Clones the active count variables into the lookup dictionary. Snapshot processing operates independently of the layout pass, allowing global retrieval regardless of physical placement.
-
- Attributes:
- counter: Required state identifier.
- snapshot: Required dictionary assignment key. -
-
<RT·Counter·read> - Retrieves the stored snapshot and projects it as innerHTML.
-
- Attributes:
- snapshot: Required dictionary assignment key.
- key: Sub-state query property. Resolves dot-notation parameters (e.g., "count.status", "count.list"). Querying "count" triggers the style formatter and separator join parameters. (Default: "count") -
-
+ + + + Initializes the named counter state machine.
+
+
Attributes:
+ counter: Required state identifier.
+ style: Single style string, or comma-separated hierarchy defining formats at each nesting depth. The terminal format applies to all deeper nestings. Valid arguments: "NaturalNumber", "CountingNumber", "Roman", "roman", "Alpha", "alpha". The "outline" flag translates to a standard mixed document array. (Default: "NaturalNumber")
+ on-first-step: The initial base value. (Default: "0")
+ separator: String appended between depth sequence levels. (Default: ".")
+ separator-placement: "embedded" or "embedded-after". (Default: "embedded")
+ mode: "scoped" (content embedded between count boundaries receives the parent scope's value) or "milestone" (state carries forward sequentially irrespective of lexical depth). +
+
+ + Increments the counter block. Executing a step inside an existing step boundary pushes the state to the next depth index.
+
+
Attributes:
+ counter: Required state identifier. +
+
+ + Clones the active count variables into the lookup dictionary. Snapshot processing operates independently of the layout pass, allowing global retrieval regardless of physical placement.
+
+
Attributes:
+ counter: Required state identifier.
+ snapshot: Required dictionary assignment key. +
+
+ + Retrieves the stored snapshot and projects it as innerHTML.
+
+
Attributes:
+ snapshot: Required dictionary assignment key.
+ key: Sub-state query property. Resolves dot-notation parameters (e.g., "count.status", "count.list"). Querying "count" triggers the style formatter and separator join parameters. (Default: "count") +
+
+

Cross reference

A two-pass structural mechanism bridging logical content with its physically paginated layout geometry.

- - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·Note·write> - Registers the scoped content and its finalized layout page index into the reference dictionary.
-
- Attributes:
- key: Required mapping identifier. -
-
<RT·Note·read> - Queries the reference dictionary and injects the output.
-
- Attributes:
- key: Target mapping identifier.
- field: Data extraction parameter. Valid targets are "content" (the original HTML payload) or "page" (the evaluated layout page number). (Default: "content") -
-
+ + + + Registers the scoped content and its finalized layout page index into the reference dictionary.
+
+
Attributes:
+ key: Required mapping identifier. +
+
+ + Queries the reference dictionary and injects the output.
+
+
Attributes:
+ key: Target mapping identifier.
+ field: Data extraction parameter. Valid targets are "content" (the original HTML payload) or "page" (the evaluated layout page number). (Default: "content") +
+
+

Annotation

- - - - - - - - - - - - - - - - - -
TagDescription & Arguments
- <RT·endnote> - Marks the scoped content for extraction and placement in the endnotes block.
- <RT·footnote> - Marks the scoped content for layout relocation to the active page's footer.
+ + + Marks the scoped content for extraction and placement in the endnotes block. + + + Marks the scoped content for layout relocation to the active page's footer. + +

Pagination

- - - - - - - - - - - - - - - - - -
TagDescription & Arguments
<RT·page>Physical document boundary generated dynamically by the paginator. Not for manual insertion.
<RT·page-break>Explicit directive terminating the current <RT·page> evaluation and pushing subsequent data to the next boundary.
+ + + Physical document boundary generated dynamically by the paginator. Not for manual insertion. + + + Explicit directive terminating the current <RT·page> evaluation and pushing subsequent data to the next boundary. + +

Memo environment

@@ -423,36 +294,18 @@

Book specific tags

- - - - - - - - - - - - - -
TagDescription & Arguments
<RT·chapter>Chapter delimiter. Triggers an immediate page break, escalates to H1 typography, and writes a top-level node to the TOC sequence. Retains any authored class attributes.
+ + + Chapter delimiter. Triggers an immediate page break, escalates to H1 typography, and writes a top-level node to the TOC sequence. Retains any authored class attributes. + +

Global widgets

- - - - - - - - - - - - - -
TagDescription & Arguments
<RT·theme-selector>Injects a floating overlay permitting real-time CSS theme execution. Writes the selection to the browser's localStorage.
+ + + Injects a floating overlay permitting real-time CSS theme execution. Writes the selection to the browser's localStorage. + + diff --git a/developer/authored/Manuscript.copy/Element/code.js b/developer/authored/Manuscript.copy/Element/code.js index 91953a0..9358906 100644 --- a/developer/authored/Manuscript.copy/Element/code.js +++ b/developer/authored/Manuscript.copy/Element/code.js @@ -37,7 +37,7 @@ for(let i = 0; i < nodes.length; i++){ const el = nodes[i]; - const is_block = U.Dom.is_block_content(el); + const is_block = el.innerHTML.includes('\n'); const computed = window.getComputedStyle(el); const is_text_light = U.Color.is_light(config.content_main); diff --git a/developer/authored/Manuscript.copy/Element/grid.js b/developer/authored/Manuscript.copy/Element/grid.js index 9077bf7..376f0dc 100644 --- a/developer/authored/Manuscript.copy/Element/grid.js +++ b/developer/authored/Manuscript.copy/Element/grid.js @@ -3,11 +3,11 @@ Compiles semantic tabular structures into a Cartesian GridState. */ - - (function() { if (!window.RT) return; + const debug = window.RT.Debug || { log: function(){}, warn: function(){}, error: function(){} }; + class GridState { constructor() { this.cells = []; @@ -116,8 +116,9 @@ function render_model_html_dictionary(container_node, grid_state, options, config) { const wrapper = document.createElement('div'); wrapper.style.display = 'grid'; - wrapper.style.gridAutoColumns = 'max-content'; - wrapper.style.justifyContent = 'start'; + wrapper.style.gridTemplateColumns = 'max-content auto'; + wrapper.style.width = 'fit-content'; + wrapper.style.maxWidth = '100%'; wrapper.className = `RT_grid_container ${options.css_class || ''}`; wrapper.style.margin = '1.5rem 0'; @@ -165,6 +166,7 @@ } RT.Element.add(function process_grids() { + if(debug.log) debug.log('grid', 'Processing grid structures'); // 1. Native Grid document.querySelectorAll('RT·grid').forEach(node => { @@ -238,6 +240,8 @@ // 3. Relation document.querySelectorAll('RT·relation').forEach(node => { + if(debug.log) debug.log('grid', ' node evaluated'); + const state = new GridState(); const layout_intent = node.getAttribute('layout-intention') || 'row-tuple'; const model = layout_intent === 'column-tuple' ? 'html-grid-transpose' : 'html-grid-direct'; diff --git a/developer/authored/Manuscript.copy/Element/math.js b/developer/authored/Manuscript.copy/Element/math.js index b17c8a0..e41283f 100644 --- a/developer/authored/Manuscript.copy/Element/math.js +++ b/developer/authored/Manuscript.copy/Element/math.js @@ -3,38 +3,70 @@ */ (function(){ - if(!window.RT) return; - const apply_style = function(el, is_block, config) { - el.style.display = is_block ? 'block' : 'inline'; + if(!window.RT){ + console.error("RT not defined. Was RT Manuscript make run?"); + return; + } + if(!window.RT.Element){ + console.error("RT.Element not defined. Was the stage manager run?"); + return; + } + + window.MathJax = window.MathJax || {}; + + window.MathJax.startup = { + typeset: false + }; + + window.MathJax.options = { + // Disable the screen-reader block to prevent duplicate text rendering + enableAssistiveMml: false + }; + + window.MathJax.svg = { + // Force paths to draw directly instead of referencing a global cache + fontCache: 'none' }; const scan_tags = function(){ - const config = window.RT.layout_config || {}; - const math_elements = Array.from(document.querySelectorAll('RT·math')); + const debug = window.RT.Debug || { log: function(){} }; + if(debug.log) debug.log('math' ,'Processing math tags directly'); + + const math_elements = Array.from(document.querySelectorAll('RT·math, rt·math')); if(math_elements.length === 0) return; - if(!window.MathJax || typeof window.MathJax.tex2svg !== 'function') return; + if(!window.MathJax || typeof window.MathJax.tex2svg !== 'function'){ + console.error("MathJax not loaded or synchronous tex2svg unavailable."); + return; + } math_elements.forEach(el => { - const is_block = el.parentElement.tagName === 'DIV' || - el.textContent.includes('\n') || - el.parentElement.childNodes.length === 1; + const is_block = el.innerHTML.includes('\n'); - apply_style(el, is_block, config); + if (is_block) { + el.style.display = 'block'; + el.style.textAlign = 'center'; + el.style.margin = '1rem 0'; + } else { + el.style.display = 'inline'; + } const raw_math = el.textContent; - const svg_node = window.MathJax.tex2svg(raw_math, {display: is_block}); + const svg_node = window.MathJax.tex2svg(raw_math ,{display: is_block}); + // Safety net: Strip the block manually if the config fails to catch it const assistive = svg_node.querySelector('mjx-assistive-mml'); if(assistive) assistive.remove(); el.innerHTML = ''; el.appendChild(svg_node); }); + }; RT.load('Math/mathjax_svg'); RT.Element.add(scan_tags); + })();