# senthilkumarsampath/template-upgrade architecture

> Architecture diagram of the GitHub repository senthilkumarsampath/template-upgrade, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/senthilkumarsampath/template-upgrade
- Repository: https://github.com/senthilkumarsampath/template-upgrade

## Overview

This repository provides two alternative InDesign scripts for upgrading legacy templates into CC 2026 templates. The user selects a source folder; the scripts find InDesign files, create fresh documents, copy document features, and save upgraded templates. The excerpts show settings, style, master-spread, metadata, XML, footnote, and page-content capabilities, but omit much of the processing loop. Accordingly, the graph distinguishes documented capabilities without guessing their call sequence; both scripts are standalone entry points.

Main entry points: [`upgrade-templates-v2.jsx`](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx) (Refactored upgrader), [`upgrade-templates.jsx`](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates.jsx) (Original upgrader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Script entry points"]
  node_legacy["Original upgrader"]
  node_refactored["Refactored upgrader"]
end

subgraph group_upgrade["Document upgrade"]
  node_discovery["File discovery"]
end

subgraph group_features["Template features"]
  node_settings["Document settings"]
  node_style_import["Style import"]
  node_masters["Master spreads"]
  node_metadata["Document metadata"]
  node_xml["XML content"]
  node_footnotes["Footnote options"]
  node_page_content["Page content"]
end

subgraph group_outputs["Outputs"]
  node_log["Upgrade log"]
  node_output["Upgraded templates"]
end

node_user(("InDesign user"))

node_user -->|"runs script"| node_legacy
node_user -->|"runs script"| node_refactored
node_refactored -->|"collects files"| node_discovery
node_refactored -->|"applies settings"| node_settings
node_refactored -->|"opens log"| node_log
node_refactored -->|"saves template"| node_output
node_legacy -->|"saves template"| node_output

click node_legacy "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates.jsx"
click node_refactored "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_discovery "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_settings "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_style_import "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_masters "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_metadata "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_xml "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_footnotes "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"
click node_page_content "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates.jsx"
click node_log "https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_legacy,node_refactored,node_user toneBlue
class node_discovery toneAmber
class node_settings,node_style_import,node_masters,node_metadata,node_xml,node_footnotes,node_page_content toneMint
class node_log,node_output toneRose
```

## Components

### Script entry points

- [Original upgrader](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates.jsx): `upgrade-templates.jsx`
- [Refactored upgrader](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`

### Document upgrade

- [File discovery](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`

### Template features

- [Document settings](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [Style import](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [Master spreads](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [Document metadata](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [XML content](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [Footnote options](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- [Page content](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates.jsx): `upgrade-templates.jsx`

### Outputs

- [Upgrade log](https://github.com/senthilkumarsampath/template-upgrade/blob/main/upgrade-templates-v2.jsx): `upgrade-templates-v2.jsx`
- **Upgraded templates**

### Other components

- **InDesign user**

## Connections

- InDesign user → Original upgrader: runs script (evidence: `upgrade-templates.jsx`)
- InDesign user → Refactored upgrader: runs script (evidence: `upgrade-templates-v2.jsx`)
- Refactored upgrader → File discovery: collects files (evidence: `upgrade-templates-v2.jsx`)
- Refactored upgrader → Document settings: applies settings (evidence: `upgrade-templates-v2.jsx`)
- Refactored upgrader → Upgrade log: opens log (evidence: `upgrade-templates-v2.jsx`)
- Refactored upgrader → Upgraded templates: saves template (evidence: `upgrade-templates-v2.jsx`)
- Original upgrader → Upgraded templates: saves template (evidence: `upgrade-templates.jsx`)
