# yarikartoshe4ka/sublime-svg-viewer architecture

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

- Interactive diagram: https://gitdiagram.com/yarikartoshe4ka/sublime-svg-viewer
- Repository: https://github.com/yarikartoshe4ka/sublime-svg-viewer

## Overview

SVG Viewer is a Sublime Text plugin that turns an open SVG into a PNG, using either CloudConvert or a configured local converter, then opens the result in Sublime. Its main flow runs from the view command through conversion and back to the editor; settings select the conversion mode and engine. The repository also bundles a CloudConvert Python client with job/task REST operations, signed-URL generation, and webhook verification. Those SDK capabilities are represented as separate components. The plugin flow is shown in sampled source; some SDK internals are only represented by indexed modules.

Main entry points: [`packages/cloudconvert/cloudconvertrestclient.py`](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/cloudconvertrestclient.py) (REST Client), [`svg-viewer.py`](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/svg-viewer.py) (View Commands), [`converter.py`](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py) (Online Conversion), [`packages/cloudconvert/resource.py`](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/resource.py) (Resource Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Sublime Plugin"]
  node_commands["View Commands<br/>[svg-viewer.py]"]
  node_settings["Plugin Settings"]
  node_converter_config["Converter Definitions<br/>[converters.json]"]
  node_editor["Sublime Editor"]
end

subgraph group_conversion["Conversion"]
  node_converter["Conversion Router<br/>[converter.py]"]
  node_offline["Local Conversion<br/>[converter.py]"]
  node_online["Online Conversion<br/>[converter.py]"]
end

subgraph group_sdk["CloudConvert SDK"]
  node_client["REST Client"]
  node_config["Client Configuration<br/>[config.py]"]
  node_environment["Environment Defaults"]
  node_resource["Resource Operations<br/>[resource.py]"]
  node_jobs["Job API<br/>[job.py]"]
  node_tasks["Task API<br/>[task.py]"]
  node_exceptions["API Exceptions<br/>[exceptions.py]"]
  node_signed_url["Signed URLs<br/>[signed_url.py]"]
  node_webhook["Webhook Verification<br/>[webhook.py]"]
end

subgraph group_integrations["External Services"]
  node_cloud_api["CloudConvert API"]
  node_local_tools["SVG Converter Tools"]
end

node_user(("Sublime User"))

node_user -->|"invokes"| node_commands
node_commands -->|"reads"| node_settings
node_commands -->|"loads"| node_converter_config
node_commands -->|"requests conversion"| node_converter
node_converter -->|"reads"| node_settings
node_converter -->|"dispatches"| node_offline
node_converter -->|"dispatches"| node_online
node_offline -->|"selects command"| node_converter_config
node_offline -->|"executes command"| node_local_tools
node_online -->|"configures"| node_client
node_online -->|"creates job"| node_jobs
node_online -->|"uploads and waits"| node_tasks
node_online -->|"checks connectivity"| node_cloud_api
node_commands -->|"opens PNG"| node_editor
node_client -->|"sends HTTP requests"| node_cloud_api
node_client -->|"uses endpoints"| node_config
node_client -->|"reads defaults"| node_environment
node_client -->|"raises API errors"| node_exceptions
node_jobs -->|"inherits operations"| node_resource
node_tasks -->|"inherits operations"| node_resource
node_resource -->|"calls REST methods"| node_client

click node_commands "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/svg-viewer.py"
click node_settings "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/svg-viewer.sublime-settings"
click node_converter_config "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converters.json"
click node_converter "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py"
click node_offline "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py"
click node_online "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py"
click node_client "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/cloudconvertrestclient.py"
click node_config "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/config.py"
click node_environment "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/environment_vars.py"
click node_resource "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/resource.py"
click node_jobs "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/job.py"
click node_tasks "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/task.py"
click node_exceptions "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/exceptions/exceptions.py"
click node_signed_url "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/signed_url.py"
click node_webhook "https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/webhook.py"

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_commands,node_settings,node_converter_config,node_editor,node_user toneBlue
class node_converter,node_offline,node_online toneAmber
class node_client,node_config,node_environment,node_resource,node_jobs,node_tasks,node_exceptions,node_signed_url,node_webhook toneMint
class node_cloud_api,node_local_tools toneRose
```

## Components

### Sublime Plugin

- [View Commands](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/svg-viewer.py): `svg-viewer.py`
- [Plugin Settings](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/svg-viewer.sublime-settings): `svg-viewer.sublime-settings`
- [Converter Definitions](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converters.json): `converters.json`
- **Sublime Editor**

### Conversion

- [Conversion Router](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py): `converter.py`
- [Local Conversion](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py): `converter.py`
- [Online Conversion](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/converter.py): `converter.py`

### CloudConvert SDK

- [REST Client](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/cloudconvertrestclient.py): `packages/cloudconvert/cloudconvertrestclient.py`
- [Client Configuration](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/config.py): `packages/cloudconvert/config.py`
- [Environment Defaults](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/environment_vars.py): `packages/cloudconvert/environment_vars.py`
- [Resource Operations](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/resource.py): `packages/cloudconvert/resource.py`
- [Job API](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/job.py): `packages/cloudconvert/job.py`
- [Task API](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/task.py): `packages/cloudconvert/task.py`
- [API Exceptions](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/exceptions/exceptions.py): `packages/cloudconvert/exceptions/exceptions.py`
- [Signed URLs](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/signed_url.py): `packages/cloudconvert/signed_url.py`
- [Webhook Verification](https://github.com/yarikartoshe4ka/sublime-svg-viewer/blob/master/packages/cloudconvert/webhook.py): `packages/cloudconvert/webhook.py`

### External Services

- **CloudConvert API**
- **SVG Converter Tools**

### Other components

- **Sublime User**

## Connections

- Sublime User → View Commands: invokes (evidence: `svg-viewer.py`)
- View Commands → Plugin Settings: reads (evidence: `svg-viewer.py`)
- View Commands → Converter Definitions: loads (evidence: `svg-viewer.py`)
- View Commands → Conversion Router: requests conversion (evidence: `svg-viewer.py`)
- Conversion Router → Plugin Settings: reads (evidence: `converter.py`)
- Conversion Router → Local Conversion: dispatches (evidence: `converter.py`)
- Conversion Router → Online Conversion: dispatches (evidence: `converter.py`)
- Local Conversion → Converter Definitions: selects command (evidence: `converter.py`)
- Local Conversion → SVG Converter Tools: executes command (evidence: `converter.py`)
- Online Conversion → REST Client: configures (evidence: `converter.py`)
- Online Conversion → Job API: creates job (evidence: `converter.py`)
- Online Conversion → Task API: uploads and waits (evidence: `converter.py`)
- Online Conversion → CloudConvert API: checks connectivity (evidence: `converter.py`)
- View Commands → Sublime Editor: opens PNG (evidence: `svg-viewer.py`)
- REST Client → CloudConvert API: sends HTTP requests (evidence: `packages/cloudconvert/cloudconvertrestclient.py`)
- REST Client → Client Configuration: uses endpoints (evidence: `packages/cloudconvert/cloudconvertrestclient.py`)
- REST Client → Environment Defaults: reads defaults (evidence: `packages/cloudconvert/cloudconvertrestclient.py`)
- REST Client → API Exceptions: raises API errors (evidence: `packages/cloudconvert/cloudconvertrestclient.py`)
- Job API → Resource Operations: inherits operations (evidence: `packages/cloudconvert/job.py`)
- Task API → Resource Operations: inherits operations (evidence: `packages/cloudconvert/task.py`)
- Resource Operations → REST Client: calls REST methods (evidence: `packages/cloudconvert/resource.py`)
