+++ /dev/null
-// RT-style.js
-window.RT = window.RT || {};
-
-// Configuration
-window.RT.project_name = "RT-style";
-window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-style/consumer/made";
-
-(function() {
- let style_path = window.RT.server_url;
-
- if (window.RT.project_name) {
- const path = window.location.pathname;
- const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
-
- if (project_root_index !== -1) {
- const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
- style_path = absolute_project_root + "/shared/linked-project/RT-style/consumer/made";
- } else {
- console.warn("RT-style: Cannot locate project root '/" + window.RT.project_name + "/'. Falling back to server URL.");
- }
- }
-
- window.RT.dirpr_library = style_path;
-
- // 1. Inject the loader script
- document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- // 2. Inject a secondary script block for the core dependencies.
- // This guarantees the browser waits for loader.js to finish parsing before executing.
- document.write(
- '<script>' +
- 'window.RT.load("Core/utility");' +
- 'window.RT.load("Core/block_visibility_during_layout");' +
- 'window.RT.load("Theme");' +
- 'window.RT.load("Element/theme_selector");' +
- '<\/script>'
- );
-})();
--- /dev/null
+/*
+ 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 || {};
+
+// --- Configuration ---
+// Define the consumer project name to allow dynamic local file:// calculation.
+window.RT.project_name = "Harmony";
+
+// Fallback URL when served over a network where the project root is not in the URI.
+window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript";
+
+(function() {
+ let style_path = window.RT.server_url;
+
+ if (window.RT.project_name) {
+ const path = window.location.pathname;
+ const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
+
+ if (project_root_index !== -1) {
+ // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
+ // We append the explicit forward slash before navigating into the shared boundary.
+ const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
+
+ // The symlink 'RT-Style' already drops us inside the 'consumer/' directory,
+ // so we proceed directly to 'made/Manuscript'.
+ style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript";
+ } else {
+ console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
+ }
+ }
+
+ window.RT.dirpr_library = style_path;
+
+ // 1. Inject the loader script
+ document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ // 2. Inject the secondary script block for core dependencies
+ document.write(
+ '<script>' +
+ 'window.RT.load("Core/utility");' +
+ 'window.RT.load("Core/block_visibility_during_layout");' +
+ 'window.RT.load("Theme");' +
+ 'window.RT.load("Element/theme_selector");' +
+ '<\/script>'
+ );
+})();
+++ /dev/null
-// RT-style.js (External consumer project router)
-window.RT = window.RT || {};
-
-// --- Configuration ---
-// Define the consumer project name to allow dynamic local file:// calculation.
-window.RT.project_name = "Harmony";
-
-// Fallback URL when served over a network where the project root is not in the URI.
-window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-style/consumer/made/Manuscript";
-
-(function() {
- let style_path = window.RT.server_url;
-
- if (window.RT.project_name) {
- const path = window.location.pathname;
- const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
-
- if (project_root_index !== -1) {
- // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
- // We append the explicit forward slash before navigating into the shared boundary.
- const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
- style_path = absolute_project_root + "/shared/linked-project/RT-style/consumer/made/Manuscript";
- } else {
- console.warn("RT-style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
- }
- }
-
- window.RT.dirpr_library = style_path;
-
- // 1. Inject the loader script
- document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- // 2. Inject the secondary script block for core dependencies
- document.write(
- '<script>' +
- 'window.RT.load("Core/utility");' +
- 'window.RT.load("Core/block_visibility_during_layout");' +
- 'window.RT.load("Theme");' +
- 'window.RT.load("Element/theme_selector");' +
- '<\/script>'
- );
-})();
<head>
<meta charset="UTF-8">
<title>Release howto</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
--- /dev/null
+#!/usr/bin/env python3
+import sys
+import os
+import stat
+import shutil
+from pathlib import Path
+
+def deploy_RT_Style_indirect_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)
+
+ indirect_js = locator_dir / "indirect.js"
+ if not indirect_js.exists():
+ print("Error: indirect.js missing in the specified directory.")
+ sys.exit(1)
+
+ repo_home = Path(os.environ.get("REPO_HOME", "."))
+ IGNORED_DIRS = {".git"}
+
+ for root, dirs, files in os.walk(repo_home):
+ # Prune ignored directories in place
+ 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"
+
+ # Eliminate permission denial on read-only artifacts
+ if target_file.exists():
+ target_file.chmod(target_file.stat().st_mode | stat.S_IWUSR)
+
+ shutil.copyfile(indirect_js, target_file)
+ print(f"Copied indirect.js -> {target_file}")
+
+if __name__ == "__main__":
+ if len(sys.argv) != 2:
+ print("Usage: python3 deploy_RT_Style_indirect_locators.py <path_to_Locator_directory>")
+ sys.exit(1)
+
+ deploy_RT_Style_indirect_locators(sys.argv[1])
+
--- /dev/null
+/*
+ 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 || {};
+
+// --- Configuration ---
+// Define the consumer project name to allow dynamic local file:// calculation.
+window.RT.project_name = "Harmony";
+
+// Fallback URL when served over a network where the project root is not in the URI.
+window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript";
+
+(function() {
+ let style_path = window.RT.server_url;
+
+ if (window.RT.project_name) {
+ const path = window.location.pathname;
+ const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
+
+ if (project_root_index !== -1) {
+ // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
+ // We append the explicit forward slash before navigating into the shared boundary.
+ const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
+
+ // The symlink 'RT-Style' already drops us inside the 'consumer/' directory,
+ // so we proceed directly to 'made/Manuscript'.
+ style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript";
+ } else {
+ console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
+ }
+ }
+
+ window.RT.dirpr_library = style_path;
+
+ // 1. Inject the loader script
+ document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ // 2. Inject the secondary script block for core dependencies
+ document.write(
+ '<script>' +
+ 'window.RT.load("Core/utility");' +
+ 'window.RT.load("Core/block_visibility_during_layout");' +
+ 'window.RT.load("Theme");' +
+ 'window.RT.load("Element/theme_selector");' +
+ '<\/script>'
+ );
+})();
+++ /dev/null
-// RT-style.js (External consumer project router)
-window.RT = window.RT || {};
-
-// --- Configuration ---
-// Define the consumer project name to allow dynamic local file:// calculation.
-window.RT.project_name = "Harmony";
-
-// Fallback URL when served over a network where the project root is not in the URI.
-window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-style/consumer/made/Manuscript";
-
-(function() {
- let style_path = window.RT.server_url;
-
- if (window.RT.project_name) {
- const path = window.location.pathname;
- const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
-
- if (project_root_index !== -1) {
- // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
- // We append the explicit forward slash before navigating into the shared boundary.
- const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
- style_path = absolute_project_root + "/shared/linked-project/RT-style/consumer/made/Manuscript";
- } else {
- console.warn("RT-style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
- }
- }
-
- window.RT.dirpr_library = style_path;
-
- // 1. Inject the loader script
- document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- // 2. Inject the secondary script block for core dependencies
- document.write(
- '<script>' +
- 'window.RT.load("Core/utility");' +
- 'window.RT.load("Core/block_visibility_during_layout");' +
- 'window.RT.load("Theme");' +
- 'window.RT.load("Element/theme_selector");' +
- '<\/script>'
- );
-})();
<head>
<meta charset="UTF-8">
<title>File and directory naming conventions</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
<head>
<meta charset="UTF-8">
<title>C modules, namespaces, and the build lifecycle</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
--- /dev/null
+/*
+ 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 || {};
+
+// --- Configuration ---
+// Define the consumer project name to allow dynamic local file:// calculation.
+window.RT.project_name = "Harmony";
+
+// Fallback URL when served over a network where the project root is not in the URI.
+window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript";
+
+(function() {
+ let style_path = window.RT.server_url;
+
+ if (window.RT.project_name) {
+ const path = window.location.pathname;
+ const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
+
+ if (project_root_index !== -1) {
+ // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
+ // We append the explicit forward slash before navigating into the shared boundary.
+ const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
+
+ // The symlink 'RT-Style' already drops us inside the 'consumer/' directory,
+ // so we proceed directly to 'made/Manuscript'.
+ style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript";
+ } else {
+ console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
+ }
+ }
+
+ window.RT.dirpr_library = style_path;
+
+ // 1. Inject the loader script
+ document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ // 2. Inject the secondary script block for core dependencies
+ document.write(
+ '<script>' +
+ 'window.RT.load("Core/utility");' +
+ 'window.RT.load("Core/block_visibility_during_layout");' +
+ 'window.RT.load("Theme");' +
+ 'window.RT.load("Element/theme_selector");' +
+ '<\/script>'
+ );
+})();
+++ /dev/null
-// RT-style.js (External consumer project router)
-window.RT = window.RT || {};
-
-// --- Configuration ---
-// Define the consumer project name to allow dynamic local file:// calculation.
-window.RT.project_name = "Harmony";
-
-// Fallback URL when served over a network where the project root is not in the URI.
-window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-style/consumer/made/Manuscript";
-
-(function() {
- let style_path = window.RT.server_url;
-
- if (window.RT.project_name) {
- const path = window.location.pathname;
- const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
-
- if (project_root_index !== -1) {
- // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
- // We append the explicit forward slash before navigating into the shared boundary.
- const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
- style_path = absolute_project_root + "/shared/linked-project/RT-style/consumer/made/Manuscript";
- } else {
- console.warn("RT-style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
- }
- }
-
- window.RT.dirpr_library = style_path;
-
- // 1. Inject the loader script
- document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- // 2. Inject the secondary script block for core dependencies
- document.write(
- '<script>' +
- 'window.RT.load("Core/utility");' +
- 'window.RT.load("Core/block_visibility_during_layout");' +
- 'window.RT.load("Theme");' +
- 'window.RT.load("Element/theme_selector");' +
- '<\/script>'
- );
-})();
<head>
<meta charset="UTF-8">
<title>Introduction to Harmony</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
<head>
<meta charset="UTF-8">
<title>Product development roles and workflow</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
<head>
<meta charset="UTF-8">
<title>Product maintenance roles and workflow</title>
- <script src="RT-style.js"></script>
+ <script src="RT-Style_locator.js"></script>
<script>
window.RT.load('Layout/article_tech_ref');
</script>
+++ /dev/null
-#!/usr/bin/env python3
-# -*- mode: python; coding: utf-8; python-indent-offset: 2; indent-tabs-mode: nil -*-
-
-import os ,sys
-
-def process_file(file_path ,replacements) -> bool:
- try:
- with open(file_path ,"r" ,encoding="utf-8") as f:
- content = f.read()
- except UnicodeDecodeError:
- return False
-
- new_content = content
- for old_str ,new_str in replacements:
- new_content = new_content.replace(old_str ,new_str)
-
- if new_content != content:
- with open(file_path ,"w" ,encoding="utf-8") as f:
- f.write(new_content)
- return True
- return False
-
-def work(root_dir: str) -> list[str]:
- replacements = [
- ("shared/linked-project" ,"shared/linked-project")
- ,("linked-project/" ,"linked-project/")
- ,("how-to_release.html" ,"how-to_release.html")
- ,("naming_file-and-directory.html" ,"naming_file-and-directory.html")
- ,("format_RT-code.html" ,"format_RT-code.html")
- ,("format_RT-code.html" ,"format_RT-code.html")
- ,("format_RT-code-Lisp.html" ,"format_RT-code-Lisp.html")
- ,("single-file_C-module-and-namespace.html" ,"single-file_C-module-and-namespace.html")
- ,("developer/tool/do-all" ,"developer/tool/do-all")
- ,("introduction_Harmony.html" ,"introduction_Harmony.html")
- ,("role-and-workflow_product-development.html" ,"role-and-workflow_product-development.html")
- ,("role-and-workflow_product-development.html" ,"role-and-workflow_product-development.html")
- ,("role-and-workflow_product-maintenance.html" ,"role-and-workflow_product-maintenance.html")
- ,("installation_Python.org" ,"installation_Python.org")
- ,("installation_generic.org" ,"installation_generic.org")
- ,("dictionary_style-directory.js" ,"dictionary_style-directory.js")
- ,("target_kernel-module.mk" ,"target_kernel-module.mk")
- ,("tester/RT-formatter" ,"tester/RT-formatter")
- ,("RT-formatter pipe" ,"RT-formatter pipe")
- ,("RT-formatter pipe" ,"RT-formatter pipe")
- ,("RT-formatter-buffer" ,"RT-formatter-buffer")
- ,("RT-formatter-buffer" ,"RT-formatter-buffer")
- ,("RT-formatter-buffer" ,"RT-formatter-buffer")
- ,("RT-formatter-buffer" ,"RT-formatter-buffer")
- ,("\"RTfmt\"" ,"\"RT-formatter\"")
- ,("\"RTfmt0\"" ,"\"RT-formatter\"")
- ,("\"RT_format\"" ,"\"RT-formatter\"")
- ,("RT-formatter formatting" ,"RT-formatter formatting")
- ,("RT-formatter failed" ,"RT-formatter failed")
- ,("RT-formatter formatting" ,"RT-formatter formatting")
- ,("RT-formatter failed" ,"RT-formatter failed")
- ,("data_test-0.c" ,"data_test-0.c")
- ,("data_test-1.py" ,"data_test-1.py")
- ,("RT-formatter.el" ,"RT-formatter.el")
- ,("RT-formatter.el" ,"RT-formatter.el")
- ,("RT-formatter.el" ,"RT-formatter.el")
- ]
-
- changed_files = []
-
- for dirpath ,dirnames ,filenames in os.walk(root_dir):
- path_parts = dirpath.split(os.sep)
- if ".git" in path_parts or "scratchpad" in path_parts:
- continue
-
- for fn in filenames:
- if fn.endswith(".tar") or fn.endswith(".tar.gz") or fn.endswith(".zip"):
- continue
-
- fp = os.path.join(dirpath ,fn)
- if process_file(fp ,replacements):
- changed_files.append(fp)
-
- return changed_files
-
-def CLI(argv=None) -> int:
- root_dir = "."
- print(f"Scanning '{root_dir}' for outdated internal references...")
- changed = work(root_dir)
-
- if not changed:
- print("No references needed updating.")
- else:
- print(f"Updated internal references in {len(changed)} files:")
- for fp in changed:
- print(f" {fp}")
-
- return 0
-
-if __name__ == "__main__":
- sys.exit(CLI())
--- /dev/null
+/*
+ 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 || {};
+
+// --- Configuration ---
+// Define the consumer project name to allow dynamic local file:// calculation.
+window.RT.project_name = "Harmony";
+
+// Fallback URL when served over a network where the project root is not in the URI.
+window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript";
+
+(function() {
+ let style_path = window.RT.server_url;
+
+ if (window.RT.project_name) {
+ const path = window.location.pathname;
+ const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
+
+ if (project_root_index !== -1) {
+ // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
+ // We append the explicit forward slash before navigating into the shared boundary.
+ const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
+
+ // The symlink 'RT-Style' already drops us inside the 'consumer/' directory,
+ // so we proceed directly to 'made/Manuscript'.
+ style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript";
+ } else {
+ console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
+ }
+ }
+
+ window.RT.dirpr_library = style_path;
+
+ // 1. Inject the loader script
+ document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ // 2. Inject the secondary script block for core dependencies
+ document.write(
+ '<script>' +
+ 'window.RT.load("Core/utility");' +
+ 'window.RT.load("Core/block_visibility_during_layout");' +
+ 'window.RT.load("Theme");' +
+ 'window.RT.load("Element/theme_selector");' +
+ '<\/script>'
+ );
+})();
+++ /dev/null
-// RT-style.js (External consumer project router)
-window.RT = window.RT || {};
-
-// --- Configuration ---
-// Define the consumer project name to allow dynamic local file:// calculation.
-window.RT.project_name = "Harmony";
-
-// Fallback URL when served over a network where the project root is not in the URI.
-window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-style/consumer/made/Manuscript";
-
-(function() {
- let style_path = window.RT.server_url;
-
- if (window.RT.project_name) {
- const path = window.location.pathname;
- const project_root_index = path.indexOf('/' + window.RT.project_name + '/');
-
- if (project_root_index !== -1) {
- // substring(0, stop) extracts up to the project name, leaving off the trailing slash.
- // We append the explicit forward slash before navigating into the shared boundary.
- const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1);
- style_path = absolute_project_root + "/shared/linked-project/RT-style/consumer/made/Manuscript";
- } else {
- console.warn("RT-style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url.");
- }
- }
-
- window.RT.dirpr_library = style_path;
-
- // 1. Inject the loader script
- document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- // 2. Inject the secondary script block for core dependencies
- document.write(
- '<script>' +
- 'window.RT.load("Core/utility");' +
- 'window.RT.load("Core/block_visibility_during_layout");' +
- 'window.RT.load("Theme");' +
- 'window.RT.load("Element/theme_selector");' +
- '<\/script>'
- );
-})();