{"id":18115060,"url":"https://github.com/kairyou/sublimetmpl","last_synced_at":"2025-04-10T01:09:39.708Z","repository":{"id":4030530,"uuid":"5131037","full_name":"kairyou/SublimeTmpl","owner":"kairyou","description":"Create File From Templates for SublimeText 2 / SublimeText 3","archived":false,"fork":false,"pushed_at":"2020-05-06T04:00:26.000Z","size":57,"stargazers_count":225,"open_issues_count":6,"forks_count":68,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-10T01:09:23.873Z","etag":null,"topics":["snippets","sublime","sublime-package","sublimetmpl","templates"],"latest_commit_sha":null,"homepage":"https://xhl.me","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kairyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-21T04:08:48.000Z","updated_at":"2024-12-02T13:51:29.000Z","dependencies_parsed_at":"2022-09-12T11:52:49.036Z","dependency_job_id":null,"html_url":"https://github.com/kairyou/SublimeTmpl","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2FSublimeTmpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2FSublimeTmpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2FSublimeTmpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2FSublimeTmpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kairyou","download_url":"https://codeload.github.com/kairyou/SublimeTmpl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137886,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["snippets","sublime","sublime-package","sublimetmpl","templates"],"created_at":"2024-11-01T03:08:28.927Z","updated_at":"2025-04-10T01:09:39.678Z","avatar_url":"https://github.com/kairyou.png","language":"Python","funding_links":["https://www.paypal.me/kairyou"],"categories":[],"sub_categories":[],"readme":"SublimeTmpl\n===========\n\nA Sublime Text 2/3 plugin for create file from templates.\n\nInstallation\n------------\n\n**Github**\n\nGo to the \"Packages\" directory (`Preferences` / `Browse Packages`). Then clone this repository:\n\n    $ git clone https://github.com/kairyou/SublimeTmpl.git\n\n**Package Control**\n\nInstall [Package Control][1]. Then `Package Control: Install Package`, look for `SublimeTmpl` / `tmpl` and install it.\n\nUsage\n-----\n\n- Create file with menu\n   `File - New File (SublimeTmpl)`\n\n- Create file with command\n   use `cmd+shift+p` then look for `tmpl:`\n\nSettings\n--------\n\nDefault Settings: `Preferences` \u003e `Packages Settings` \u003e `SublimeTmpl` \u003e `Settings - Default`\n\nCustom settings (**Recommend*): `Preferences` \u003e `Package Settings` \u003e `SublimeTmpl` \u003e `Settings - User`\n\nDefault template files: `Packages/SublimeTmpl/templates`\n\nCustom template files (**Recommend**): `Packages/User/SublimeTmpl/templates/`\n\nProject-specific template files (ST3 only): via `settings`: `SublimeTmpl`: `template_folder` key within your sublime-project file (see \"Features added\" below)\n\n\nDefault key bindings\n--------------------\n\n    ctrl+alt+h html\n    ctrl+alt+j javascript\n    ctrl+alt+c css\n    ctrl+alt+p php\n    ctrl+alt+r ruby\n    ctrl+alt+shift+p python\n\n**Disable shortcuts**\n\nIf you’re unhappy with default keymap, you can disable keyboard shortcuts with `disable_keymap_actions` preference of `SublimeTmpl.sublime-settings`.\n\nUse a comma-separated list of action names which default keyboard shortcuts should be disabled. For example, if you want to disable creat `html` and `css` shortcuts, your must set the following value:\n\n    \"disabled_keymap_actions\": \"html, css\"\n\nTo disable all default shortcuts, set value to `all`.\n\n\n## Features added\n\n- custom template files\n\n    \u003e put your custom template files in `Packages/User/SublimeTmpl/templates` \n    \u003e Project-specific template files can be specified in project files, along with overriding other templating options.\n\n- `*.tmpl` file support `${date}` variable\n\n    \u003e default \"date_format\" : \"%Y-%m-%d %H:%M:%S\" .\n\n- `*.tmpl` file support `${saved_filename}`, `${saved_filepath}` on save file\n\n    \u003e Enable: `SublimeTmpl \u003e settings - user` add `\"enable_file_variables_on_save\": true,`\n\n- `*.tmpl` file support `${project_base_name}`, `${project_path}` and `${platform}`\n\n    NOTE: This will only work with SublimeText 3.0 or above.\n\n    \u003e Enable: `SublimeTmpl \u003e settings - user` add `\"enable_project_variables\": true,`\n\n\nIt is recommended that you put your own custom settings in `settings - user`.  Please see note below in \"*Detailed Instructions for Sublime Newbies\"\n\n- custom variables: `attr`\n\n    \u003e custom the attr variables in settings, example:\n    \u003e\n ``` json\n    \"attr\": {\n        \"author\": \"Your Name\" ,\n        \"email\": \"you@example.org\",\n        \"link\": \"http://example.org\",\n        \"hello\": \"word\"\n    }\n```\n\n    \u003e The `*.tmpl` file will support `${author}` `${email}` `${link}` `${hello}` variables.\n\n- Project specific overrides via `SublimeTmpl` attribute in sublime-project file.\n    \u003e\n``` json\n    \"settings\":\n    {\n        \"SublimeTmpl\":\n        {\n            \"template_folder\": \"Path\\\\to\\\\some\\\\custom\\\\template\\\\folder\",\n            \"template_replace_pattern\": \"{{%s}}\",\n            \"enable_project_variables\": true,\n            \"enable_file_variables_on_save\": true,\n            \"attr\": {  // Fully overrides \"attr\" settings (i.e. elements missing here will not attempt to be replaced in template)\n                \"author\": \"Alternative Name\"\n            },\n            \"project_variables\": {\n                // Allows for use with other template formats, provide mapping here\n                // \"tmpl_formatted_name\": \"current_template_name\"\n                \"project_base_name\": \"projectbase\",\n                \"project_path\": \"projectpath\",\n                \"platform\": \"plat\"\n            },\n            \n            \"file_variables_on_save\": {\n                // Allows for use with other template formats, provide mapping here\n                // \"tmpl_formatted_name\": \"current_template_name\"\n                \"saved_filename\": \"name\",\n                \"saved_filepath\": \"filepath\"\n            },\n        },\n    },\n```\n\n*Detailed Instructions for Sublime Newbies\n-----------------------------------------\n\nSublime Text keeps settings in bunch of files in a folder. For example, OS X, it is located at\n\n```/Users/yourusername/Library/Application Support/Sublime Text 3/Packages```\n\nYou can navigate to it easily by using the following menu item in Sublime, for example: `Sublime Text\u003ePreferences\u003eBrowse Packages`\n\nNow go to `Packages\\SublimeTmpl` folder and open the file SublimeTmpl.sublime-settings.  Save the file with the same file name under `Packages\\User`. Delete everything except the variables that are custom to you. By the time you are finished, the file might look as simple as this (JSON format):\n```\n{\n    \"attr\": {\n        \"author\": \"Chuck Norris\" ,\n        \"email\": \"chuck@kickbutt.com\",\n    }\n}\n```\n\nIf you don't want the  `\"link\"` and `\"hello\"` variables to show up, you should copy the (for example) python.tmpl file to `Packages/User/SublimeTmpl/templates` and remove those elements from it.  \n\n\nContributors\n-------\n- [View Contributors](https://github.com/kairyou/SublimeTmpl/graphs/contributors)\n\n### Donate\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://www.paypal.me/kairyou\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\nFAQ\n---\n- SublimeTmpl not work after update the package.\n\n  Please open `Preferences` / `Settings - User`, remove \"SublimeTmpl\" from `ignored_packages`.\n- Alert message `Replace pattern None doesn't seem to work: unsupported operand type(s) for %: 'NoneType' and 'str'`\n\n  Please restart Sublime Text and try again.\n\n--------------------\nSource: [https://github.com/kairyou/SublimeTmpl][0]\n\nDocs: [中文文档](https://xhl.me/archives/sublime-template-engine-sublimetmpl/)\n\n\n[0]: https://github.com/kairyou/SublimeTmpl\n[1]: https://packagecontrol.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairyou%2Fsublimetmpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkairyou%2Fsublimetmpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairyou%2Fsublimetmpl/lists"}