add_template_to_library
Add a new template to your user library, automatically assigning the correct ID so templates stay reachable and the library list remains stable.
Instructions
Add a new template to the user's library (never writes into the bundled seed dir).
Always sets metadata["id"] to template_id, overriding whatever (if
anything) the caller passed for "id" -- this is what get_template_files
matches on, so a missing or mismatched "id" would silently make the
template unreachable (or crash list_templates() entirely if "id" is
missing), which happened for real once already.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| metadata | Yes | ||
| template_id | Yes | ||
| user_library_dir | No | /root/.paperpilot/templates |