--- /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 || {};
+
+(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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ 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 (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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- 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_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 <path_to_Locator_directory>")
+ sys.exit(1)
+
+ deploy_internal_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 || {};
+
+(function() {
+ // We are the style library, so ...
+ window.RT.dirpr_library = "..";
+
+ // 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
+ 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>'
+ );
+})();
<meta charset="UTF-8">
<title>Your Document Title</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
+// RT-style_url_only.js
+window.RT = window.RT || {};
+
+(function() {
+ window.RT.dirpr_library = "https://style.ReasoningTechnology.com/Manuscript"; // Production URL
+
+ document.write('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+ 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 || {};
+
+(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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ 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 || {};
+
+(function() {
+ // We are the style library, so ...
+ window.RT.dirpr_library = "..";
+
+ // 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
+ 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
+/*
+ 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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ 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>RT Code Format: Lisp Addendum</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>RT code format conventions</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
-// 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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- 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 || {};
+
+(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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ 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>RT semantic HTML tags</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
-// 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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- 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
+/*
+ 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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
+
+ 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 (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('<script src="' + window.RT.dirpr_library + '/Core/loader.js"><\/script>');
-
- 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
+#!/usr/bin/env bash
+# deploy_internal_locators.sh
+
+LOCATOR_DIR="$1"
+
+if [[ -z "$LOCATOR_DIR" || ! -d "$LOCATOR_DIR" ]]; then
+ echo "Error: Must provide a valid path to the Locator directory."
+ echo "Usage: $0 <path_to_Locator_directory>"
+ exit 1
+fi
+
+# Default to current directory if REPO_HOME is not set
+TARGET_BASE="${REPO_HOME:-.}"
+
+# Walk the tree, pruning .git, scratchpad, and consumer
+find "$TARGET_BASE" -type d \( -name ".git" -o -name "scratchpad" -o -name "consumer" \) -prune -o -type d -iname "document" -print | while IFS= read -r doc_dir; do
+
+ # Evaluate the path to determine the correct structural locator
+ if [[ "$doc_dir" == *"developer/authored/Manuscript"* ]]; then
+ cp "$LOCATOR_DIR/immediate.js" "$doc_dir/RT-Style_locator.js"
+ echo "Copied immediate.js -> $doc_dir/RT-Style_locator.js"
+ else
+ cp "$LOCATOR_DIR/direct.js" "$doc_dir/RT-Style_locator.js"
+ echo "Copied direct.js -> $doc_dir/RT-Style_locator.js"
+ fi
+
+done
+
+echo "Internal locator deployment complete."