Classes
SwizzleRecord
dataclass
SwizzleRecord
dataclass Attributes
| Name | Type | Description |
|---|---|---|
target |
str |
|
source |
str |
|
theme |
str |
|
upstream_checksum |
str |
|
local_checksum |
str |
|
timestamp |
float |
SwizzleManager
SwizzleManager
Methods 4
swizzle
Copy a theme template into project templates/ and record provenance.
swizzle
def swizzle(self, template_rel_path: str) -> Path
Copy a theme template into project templates/ and record provenance.
Parameters 1
template_rel_path |
str |
Relative path inside theme templates/ (e.g., 'partials/toc.html') |
Returns
Path to copied file under project templates/Path
—
list
list
def list(self) -> builtins.list[SwizzleRecord]
Returns
builtins.list[SwizzleRecord]
list_swizzled
Alias for list() for backward compatibility.
list_swizzled
def list_swizzled(self) -> builtins.list[SwizzleRecord]
Alias for list() for backward compatibility.
Returns
builtins.list[SwizzleRecord]
update
Attempt to update swizzled files from upstream if local is unchanged.
Returns …
update
def update(self) -> dict[str, int]
Attempt to update swizzled files from upstream if local is unchanged.
Returns a summary dict with counts: {updated, skipped_changed, missing_upstream}
Returns
dict[str, int]
Internal Methods 2
__init__
__init__
def __init__(self, site: Site) -> None
Parameters 1
site |
Site |
_is_modified
Check if a swizzled template has been modified locally.
_is_modified
def _is_modified(self, template_rel_path: str) -> bool
Check if a swizzled template has been modified locally.
Parameters 1
template_rel_path |
str |
Relative path inside templates/ (e.g., 'partials/toc.html') |
Returns
True if template has been modified locally, False otherwisebool
—
Functions
_checksum_file
Compute truncated checksum of file content.
_checksum_file
def _checksum_file(path: Path) -> str
Compute truncated checksum of file content.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
path |
Path |
— |
Returns
str
_checksum_str
Compute truncated checksum of string content.
_checksum_str
def _checksum_str(content: str) -> str
Compute truncated checksum of string content.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
content |
str |
— |
Returns
str