From: Thomas Walker Lynch Date: Tue, 23 Jun 2026 10:53:58 +0000 (+0000) Subject: docs working X-Git-Url: https://git.reasoningtechnology.com/?a=commitdiff_plain;h=d34e3b37280dfd9fe31ed841505a29939984c165;p=RT-Style docs working --- diff --git a/administrator/document/RT-Style_locator.js b/administrator/document/RT-Style_locator.js new file mode 100644 index 0000000..4ded0e8 --- /dev/null +++ b/administrator/document/RT-Style_locator.js @@ -0,0 +1,37 @@ +/* + We have four scenarios + + immediate - used in the RT-style distribution itself (authored, consummer, staged) + direct - used in the RT-style project itself, but not in the distribution + indirect - the version all Harmony projects use + URL_only - always pulls style through a URL, a webserver must be present + +*/ + +window.RT = window.RT || {}; + +(function() { + const project_name = "RT-Style"; + const path = window.location.pathname; + const project_root_index = path.indexOf('/' + project_name + '/'); + + if (project_root_index !== -1) { + // substring(0, x) excludes the trailing slash. We must prepend it to the payload. + const absolute_project_root = path.substring(0, project_root_index + project_name.length + 1); + window.RT.dirpr_library = absolute_project_root + "/consumer/made/Manuscript"; + } else { + // Fallback for when served via local Python HTTP daemon from the project root + window.RT.dirpr_library = "../consumer/made/Manuscript"; + } + + document.write(' + diff --git a/administrator/tool/deploy_internal_locators.py b/administrator/tool/deploy_internal_locators.py new file mode 100644 index 0000000..90311a7 --- /dev/null +++ b/administrator/tool/deploy_internal_locators.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +import sys +import os +import stat +import shutil +from pathlib import Path + +def deploy_internal_locators(locator_dir_path): + locator_dir = Path(locator_dir_path) + if not locator_dir.is_dir(): + print(f"Error: Locator directory not found at {locator_dir_path}") + sys.exit(1) + + immediate_js = locator_dir / "immediate.js" + direct_js = locator_dir / "direct.js" + + if not immediate_js.exists() or not direct_js.exists(): + print("Error: Source locator files missing in the specified directory.") + sys.exit(1) + + repo_home = Path(os.environ.get("REPO_HOME", ".")) + IGNORED_DIRS = {".git", "scratchpad", "consumer"} + + for root, dirs, files in os.walk(repo_home): + # Prune ignored directories in place to prevent descending into them + dirs[:] = [d for d in dirs if d not in IGNORED_DIRS] + + current_path = Path(root) + if current_path.name.lower() == "document": + target_file = current_path / "RT-Style_locator.js" + + # Evaluate the path to determine the correct structural locator + if "developer/authored/Manuscript" in current_path.as_posix(): + source_file = immediate_js + else: + source_file = direct_js + + # Eliminate permission denial on read-only consumer artifacts + if target_file.exists(): + target_file.chmod(target_file.stat().st_mode | stat.S_IWUSR) + + shutil.copyfile(source_file, target_file) + print(f"Copied {source_file.name} -> {target_file}") + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python3 deploy_internal_locators.py ") + sys.exit(1) + + deploy_internal_locators(sys.argv[1]) diff --git a/developer/authored/Manuscript.copy/Document/RT-Style_locator.js b/developer/authored/Manuscript.copy/Document/RT-Style_locator.js new file mode 100644 index 0000000..07d9fb6 --- /dev/null +++ b/developer/authored/Manuscript.copy/Document/RT-Style_locator.js @@ -0,0 +1,29 @@ +/* + We have four scenarios + + immediate - used in the RT-style distribution itself (authored, consummer, staged) + direct - used in the RT-style project itself, but not in the distribution + indirect - the version all Harmony projects use + URL_only - always pulls style through a URL, a webserver must be present + +*/ + +window.RT = window.RT || {}; + +(function() { + // We are the style library, so ... + window.RT.dirpr_library = ".."; + + // 1. Inject the loader script + document.write(' + diff --git a/developer/authored/Manuscript.copy/Locator/URL-only.js b/developer/authored/Manuscript.copy/Locator/URL-only.js new file mode 100644 index 0000000..66e47d7 --- /dev/null +++ b/developer/authored/Manuscript.copy/Locator/URL-only.js @@ -0,0 +1,16 @@ +// RT-style_url_only.js +window.RT = window.RT || {}; + +(function() { + window.RT.dirpr_library = "https://style.ReasoningTechnology.com/Manuscript"; // Production URL + + document.write(' + diff --git a/developer/document/RT-code-format.html b/developer/document/RT-code-format.html index a162364..55eecb2 100644 --- a/developer/document/RT-code-format.html +++ b/developer/document/RT-code-format.html @@ -3,7 +3,7 @@ RT code format conventions - + diff --git a/developer/document/RT-style.js b/developer/document/RT-style.js deleted file mode 100644 index 34cfb22..0000000 --- a/developer/document/RT-style.js +++ /dev/null @@ -1,28 +0,0 @@ -// RT-style.js (Internal RT-style project router) -window.RT = window.RT || {}; - -(function() { - const project_name = "RT-style"; - const path = window.location.pathname; - const project_root_index = path.indexOf('/' + project_name + '/'); - - if (project_root_index !== -1) { - // substring(0, x) excludes the trailing slash. We must prepend it to the payload. - const absolute_project_root = path.substring(0, project_root_index + project_name.length + 1); - window.RT.dirpr_library = absolute_project_root + "/consumer/made/Manuscript"; - } else { - // Fallback for when served via local Python HTTP daemon from the project root - window.RT.dirpr_library = "../consumer/made/Manuscript"; - } - - document.write(' + diff --git a/developer/document/single-file_C-module-and-namespace.html b/developer/document/single-file_C-module-and-namespace.html index db0e657..61acebe 100644 --- a/developer/document/single-file_C-module-and-namespace.html +++ b/developer/document/single-file_C-module-and-namespace.html @@ -3,7 +3,7 @@ C modules, namespaces, and the build lifecycle - + diff --git a/document/RT-Style_locator.js b/document/RT-Style_locator.js new file mode 100644 index 0000000..4ded0e8 --- /dev/null +++ b/document/RT-Style_locator.js @@ -0,0 +1,37 @@ +/* + We have four scenarios + + immediate - used in the RT-style distribution itself (authored, consummer, staged) + direct - used in the RT-style project itself, but not in the distribution + indirect - the version all Harmony projects use + URL_only - always pulls style through a URL, a webserver must be present + +*/ + +window.RT = window.RT || {}; + +(function() { + const project_name = "RT-Style"; + const path = window.location.pathname; + const project_root_index = path.indexOf('/' + project_name + '/'); + + if (project_root_index !== -1) { + // substring(0, x) excludes the trailing slash. We must prepend it to the payload. + const absolute_project_root = path.substring(0, project_root_index + project_name.length + 1); + window.RT.dirpr_library = absolute_project_root + "/consumer/made/Manuscript"; + } else { + // Fallback for when served via local Python HTTP daemon from the project root + window.RT.dirpr_library = "../consumer/made/Manuscript"; + } + + document.write(' + diff --git a/document/RT-style.js b/document/RT-style.js deleted file mode 100644 index 34cfb22..0000000 --- a/document/RT-style.js +++ /dev/null @@ -1,28 +0,0 @@ -// RT-style.js (Internal RT-style project router) -window.RT = window.RT || {}; - -(function() { - const project_name = "RT-style"; - const path = window.location.pathname; - const project_root_index = path.indexOf('/' + project_name + '/'); - - if (project_root_index !== -1) { - // substring(0, x) excludes the trailing slash. We must prepend it to the payload. - const absolute_project_root = path.substring(0, project_root_index + project_name.length + 1); - window.RT.dirpr_library = absolute_project_root + "/consumer/made/Manuscript"; - } else { - // Fallback for when served via local Python HTTP daemon from the project root - window.RT.dirpr_library = "../consumer/made/Manuscript"; - } - - document.write(' + diff --git a/document/role-and-workflow_product-development.html b/document/role-and-workflow_product-development.html index 47c5b2a..2a4f655 100644 --- a/document/role-and-workflow_product-development.html +++ b/document/role-and-workflow_product-development.html @@ -3,7 +3,7 @@ Product development roles and workflow - + diff --git a/document/role-and-workflow_product-maintenance.html b/document/role-and-workflow_product-maintenance.html index e2c59db..1f76dd0 100644 --- a/document/role-and-workflow_product-maintenance.html +++ b/document/role-and-workflow_product-maintenance.html @@ -3,7 +3,7 @@ Product maintenance roles and workflow - + diff --git a/shared/document/RT-Style_locator.js b/shared/document/RT-Style_locator.js new file mode 100644 index 0000000..4ded0e8 --- /dev/null +++ b/shared/document/RT-Style_locator.js @@ -0,0 +1,37 @@ +/* + We have four scenarios + + immediate - used in the RT-style distribution itself (authored, consummer, staged) + direct - used in the RT-style project itself, but not in the distribution + indirect - the version all Harmony projects use + URL_only - always pulls style through a URL, a webserver must be present + +*/ + +window.RT = window.RT || {}; + +(function() { + const project_name = "RT-Style"; + const path = window.location.pathname; + const project_root_index = path.indexOf('/' + project_name + '/'); + + if (project_root_index !== -1) { + // substring(0, x) excludes the trailing slash. We must prepend it to the payload. + const absolute_project_root = path.substring(0, project_root_index + project_name.length + 1); + window.RT.dirpr_library = absolute_project_root + "/consumer/made/Manuscript"; + } else { + // Fallback for when served via local Python HTTP daemon from the project root + window.RT.dirpr_library = "../consumer/made/Manuscript"; + } + + document.write('