From b35139f64486553a9ff9a8b8520b30ef11cb2904 Mon Sep 17 00:00:00 2001
From: Thomas Walker Lynch
Date: Tue, 13 Jan 2026 14:19:14 +0000
Subject: [PATCH] RT code reformatting progress pt
---
developer/document.zip | Bin 18174 -> 0 bytes
developer/document/Epimetheus.html | 272 ++---
developer/document/style/RT_code.js | 33 +-
developer/document/style/article.js | 112 +++
developer/document/style/article_generic.js | 44 -
developer/document/style/page.js | 49 -
developer/document/style/page_css.js | 46 -
developer/document/style/page_css_pn.js | 56 +-
.../document/style/paginate_by_element.js | 107 +-
.../{do_style.js => style_orchestrator.js} | 52 +-
developer/document/style/test_0.c | 8 +
developer/document/style/theme.js | 46 +
developer/document/style/theme_RT.js | 22 -
developer/document/style/utility.js | 32 +-
developer/document/test.html | 4 +-
developer/document/theory.html | 119 ---
shared/authored/doc.txt | 7 +
shared/authored/rt_fmt.py | 925 ++++++++++++++++++
shared/authored/test.py | 74 ++
shared/authored/test_0_expected.c | 12 +
shared/authored/test_0_in.c | 10 +
shared/authored/test_0_out.c | 10 +
shared/authored/test_1_expected.py | 8 +
shared/authored/test_1_in.py | 8 +
shared/authored/test_1_out.py | 8 +
25 files changed, 1509 insertions(+), 555 deletions(-)
delete mode 100644 developer/document.zip
create mode 100644 developer/document/style/article.js
delete mode 100644 developer/document/style/article_generic.js
delete mode 100644 developer/document/style/page.js
delete mode 100644 developer/document/style/page_css.js
rename developer/document/style/{do_style.js => style_orchestrator.js} (64%)
create mode 100644 developer/document/style/test_0.c
create mode 100644 developer/document/style/theme.js
delete mode 100644 developer/document/style/theme_RT.js
delete mode 100644 developer/document/theory.html
create mode 100644 shared/authored/doc.txt
create mode 100755 shared/authored/rt_fmt.py
create mode 100755 shared/authored/test.py
create mode 100644 shared/authored/test_0_expected.c
create mode 100644 shared/authored/test_0_in.c
create mode 100644 shared/authored/test_0_out.c
create mode 100644 shared/authored/test_1_expected.py
create mode 100644 shared/authored/test_1_in.py
create mode 100644 shared/authored/test_1_out.py
diff --git a/developer/document.zip b/developer/document.zip
deleted file mode 100644
index 8ba6b34adefe332a4daffce65827b5eabc7c142e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 18174
zcma)@b9~)f_V-V0vteVSNgCU>ZQC{)+qN1tc4M23jmBtEAfV8IpRZyz8qGg``TuWF033j!je(Puk+mb8k|GoUB<$SC?C0a;
z3IhNFor3@X{&S$n59yH)BG5`y!A4_*iPqgO5aJOuzs@5hwsa@H
z%z)P1;g2z9uo{_Ju>FR1QqZ$lrbm3v(y>Dgj*p`dOHYc8iTqL#^r2rB_z@FTqejSR
zD1N88=)`9|Gm$mwkUMbE<@R)~-6KmA9x&g{v1mtTAS$W3$M12TItbP){O-v22oyQg
zjx5p{mH=TsAt=CKBMXMETG-s?YiNdrjF;hYO_Bx$4lG)g)ZxI!QFlQSh8mZCz{pTe
z9Qy|}jYsuR9c)!Ty7NomiK-F4swlf~qJ+gFewgqct$4&koMr92b?4I`ptvGePwS#*$5b%=!5U
zHdu{bg&D}k`25@=|5%Q5e$<-PV!rlgZ;LYz2mm1eeL3pe7`o{=n>m>2n^~GUy6Kpj
z85$Z{|G6qJagEGy@qSyCRxw@H-SmipXD?wV6hNW2WZ$8FK#;raEH3w!)nc<9O_T4e
zTLgfjZ5f|%o{b(mR{)~e>&S^jLl9HICJmyA-@}R;z@}*DaWQG9+e85~gNx9(&Ns*(
zRXl_l_I}{&ab|yRn)*1-kt&^8i(aZZHq=ia30#35=u&N|e^Vm)mFd2TEvb(@en4M|
zj5|KD7K+y25>J9fjr=rlqv|-77(&{VtUVk5{4@!$rpaTAC?zituU_Xz^li0%%Ezvm
zwxjrn{^M+quiJrk38=h|B?5
zoWBVAY6<5^H6K4BDT}Jq42lmrXt))ei+G-;yU@65
zy1$ki5G#$QAawS169@o6^mfi;{XRQ}HadTtr+-d|{o84}@cW6HnWSN}%#1p){!9Vy
zPnfhUsolcGChA9XU?dQ39lGw%pIb;2o+(*IoVY0Zyy_wv+wzSz7_516=T*~n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
zi`G{wP@dP8Sc8-sy%3+cI5{`YGJ-4TZr~U$m}&M}E5zWkia+oqpC(X?>pk3LnTMkn
zUK<;;f|zW5|MqQ!#Xq)#;M7OU=M3JKw%p^K&)}45Thb{q9-{J+ipF7W-;+}vAj_TS9?i`@5(|5NV!
zU%t-oqQPJJn{PLbf8+mCLioo1DIxqX?B9i2zp{tkdguO){i|&2e^1TtYLH*?J&1pY
z|ED(O|Azn9KL20wq9}id|7X|#{|*1Iz39K|Cd(L
z|IPos3G!FIDE4psUt1#I@IPB3|I5nxyi1TMUrkXH
z|DCD78Xw;HKN}zZ3;*|G^RIkpvj52cv-JFC;%DjkznJ*F%=W7Z2g+Ye{8n^(qyH?r
z{TKT0S;AlG$PB;Gf5{oXaew9v{|oo`Y{swL?vKB6f6Z;Yk$>hkej~q$@84diZ$A!i
L
-
-
- Epimetheus: The Only Primitive
-
-
-
-
-
-
-
- Given
- The English language is a given, apparently.
-
- This discussion happens to appear in the context of a Python language
- implementation, though it applies equally as well to other languages.
-
-
- Symbol
- Definition
-
- We have a symbol instance factory. Each time the make
- method on the factory is called, the factory returns an instance of a
- distinct symbol.
-
-
-
- A symbol instance may be copied as though it were an integer. Thus, a
- common method for making a copy is assignment, e.g.,
- x = y , where y is a variable holding
- a symbol instance. After execution of the assignment, x
- will hold another instance of the symbol.
-
-
-
- Any two, or by transitivity, any number of, symbol instances can be
- compared for equality using an integer equality comparison:
- x == y . A comparison between symbol-holding variables
- will always return True or False .
-
-
-
- It follows that any two symbol instances directly returned from the
- factory will always equality compare to be False .
-
-
-
- An equivalence set of symbol instances is a functional representation of
- the symbol. The name of this set is yet another instance of said symbol.
- Thus, every instance of the symbol represents the symbol.
-
-
-
- Though symbol instances are integer-like for copy and equality compare,
- they are disallowed from being used with other integer operators.
- Symbols cannot be compared for greater-than or less-than; they cannot be
- incremented, added, nor subtracted, etc.
-
-
- Distinctness Across Contexts
-
- If a symbol persists across contexts, such as across scopes or processes,
- it must remain distinct from all other symbols as it enters into those
- new processes or contexts.
-
-
-
- In this implementation, we meet this constraint by using a global symbol
- factory and by explicitly disallowing a symbol from being used outside
- the process it was made in.
-
-
- Object
- Definition
-
- The term "Python object" refers to anything that can or could
- appear in Python code and could be associated with a symbol. This
- includes symbols themselves.
-
-
-
- A symbol is associated with an object using a Python dictionary. The
- symbol is the key, and the object is that thing which is "looked up"
- via said key.
-
-
- Path
- Individual Path
-
- In the TTCA, we provided a formal definition for a "tape." A tape has a
- leftmost cell, one or more "in-between" cells, and a rightmost cell.
- A "path" is a special case of a tape with additional constraints.
-
-
-
- Each cell of a path holds a symbol. The leftmost cell is called the
- destination . The reader might have expected the path
- to go from left to right, but such a definition would run into a problem,
- as left-to-right traversal might not ever end.
-
-
-
- Think about it this way: you are sitting in a pub of an inn, and a
- stranger walks in. Though you know the stranger's current destination,
- you might not know where he came from.
-
-
-
- All cells of the path to the right of the destination cell are called
- "the way." If we were to drop the leftmost cell from the tape, then we
- would find "the way," if it exists, to be another tape.
-
-
- Discrete Function
-
- Consider another tape where each cell holds a path. If we compare all
- paths on said tape and find that no two identical "ways" lead to
- different destinations, we call said tape a discrete function .
-
-
-
- destination = f(way)
-
-
-
- This notation is possible because the same way always leads to the given
- destination.
-
-
-
-
-
-
+
+
+ Epimetheus: The Only Primitive
+
+
+
+
+
+
+
+ Given
+ The English language is a given, apparently.
+
+ This discussion happens to appear in the context of a Python language
+ implementation, though it applies equally as well to other languages.
+
+
+ Symbol
+ Definition
+
+ We have a symbol instance factory. Each time the make
+ method on the factory is called, the factory returns an instance of a
+ distinct symbol.
+
+
+
+ A symbol instance may be copied as though it were an integer. Thus, a
+ common method for making a copy is assignment, e.g.,
+ x = y , where y is a variable holding
+ a symbol instance. After execution of the assignment, x
+ will hold another instance of the symbol.
+
+
+
+ Any two, or by transitivity, any number of, symbol instances can be
+ compared for equality using an integer equality comparison:
+ x == y . A comparison between symbol-holding variables
+ will always return True or False .
+
+
+
+ It follows that any two symbol instances directly returned from the
+ factory will always equality compare to be False .
+
+
+
+ An equivalence set of symbol instances is a functional representation of
+ the symbol. The name of this set is yet another instance of said symbol.
+ Thus, every instance of the symbol represents the symbol.
+
+
+
+ Though symbol instances are integer-like for copy and equality compare,
+ they are disallowed from being used with other integer operators.
+ Symbols cannot be compared for greater-than or less-than; they cannot be
+ incremented, added, nor subtracted, etc.
+
+
+ Distinctness Across Contexts
+
+ If a symbol persists across contexts, such as across scopes or processes,
+ it must remain distinct from all other symbols as it enters into those
+ new processes or contexts.
+
+
+
+ In this implementation, we meet this constraint by using a global symbol
+ factory and by explicitly disallowing a symbol from being used outside
+ the process it was made in.
+
+
+ Object
+ Definition
+
+ The term "Python object" refers to anything that can or could
+ appear in Python code and could be associated with a symbol. This
+ includes symbols themselves.
+
+
+
+ A symbol is associated with an object using a Python dictionary. The
+ symbol is the key, and the object is that thing which is "looked up"
+ via said key.
+
+
+ Path
+ Individual Path
+
+ In the TTCA, we provided a formal definition for a "tape." A tape has a
+ leftmost cell, one or more "in-between" cells, and a rightmost cell.
+ A "path" is a special case of a tape with additional constraints.
+
+
+
+ Each cell of a path holds a symbol. The leftmost cell is called the
+ destination . The reader might have expected the path
+ to go from left to right, but such a definition would run into a problem,
+ as left-to-right traversal might not ever end.
+
+
+
+ Think about it this way: you are sitting in a pub of an inn, and a
+ stranger walks in. Though you know the stranger's current destination,
+ you might not know where he came from.
+
+
+
+ All cells of the path to the right of the destination cell are called
+ "the way." If we were to drop the leftmost cell from the tape, then we
+ would find "the way," if it exists, to be another tape.
+
+
+ Discrete Function
+
+ Consider another tape where each cell holds a path. If we compare all
+ paths on said tape and find that no two identical "ways" lead to
+ different destinations, we call said tape a discrete function .
+
+
+
+ destination = f(way)
+
+
+
+ This notation is possible because the same way always leads to the given
+ destination.
+
+
+
+
+
+
diff --git a/developer/document/style/RT_code.js b/developer/document/style/RT_code.js
index e5c8266..6c6e232 100644
--- a/developer/document/style/RT_code.js
+++ b/developer/document/style/RT_code.js
@@ -1,6 +1,6 @@
/*
- Processes tags using StyleRT utilities.
- Instrumented with token-based debugging.
+ Processes tags.
+ Uses the central config or CSS variables from the theme.
*/
function RT_code() {
const RT = window.StyleRT;
@@ -9,30 +9,20 @@ function RT_code() {
debug.log('RT_code', 'Starting render cycle.');
- // 1. Fetch Theme
- const theme = RT.active_theme ? RT.active_theme() : {};
- const accent = theme.accent || 'gold';
-
- // 2. Physics
const metrics = U.measure_ink_ratio('monospace');
- document.querySelectorAll('rt-code').forEach((el, index) => {
+ // Scoped Selector: find code blocks anywhere, but styling relies on inheritance
+ document.querySelectorAll('rt-code').forEach((el) => {
el.style.fontFamily = 'monospace';
- // Analysis
- const is_block = U.is_block_content(el);
- const parentStyle = window.getComputedStyle(el.parentElement);
- const parentColor = parentStyle.color;
+ // Check context for accent color (CSS Variable fallback)
+ const computed = window.getComputedStyle(el);
+ const accent = computed.getPropertyValue('--rt-accent').trim() || 'gold';
- // Physics
+ const is_block = U.is_block_content(el);
+ const parentColor = computed.color;
const is_text_light = U.is_color_light(parentColor);
- if (index === 0) {
- // Always log the first one if token is active, for sanity check
- debug.log('RT_code', `Sample #0: Parent Color "${parentColor}" -> Detect Light? ${is_text_light}`);
- }
-
- // Visuals
const alpha = is_block ? 0.08 : 0.15;
const overlay = is_text_light ? `rgba(255,255,255,${alpha})` : `rgba(0,0,0,${alpha})`;
const text_color = is_text_light ? '#ffffff' : '#000000';
@@ -42,17 +32,18 @@ function RT_code() {
if (is_block) {
el.style.display = 'block';
el.style.whiteSpace = 'pre';
- el.style.fontSize = (parseFloat(parentStyle.fontSize) * metrics.ratio * 0.95) + 'px';
+ el.style.fontSize = (parseFloat(computed.fontSize) * metrics.ratio * 0.95) + 'px';
el.style.padding = '1.2rem';
el.style.margin = '1.5rem 0';
el.style.borderLeft = `4px solid ${accent}`;
el.style.color = 'inherit';
} else {
el.style.display = 'inline';
- const exactPx = parseFloat(parentStyle.fontSize) * metrics.ratio * 1.0;
+ const exactPx = parseFloat(computed.fontSize) * metrics.ratio * 1.0;
el.style.fontSize = exactPx + 'px';
el.style.padding = '0.1rem 0.35rem';
el.style.borderRadius = '3px';
+ // Vertical align fix for inline code
const offsetPx = metrics.baseline_diff * (exactPx / 100);
el.style.verticalAlign = offsetPx + 'px';
el.style.color = text_color;
diff --git a/developer/document/style/article.js b/developer/document/style/article.js
new file mode 100644
index 0000000..36e07b6
--- /dev/null
+++ b/developer/document/style/article.js
@@ -0,0 +1,112 @@
+/*
+ Generic Article Typography.
+ Applies container settings and injects scoped CSS for standard HTML tags
+ (H1-H6, P, Blockquote) within the article.
+*/
+(function(){
+ const RT = window.StyleRT = window.StyleRT || {};
+
+ RT.article = function() {
+ RT.config = RT.config || {};
+
+ // Default Configuration
+ RT.config.article = {
+ font_family: '"Noto Sans JP", sans-serif'
+ ,line_height: "1.75" // Increased slightly for readability
+ ,font_size: "16px"
+ ,max_width: "800px"
+ ,margin: "0 auto"
+ };
+
+ const conf = RT.config.article;
+ const article_seq = document.querySelectorAll("RT-article");
+ const theme = (RT.config.theme) ? RT.config.theme : { accent: 'gray', text: 'black' };
+
+ // HURDLE
+ if (RT.debug) RT.debug.log('selector', `RT.article found ${article_seq.length} elements.`);
+ if(article_seq.length === 0) {
+ if(RT.debug) RT.debug.error('selector', 'CRITICAL: No tags found.');
+ return;
+ }
+
+ // 1. Apply Container Styles
+ article_seq.forEach( (article) =>{
+ const style = article.style;
+ style.display = "block";
+ style.fontFamily = conf.font_family;
+ style.fontSize = conf.font_size;
+ style.lineHeight = conf.line_height;
+ style.maxWidth = conf.max_width;
+ style.margin = conf.margin;
+ style.backgroundColor = "transparent";
+
+ // Ensure the accent color is available as a variable here too
+ style.setProperty("--rt-accent", theme.accent);
+ });
+
+ // 2. Inject Child Typography (The missing piece)
+ const style_id = 'rt-article-typography';
+ if (!document.getElementById(style_id)) {
+ const style_el = document.createElement('style');
+ style_el.id = style_id;
+
+ // We explicitly scope these to rt-article to avoid breaking the rest of the page
+ style_el.textContent = `
+ rt-article h1 {
+ font-size: 2.2em;
+ font-weight: 700;
+ margin-top: 1.5em;
+ margin-bottom: 0.5em;
+ border-bottom: 2px solid var(--rt-accent);
+ padding-bottom: 0.2em;
+ line-height: 1.2;
+ }
+
+ rt-article h2 {
+ font-size: 1.7em;
+ font-weight: 600;
+ margin-top: 1.5em;
+ margin-bottom: 0.5em;
+ color: var(--rt-accent);
+ line-height: 1.3;
+ }
+
+ rt-article h3 { font-size: 1.4em; margin-top: 1.2em; margin-bottom: 0.5em; }
+
+ rt-article p {
+ margin-bottom: 1.2em;
+ text-align: justify;
+ hyphens: auto;
+ }
+
+ rt-article blockquote {
+ border-left: 4px solid var(--rt-accent);
+ margin: 1.5em 0;
+ padding: 0.5em 0 0.5em 1.2em;
+ font-style: italic;
+ background: rgba(125,125,125, 0.05);
+ }
+
+ rt-article ul, rt-article ol {
+ margin-bottom: 1.2em;
+ padding-left: 2em;
+ }
+
+ rt-article li {
+ margin-bottom: 0.3em;
+ }
+
+ /* Links inside articles */
+ rt-article a {
+ color: var(--rt-accent);
+ text-decoration: none;
+ border-bottom: 1px dotted var(--rt-accent);
+ }
+ rt-article a:hover {
+ border-bottom: 1px solid var(--rt-accent);
+ }
+ `;
+ document.head.appendChild(style_el);
+ }
+ };
+})();
diff --git a/developer/document/style/article_generic.js b/developer/document/style/article_generic.js
deleted file mode 100644
index 92a8418..0000000
--- a/developer/document/style/article_generic.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Sets basic document theme colors and dimensions.
- Groups parameters into semantic dictionaries (layout, typography).
-*/
-window.StyleRT = window.StyleRT || {};
-
-window.StyleRT.article_generic = function() {
- const RT = window.StyleRT;
- const theme = RT.active_theme ? RT.active_theme() : {};
-
- // 1. Theme and Global Flow
- const body = document.body;
- body.style.backgroundColor = theme.background || 'hsl(0, 0%, 0%)';
- body.style.color = theme.foreground || 'hsl(42, 100%, 80%)';
- body.style.fontFamily = '"Noto Sans JP", sans-serif';
- body.style.display = 'block';
- body.style.margin = '0';
- body.style.padding = '0';
-
- // 2. Settings: Layout Group
- RT.layout = {
- page_height: 1056,
- page_width: '50rem',
- page_margin: '4rem auto 6rem auto',
- page_padding: '3rem'
- };
-
- // 3. Settings: Typography Group
- RT.typography = {
- orphans: 4,
- widows: 4,
- h1_align: 'center'
- };
-
- // 4. Apply Dimensions and Alignment
- body.style.maxWidth = RT.layout.page_width;
- body.style.margin = '0 auto';
-
- const h1s = document.querySelectorAll('h1');
- h1s.forEach(h => {
- h.style.textAlign = RT.typography.h1_align;
- h.style.width = '100%';
- });
-};
diff --git a/developer/document/style/page.js b/developer/document/style/page.js
deleted file mode 100644
index 91f6ff1..0000000
--- a/developer/document/style/page.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Defines the appearance of the container via a CSS block.
- Uses high-contrast offsets to ensure the drop shadow is visible.
-*/
-window.StyleRT = window.StyleRT || {};
-
-window.StyleRT.page = function() {
- const RT = window.StyleRT;
- const style_id = 'rt-page-styles';
-
- if (!document.getElementById(style_id)) {
- const style_el = document.createElement('style');
- style_el.id = style_id;
- style_el.textContent = `
- html, body {
- background-color: #1a1a1a !important;
- margin: 0;
- padding: 0;
- }
-
- rt-page {
- display: block;
- max-width: 50rem;
- width: 100%;
-
- /* Increased vertical margin to prevent shadow clipping */
- margin: 4rem auto 6rem auto;
- padding: 3rem;
- box-sizing: border-box;
- background-color: hsl(0, 0%, 0%);
- border: 1px solid hsl(42, 100%, 50%);
-
- /* 1. The Offset Drop Shadow (Bottom-Right)
- 2. The Ambient Glow (Centered)
- */
- box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.9),
- 0 0 15px hsl(42, 100%, 15%);
-
- height: auto;
-
- /* Ensure the shadow isn't cut off by the container's edges */
- overflow: visible;
- }
- `;
- document.head.appendChild(style_el);
- }
-
- if (RT.debug) RT.debug.log('style', 'CSS block updated with 15px shadow offset.');
-};
diff --git a/developer/document/style/page_css.js b/developer/document/style/page_css.js
deleted file mode 100644
index 015fdfe..0000000
--- a/developer/document/style/page_css.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Defines the appearance of the container.
- Enforces a fixed height to create a uniform book-like appearance.
-*/
-window.StyleRT = window.StyleRT || {};
-
-window.StyleRT.page = function() {
- const RT = window.StyleRT;
- const style_id = 'rt-page-styles';
-
- // Use the established page height or a standard 11-inch default
- const fixed_height = RT.page_height ? `${RT.page_height}px` : '1056px';
-
- if (!document.getElementById(style_id)) {
- const style_el = document.createElement('style');
- style_el.id = style_id;
- style_el.textContent = `
- html, body {
- background-color: #1a1a1a !important;
- margin: 0;
- padding: 0;
- }
-
- rt-page {
- display: block;
- max-width: 50rem;
- width: 100%;
- margin: 4rem auto 6rem auto;
- padding: 3rem;
- box-sizing: border-box;
- background-color: hsl(0, 0%, 0%);
- border: 1px solid hsl(42, 100%, 50%);
-
- /* Fixed Height Enforcement */
- height: ${fixed_height};
- overflow: visible;
-
- /* The Gold Leaf Glow */
- filter: drop-shadow(8px 12px 40px hsl(44, 96%, 47%));
- }
- `;
- document.head.appendChild(style_el);
- }
-
- if (RT.debug) RT.debug.log('style', `Fixed height of ${fixed_height} applied to all pages.`);
-};
diff --git a/developer/document/style/page_css_pn.js b/developer/document/style/page_css_pn.js
index 3e5dc08..938da34 100644
--- a/developer/document/style/page_css_pn.js
+++ b/developer/document/style/page_css_pn.js
@@ -1,47 +1,61 @@
/*
Defines the appearance of the container.
- Uses grouped settings from RT.layout and RT.typography.
*/
window.StyleRT = window.StyleRT || {};
window.StyleRT.page = function() {
const RT = window.StyleRT;
- const style_id = 'rt-page-styles';
- // Safety fallbacks in case article_generic failed or hasn't run
- const layout = RT.layout || { page_height: 1056, page_margin: '4rem auto' };
- const typo = RT.typography || { orphans: 4, widows: 4 };
+ // Fallback accent
+ const theme_accent = (RT.config && RT.config.theme) ? RT.config.theme.accent : "hsl(42, 100%, 50%)";
+
+ RT.config = RT.config || {};
+
+ // Fix: Define defaults independently
+ const defaults = {
+ width: "100%"
+ ,height: "1056px"
+ ,padding: "3rem"
+ ,margin: "4rem auto"
+ ,border_color: theme_accent
+ ,shadow: "drop-shadow(8px 12px 40px hsl(44, 96%, 47%))"
+ };
+
+ // Fix: MERGE defaults into existing config.
+ // This allows overrides but prevents empty objects from causing "undefined" CSS.
+ RT.config.page = Object.assign({}, defaults, RT.config.page || {});
+ const conf = RT.config.page;
+ const style_id = 'rt-page-styles';
+
if (!document.getElementById(style_id)) {
const style_el = document.createElement('style');
style_el.id = style_id;
style_el.textContent = `
- body {
+ rt-article {
counter-reset: rt-page-counter;
}
rt-page {
display: block;
- max-width: ${layout.page_width || '50rem'};
- width: 100%;
- margin: ${layout.page_margin};
- padding: ${layout.page_padding || '3rem'};
+ width: ${conf.width};
+ height: ${conf.height};
+ margin: ${conf.margin};
+ padding: ${conf.padding};
box-sizing: border-box;
- background-color: hsl(0, 0%, 0%);
- border: 1px solid hsl(42, 100%, 50%);
- height: ${layout.page_height}px;
+
+ background-color: black;
+
+ /* These should now be populated correctly */
+ border: 1px solid ${conf.border_color};
position: relative;
- filter: drop-shadow(8px 12px 40px hsl(44, 96%, 47%));
+ filter: ${conf.shadow};
+
counter-increment: rt-page-counter;
+ overflow: hidden;
}
- rt-page p {
- orphans: ${typo.orphans};
- widows: ${typo.widows};
- }
-
- /* Brightened Page Counter */
rt-page::after {
content: "Page " counter(rt-page-counter);
position: absolute;
@@ -50,7 +64,7 @@ window.StyleRT.page = function() {
font-family: "Noto Sans JP", sans-serif;
font-size: 0.9rem;
font-weight: bold;
- color: hsl(42, 100%, 75%); /* Much brighter, high-contrast gold */
+ color: ${conf.border_color};
}
`;
document.head.appendChild(style_el);
diff --git a/developer/document/style/paginate_by_element.js b/developer/document/style/paginate_by_element.js
index 997383b..e085148 100644
--- a/developer/document/style/paginate_by_element.js
+++ b/developer/document/style/paginate_by_element.js
@@ -1,63 +1,72 @@
/*
Layout Paginator: paginate_by_element
- Measures heights and groups elements.
- Logic: Headings must stay with the element immediately following them.
*/
window.StyleRT = window.StyleRT || {};
window.StyleRT.paginate_by_element = function() {
const RT = window.StyleRT;
- const body = document.body;
- const limit = RT.layout.page_height || 1000;
-
- const elements = Array.from(body.children).filter(el =>
- el.tagName !== 'SCRIPT' && el.tagName !== 'STYLE' && el.tagName !== 'RT-PAGE'
- );
-
- const pages = [];
- let current_batch = [];
- let current_h = 0;
-
- const get_el_height = (el) => {
- const rect = el.getBoundingClientRect();
- const style = window.getComputedStyle(el);
- const margin = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
- return rect.height + margin;
- };
-
- for (let i = 0; i < elements.length; i++) {
- const el = elements[i];
- const h = get_el_height(el);
- const is_heading = /H[1-6]/.test(el.tagName);
-
- // Lookahead: If this is a heading, check the next element too
- let total_required_h = h;
- if (is_heading && i + 1 < elements.length) {
- total_required_h += get_el_height(elements[i + 1]);
- }
+
+ // Fix: Read safely without overwriting the config namespace
+ const page_conf = (RT.config && RT.config.page) ? RT.config.page : {};
+ const page_height_limit = page_conf.height_limit || 1000;
+
+ const article_seq = document.querySelectorAll("RT-article");
+
+ // HURDLE: Error if no articles found to paginate
+ if(article_seq.length === 0) {
+ RT.debug.error('pagination', 'No elements found. Pagination aborted.');
+ return;
+ }
+
+ article_seq.forEach( (article) => {
+ const raw_elements = Array.from(article.children).filter(el =>
+ !['SCRIPT', 'STYLE', 'RT-PAGE'].includes(el.tagName)
+ );
+
+ if(raw_elements.length === 0) return;
+
+ const pages = [];
+ let current_batch = [];
+ let current_h = 0;
- // If the element (or heading + next) exceeds limit, start new page
- if (current_h + total_required_h > limit && current_batch.length > 0) {
- pages.push(current_batch);
- current_batch = [];
- current_h = 0;
+ const get_el_height = (el) => {
+ const rect = el.getBoundingClientRect();
+ const style = window.getComputedStyle(el);
+ const margin = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
+ return (rect.height || 0) + (margin || 0);
+ };
+
+ for (let i = 0; i < raw_elements.length; i++) {
+ const el = raw_elements[i];
+ const h = get_el_height(el);
+ const is_heading = /^H[1-6]/.test(el.tagName);
+
+ let total_required_h = h;
+ if (is_heading && i + 1 < raw_elements.length) {
+ total_required_h += get_el_height(raw_elements[i + 1]);
+ }
+
+ if (current_h + total_required_h > page_height_limit && current_batch.length > 0) {
+ pages.push(current_batch);
+ current_batch = [];
+ current_h = 0;
+ }
+
+ current_batch.push(el);
+ current_h += h;
}
- current_batch.push(el);
- current_h += h;
- }
+ if (current_batch.length > 0) pages.push(current_batch);
- if (current_batch.length > 0) pages.push(current_batch);
+ article.innerHTML = '';
+
+ pages.forEach( (list, index) => {
+ const page_el = document.createElement('rt-page');
+ page_el.id = `page-${index+1}`;
+ list.forEach(item => page_el.appendChild(item));
+ article.appendChild(page_el);
+ });
- // Rebuild DOM
- const assets = Array.from(document.querySelectorAll('script, style'));
- body.innerHTML = '';
- pages.forEach(list => {
- const page_el = document.createElement('rt-page');
- list.forEach(item => page_el.appendChild(item));
- body.appendChild(page_el);
+ if (RT.debug) RT.debug.log('pagination', `Article paginated into ${pages.length} pages.`);
});
- assets.forEach(a => body.appendChild(a));
-
- if (RT.debug) RT.debug.log('layout', `Pagination complete: ${pages.length} pages.`);
};
diff --git a/developer/document/style/do_style.js b/developer/document/style/style_orchestrator.js
similarity index 64%
rename from developer/document/style/do_style.js
rename to developer/document/style/style_orchestrator.js
index 72de517..5239707 100644
--- a/developer/document/style/do_style.js
+++ b/developer/document/style/style_orchestrator.js
@@ -1,41 +1,36 @@
/*
Master Loader & Orchestrator for StyleRT.
- Loads utility.js first to ensure infrastructure (RT.debug) exists.
+ Renamed from do_style.js
*/
window.StyleRT = window.StyleRT || {};
-window.StyleRT.do_style = function() {
+window.StyleRT.style_orchestrator = function() {
const RT = window.StyleRT;
const modules = [
- 'style/theme_RT.js',
- 'style/RT_term.js',
- 'style/RT_math.js',
- 'style/RT_code.js',
- 'style/article_generic.js',
- 'style/RT_TOC.js',
- 'style/paginate.js',
+ // Theme & Semantics
+ 'style/theme.js',
+ 'style/RT_term.js',
+ 'style/RT_math.js',
+ 'style/RT_code.js',
+ 'style/article.js', // Renamed from article_generic
+ 'style/RT_TOC.js',
+
+ // Layout & Pagination
'style/paginate_by_element.js',
- // 'style/page.js',
- // 'style/page_css.js',
- 'style/page_css_pn.js',
+ 'style/page_css_pn.js',
+
+ // Visibility
'style/body_visibility_visible.js'
];
- // 1. Bootloader: Get the utility/logger in place first
+ // 1. Bootloader
const utility = document.createElement('script');
utility.src = 'style/utility.js';
- utility.onload = () => {
- // Infrastructure ready; begin module sequence
- load_next(0);
- };
-
- utility.onerror = () => {
- console.error("StyleRT: Critical failure - utility.js missing.");
- };
-
+ utility.onload = () => { load_next(0); };
+ utility.onerror = () => { console.error("StyleRT: Critical failure - utility.js missing."); };
document.head.appendChild(utility);
// 2. The Chain Loader
@@ -44,10 +39,7 @@ window.StyleRT.do_style = function() {
run_style();
return;
}
-
const src = modules[index];
-
- // Accessing the property live so it doesn't matter if it was set late
if (RT.debug) RT.debug.log('style', `Loading: ${src}`);
const script = document.createElement('script');
@@ -64,12 +56,13 @@ window.StyleRT.do_style = function() {
const run_style = () => {
RT.debug.log('style', 'Starting Phase 1: Setup & Semantics');
- if(RT.article_generic) RT.article_generic();
+ // Naming Convention: RT.
+ if(RT.theme) RT.theme(); // Was theme
+ if(RT.article) RT.article(); // Was article_generic
if(RT.RT_term) RT.RT_term();
if(RT.RT_math) RT.RT_math();
if(RT.RT_code) RT.RT_code();
- // Hand off to MathJax task queue
if (window.MathJax && MathJax.Hub && MathJax.Hub.Queue) {
RT.debug.log('style', 'MathJax detected. Queueing layout tasks...');
MathJax.Hub.Queue(["Typeset", MathJax.Hub], continue_style);
@@ -82,9 +75,12 @@ window.StyleRT.do_style = function() {
const continue_style = () => {
RT.debug.log('style', 'Starting Phase 2: Layout & Reveal');
+ // Debug: Dump the config to see what values we are using
+ if(RT.debug) RT.debug.log('config', JSON.stringify(RT.config || {}, null, 2));
+
if(RT.RT_TOC) RT.RT_TOC();
if(RT.paginate_by_element) RT.paginate_by_element();
- if(RT.page) RT.page();
+ if(RT.page) RT.page(); // Defined in page_css_pn.js
if(RT.body_visibility_visible) RT.body_visibility_visible();
RT.debug.log('style', 'Style execution complete.');
diff --git a/developer/document/style/test_0.c b/developer/document/style/test_0.c
new file mode 100644
index 0000000..1c7cadc
--- /dev/null
+++ b/developer/document/style/test_0.c
@@ -0,0 +1,8 @@
+// test_0_in.c
+void func(int a,int b){
+ if(check(a,b)){
+ for(int i=0; i<10; i++){
+ if(i==0) return;
+ }
+ }
+}
diff --git a/developer/document/style/theme.js b/developer/document/style/theme.js
new file mode 100644
index 0000000..1302951
--- /dev/null
+++ b/developer/document/style/theme.js
@@ -0,0 +1,46 @@
+/*
+ Global Theme Definition.
+ Applies colors and variables to the document Root and Body.
+*/
+( function(){
+ const RT = window.StyleRT = window.StyleRT || {};
+
+ RT.theme = function(){
+ RT.config = RT.config || {};
+
+ // Define the Palette
+ RT.config.theme = {
+ background: "#1a1a1a"
+ ,text: "#f0f0f0"
+ ,accent: "#ffcc00"
+ ,code_bg: "#2d2d2d"
+ };
+
+ const palette = RT.config.theme;
+ const html = document.documentElement;
+ const body = document.body;
+
+ if(RT.debug) RT.debug.log('style' ,'Applying Global Theme to Body/HTML.');
+
+ // 1. Reset the "White Border" (Browser Defaults)
+ // Browsers often add an 8px margin to body. We must zero this out.
+ html.style.margin = "0";
+ html.style.padding = "0";
+ body.style.margin = "0";
+ body.style.padding = "0";
+
+ // Ensure the background covers the whole viewport, even if content is short
+ body.style.minHeight = "100vh";
+
+ // 2. Apply Palette
+ // We paint both HTML and BODY to ensure over-scroll areas match.
+ html.style.backgroundColor = palette.background;
+ body.style.backgroundColor = palette.background;
+ body.style.color = palette.text;
+
+ // 3. Set Global CSS Variables
+ // These will now be available anywhere in the document.
+ body.style.setProperty("--rt-accent" ,palette.accent);
+ body.style.setProperty("--rt-code-bg" ,palette.code_bg);
+ };
+} )();
diff --git a/developer/document/style/theme_RT.js b/developer/document/style/theme_RT.js
deleted file mode 100644
index 63fcec5..0000000
--- a/developer/document/style/theme_RT.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- Provides the color palette and layout layout for the RT theme.
- Registers itself as the active system theme upon load.
-*/
-function theme_RT(){
- return {
- name: 'theme_RT', // Identity
-
- // Palette
- background: 'hsl(0, 0%, 0%)',
- foreground: 'hsl(42, 100%, 80%)',
- accent: 'hsl(42, 100%, 50%)',
- faded: 'hsl(42, 100%, 20%)',
- highlight: 'hsl(42, 100%, 90%)',
- };
-}
-
-window.StyleRT = window.StyleRT || {};
-window.StyleRT.theme_RT = theme_RT;
-
-// Generic Interface: Set this as the current active theme
-window.StyleRT.active_theme = theme_RT;
diff --git a/developer/document/style/utility.js b/developer/document/style/utility.js
index 337bdcc..ae64e97 100644
--- a/developer/document/style/utility.js
+++ b/developer/document/style/utility.js
@@ -1,17 +1,16 @@
/*
General utilities for the StyleRT library.
- Includes:
- 1. Token-based Debugging System
- 2. Physics (Ink metrics, Color analysis)
- 3. Text Analysis
*/
window.StyleRT = window.StyleRT || {};
// --- DEBUG SYSTEM ---
window.StyleRT.debug = {
- // Add tokens here to enable specific logs: 'RT_code', 'layout', 'style', 'layout'
- active_tokens: new Set(['style' ,'layout' ,'pagination']),
+ // ENABLE 'selector', 'config', and 'error' so we aren't flying blind!
+ active_tokens: new Set([
+ 'style', 'layout', 'pagination',
+ 'selector', 'config', 'error'
+ ]),
log: function(token, message) {
if (this.active_tokens.has(token)) {
@@ -25,14 +24,17 @@ window.StyleRT.debug = {
}
},
- // Helper to enable/disable on the fly from console
+ // New: Always log errors regardless of token, but tag them
+ error: function(token, message) {
+ console.error(`[StyleRT:${token}] CRITICAL:`, message);
+ },
+
enable: function(token) { this.active_tokens.add(token); console.log(`Enabled: ${token}`); },
disable: function(token) { this.active_tokens.delete(token); console.log(`Disabled: ${token}`); }
};
// --- UTILITIES ---
window.StyleRT.utility = {
-
// --- FONT PHYSICS ---
measure_ink_ratio: function(target_font, ref_font = null) {
const debug = window.StyleRT.debug;
@@ -59,7 +61,7 @@ window.StyleRT.utility = {
const target_m = get_metrics(target_font);
const ratio = ref_m.ascent / target_m.ascent;
- debug.log('layout', `Ink Ratio calculated: ${ratio.toFixed(3)}`);
+ // debug.log('layout', `Ink Ratio calculated: ${ratio.toFixed(3)}`);
return {
ratio: ratio,
@@ -76,16 +78,14 @@ window.StyleRT.utility = {
const numbers = color_string.match(/\d+/g);
if (numbers && numbers.length >= 3) {
const lightness = parseInt(numbers[2]);
- const is_light = lightness > 50;
- debug.log('color_layout', `HSL ${color_string} -> Lightness ${lightness}% -> ${is_light ? 'LIGHT' : 'DARK'}`);
- return is_light;
+ return lightness > 50;
}
}
// 2. RGB Check
const rgb = color_string.match(/\d+/g);
if (!rgb) {
- debug.warn('color_layout', `Failed to parse color: "${color_string}". Defaulting to Light.`);
+ // debug.warn('color_layout', `Failed to parse color: "${color_string}". Defaulting to Light.`);
return true;
}
@@ -93,13 +93,9 @@ window.StyleRT.utility = {
const g = parseInt(rgb[1]);
const b = parseInt(rgb[2]);
const luma = (r * 299 + g * 587 + b * 114) / 1000;
- const is_light = luma > 128;
-
- debug.log('color_layout', `RGB (${r},${g},${b}) -> Luma ${luma.toFixed(1)} -> ${is_light ? 'LIGHT' : 'DARK'}`);
- return is_light;
+ return luma > 128;
},
- // --- TEXT ANALYSIS ---
is_block_content: function(element) {
return element.textContent.trim().includes('\n');
}
diff --git a/developer/document/test.html b/developer/document/test.html
index d25effb..cb87322 100644
--- a/developer/document/test.html
+++ b/developer/document/test.html
@@ -88,9 +88,9 @@ x = y
return hypergraph.lookup(way)
-
+
-
- Given
-
- The English language is a given, apparently.
-
- This discussion happens to appear in the context of a Python language implementation, though it applies equally as well to other languages.
-
- Symbol
-
- Definition
-
- We have a symbol instance factory. Each time the `make` method on the factory is called, the factory returns an instance of a distinct symbol.
-
- A symbol instance may be copied as through it were an integer. Thus, a common method for making a copy is assignment, e.g. 'x = y', where y is a variable holding a symbol instance, and after execution of the assignment, x will hold another instance of the symbol.
-
- Any two, or by transitivity, any number of, symbol instances can be compared for equality using an integer equality comparison, e.g. 'x == y'. A comparison between symbol holding variables will always return `True` or `False`.
-
- It follows that any two symbol instances directly returned from the factory will always equality compare to be `False`.
-
- An equivalence set of symbol instances is a functional representation of the symbol. The name of this set is yet another instance of said symbol. Thus ever instance of the symbol represents the symbol.
-
- Though symbol instances are integer like for copy and equality compare, they are disallowed from being used with other integer operators. As examples, symbols can not be compared for greater-than or less-than, they can not be incremented, nor added, nor subtracted, etc.
-
- The only allowed operators for symbol instances are integer equality compare, integer not-equal compare, and integer copy.
-
- Distinctness Across Contexts
-
- If a symbol persist across contexts, such as across scopes, or across processes, it must remain distinct from all other symbols as it enters into those new processes or contexts.
-
- There are many possible schemes or constraint sets for meeting this requirement.
-
- In this implementation we meet this constraint by using a global symbol factory, and by explicitly disallowing a symbol from being used outside the process it was made in.
-
- Named Symbols
-
- It is common for a programmer to make a dictionary that has one-to-one association of a symbol and a Python string object, i.e. a `string`, as programmers like to be able to refer to each symbol by its 'name'.
-
- Object
-
- Definition
-
- The term 'Python object' is anything that can appear in Python code, or could appear in Python code, and could be associated with a symbol.
-
- A symbol is associated with an object using a Python dictionary. The symbol is the key, and the object is that thing which is 'looked up' via that key.
-
- Path
-
- Individual Path
-
- In the TTCA we provided formal definition for a 'tape'. A tape has a leftmost cell, one or more in between cells, and a rightmost cell. For a one cell tape, the one cell is both the leftmost cell and the rightmost cell. A zero cell tape either does not exist, or it is a higher order 'placeholder' concept.
-
- A 'path' is special case of a 'tape', as defined in the TTCA, with some additional constraints.
-
- Each cell of a path holds a symbol.
-
- The leftmost cell is called the 'destination'. The reader might have expected the path to go from left to right on the tape, in the same order that a person reads the words on a printed page, but such a definition would run into a problem, as left to right traversal of a tape might not ever end. Think about it this way, you are sitting in a pub of an inn, and a stranger walks in. Though you know the stranger's current destination, you might now know where he came from.
-
- All the cells of the path to the right of the destination cell, are called 'the way'. If we were to drop the leftmost cell from the tape, then we would find 'the way' if it exists, to be another tape.
-
- Discrete Function
-
- Consider another tape where each cell holds a path.
-
- If when we compare all the paths on said tape, and find that no two identical ways lead to different destinations, we can call said tape a 'discrete function'. It is 'discrete' because of the type of math we are doing here, with symbols and tape cells. It is a 'function' because a given way never has two destinations.
-
- Topologically it gives us a satisfying feeling that a given 'way' never leads to different destinations. If it were otherwise we would feel to be in a sci-fi movie.
-
- Note, however, there can exist more than one way to reach the same destination, though there might not be. Again, this fits our intuition of real paths.
-
- Because functions embody our intuition about the space we live in, they occur often when doing real world modeling. There is also something about this quality that makes discrete functions useful in computer science.
-
- A common notation for a function is:
- ```
- destination = f(way)
- ```
-
- This notation is possible because the same way always leads to the given destination.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/developer/document/theory.html b/developer/document/theory.html
deleted file mode 100644
index d2a2c54..0000000
--- a/developer/document/theory.html
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-