{"id":19793311,"url":"https://github.com/failedcode/extendedtemplates","last_synced_at":"2026-06-11T19:31:14.255Z","repository":{"id":152343895,"uuid":"43226331","full_name":"FailedCode/ExtendedTemplates","owner":"FailedCode","description":"Sublime Text 3 Plugin","archived":false,"fork":false,"pushed_at":"2016-08-05T22:23:38.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T15:30:47.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FailedCode.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-26T23:00:54.000Z","updated_at":"2016-08-03T23:31:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cc9b9f2-3fb1-4545-a927-2557deee0080","html_url":"https://github.com/FailedCode/ExtendedTemplates","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FailedCode/ExtendedTemplates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FailedCode%2FExtendedTemplates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FailedCode%2FExtendedTemplates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FailedCode%2FExtendedTemplates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FailedCode%2FExtendedTemplates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FailedCode","download_url":"https://codeload.github.com/FailedCode/ExtendedTemplates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FailedCode%2FExtendedTemplates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34215253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-12T07:09:28.315Z","updated_at":"2026-06-11T19:31:14.230Z","avatar_url":"https://github.com/FailedCode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ExtendedTemplates\nThis is a plugin for [Sublime Text 3](http://www.sublimetext.com/).  \nIt adds the ability to create multiple files and folders (defined in json snippet files) from the sidebar menu.\n\n## Install\nDownload / Clone to `Sublime Text 3\\Data\\Packages`\n\n## Settings\nLike most plugins, the settings are added to the menu at `Preferences / Package Settings / Extended Templates`  \nMake sure to define the \"vars\" block in your user settings.  \nRead the default settings file for detailed information.\n\n## Snippets\nThe default snippets are located in the plugin subfolder \"templates\" (the folders in the settings are searched recursively) and must end with `.def.json`. You can place your own in the `User/ExtendedTemplates/templates/` directory. \nEvery json file can contain these values:\n\n| Key                   | Type          | Description |\n| :-------------------- | :------------ | :---------- |\n| `name`                | string        | Will be shown when selecting a snippet. |\n| `description`         | string        | Explain here what this is used for. Will be shown when selecting a snippet.|\n| `vars`                | dictionary    | Pairs of variable name and variable value. |\n| `files_and_folders`   | array         | Lists folders (ending with a slash) and files (no slash). May contain variables. |\n| `content`             | dictionary    | Pairs of name and string templates. May contain variables. |\n\n#### `files_and_folders`\nFilepaths may be appended with a pipe \"|\" character, followed by a path to a template file, named content or URL content.  \nMultiple templates can be used (separated by more pipes). The path is relative to the snippet file.  \nNamed content must be enclosed in angle brackets \"`\u003cname\u003e`\". The values will be appended to the file.  \nURL content must be enclosed in square brackets \"`[http://example.com/template.txt]`\"  \n\n**Already existing files will not be altered.**\n\n#### `content`\nIf you need only a very small template and don't want to clutter your system with tiny files, you can define content within the snippet file.\n\n## Variables\nAll occurences of `${var_name}` will be found in the snippet file and the template files.  \nVariables may be set in the snippet file or the settings.  \n\n### Methods to set variables\n\n#### Example `text`\n```\n\"vars\": {\n  \"version\": \"v1.0.5\",\n  \"name\": \"name\",\n}\n```\nThe user won't be promptet for `version`, `${version}` will replaced with `v1.0.5`.  \nThe user will be promptet to enter a string for `name`, `${name}` will replaced with the entered string. It makes sense to do this only if you want to override a variable with some user input, since the user will be promptet for every variable used but not explicitly set.\n\n#### Example `dict`\n```\n  \"vars\": {\n    \"food\": [\n      {\"value\": \"cake\",  \"text\": \"Sweet and tasty!\"},\n      {\"value\": \"bacon\", \"text\": \"Salty and delicous!\"},\n      {\"value\": \"curry\", \"text\": \"Hot, hot and hot!\"}\n    ]\n  }\n```\nThe user will ne promptet for `food`, `${food}` will replaced with one of these: `cake`, `bacon`, `curry` or an empty String.\n\n#### Example `list`\n```\n\"vars\": {\n  \"food\": [\n    [\"cake\",  \"Sweet and tasty!\"],\n    [\"bacon\", \"Salty and delicous!\"],\n    [\"curry\", \"Hot, hot and hot!\"]\n  ]\n}\n```\nExactly the same as the example above!\n\n### Special variables\nThese variables are filled on runtime with the current date/time:\n\n| Variable     | Format               | Example Value          |\n| :----------- | :------------------- | :--------------------- |\n| `_timestamp` | `%Y-%m-%dT%H:%M:%SZ` | `2015-09-27T16:59:15Z` |\n| `_datetime`  | `%Y-%m-%d %H:%M`     | `2015-09-27 16:59`     |\n| `_date`      | `%Y-%m-%d`           | `2015-09-27`           |\n| `_time`      | `%H:%M`              | `16:59`                |\n| `_year`      | `%Y`                 | `2015`                 |\n| `_month`     | `%m`                 | `09`                   |\n| `_day`       | `%d`                 | `27`                   |\n\n### Sublime variables\nThese variables are provided by Sublime text:  \n`packages`, `platform`, `file`, `file_path`, `file_name`, `file_base_name`, `file_extension`, `folder`, `project`, `project_path`, `project_name`, `project_base_name`, `project_extension`  \nSee also [API reference](https://www.sublimetext.com/docs/3/api_reference.html)\n\n### Order of variable substitution\n1. Sublime Text variables\n2. Variables set in the settings file\n3. Variables set in snippet file\n4. Special variables\n\nSo, you could override `project_path` in your settings file or set `author_name` in the snippet file to the value `author_name` to prompt the user.\n\n### Variable Modification\nThere are some options available to modify values before they are inserted. At this time is it not possible to combine modifiers.\n\n| Modifier | Usage             | Effect           |\n| :------- | :---------------- |:---------------- |\n| *none*   | `${var}`          | `this IS a teSt` |\n| upper    | `${var|upper}`    | `THIS IS A TEST` |\n| lower    | `${var|lower}`    | `this is a test` |\n| title    | `${var|title}`    | `This Is A Test` |\n| capital  | `${var|capital}`  | `This IS a teSt` |\n| camel    | `${var|camel}`    | `ThisIsATest`    |\n| snake    | `${var|snake}`    | `this_is_a_test` |\n| constant | `${var|constant}` | `THIS_IS_A_TEST` |\n\n\n## Examples\n\n#### Snippet `python.def.json`\n``` json\n{\n  \"name\": \"Python Module\",\n  \"description\": \"Empty python Module\",\n  \"files_and_folders\": [\n    \"${module_name}/__init__.py\"\n  ]\n}\n```\n#### Creates\n\n| Path                      | Description     |\n| :------------------------ | :-------------- |\n| `module_name/`            | Empty directory |\n| `module_name/__init__.py` | Empty file      |\n\n#### Snippet `phpclass.def.json`\n``` json\n{\n  \"name\": \"php class\",\n  \"description\": \"Add a php class\",\n  \"files_and_folders\": [\n    \"${name}Class.php|php/class.php\"\n  ]\n}\n```\n#### Creates\n\n| Path             | Description     |\n| :--------------- | :-------------- |\n| `nameClass.php`  | File with the contents of the file `php/class.php` (relative to the json file) |\n\n#### Snippet `html.def.json`\n``` json\n{\n  \"name\": \"HTML\",\n  \"description\": \"Small HTML project\",\n  \"vars\": {\n    \"version\": \"-html5\"\n  },\n  \"files_and_folders\": [\n    \"css/style.css|\u003cbanner\u003e\",\n    \"js/script.js|\u003cbanner\u003e|\u003cjs-ready\u003e\",\n    \"index.html|html/index${version}.html\"\n  ],\n  \"content\": {\n    \"banner\": \"/* Created at ${_datetime} by ${author_name} */\\n\",\n    \"js-ready\": \"\\n$(function() {\\n\\n});\\n\"\n  }\n}\n```\n#### Creates\n\n| Path            | Description |\n| :-------------- | :---------- |\n| `css/`          | Empty directory |\n| `css/style.css` | File with the `banner` content |\n| `js/`           | Empty directory |\n| `js/script.js`  | File with the `banner` and `js-ready` content |\n| `index.html`    | File with the contents of the file `html/index-html5.html` |\n\n#### Snippet `jquery.def.json`\n``` json\n{\n  \"name\": \"jQuery\",\n  \"description\": \"Select a jQuery version\",\n  \"vars\": {\n    \"version\": [\n      {\"value\": \"1.11.3\", \"text\": \"jQuery 1.x\"},\n      {\"value\": \"2.1.4\",  \"text\": \"jQuery 2.x\"},\n      {\"value\": \"3.0.0\",  \"text\": \"jQuery 3.x\"}\n    ],\n    \"min\": [\n      [\".min\", \"use compressed source\"],\n      [\"\",     \"use uncompressed developmend source\"]\n    ]\n  },\n  \"files_and_folders\": [\n    \"jquery.js|js/jquery-${version}${min}.js\"\n  ]\n}\n```\n#### Creates\n\n| Path            | Description |\n| :-------------- | :---------- |\n| `jquery.js`     | Copys the content from `js/jquery-1.11.3.min.js` if the first options are selected **or** from `js/jquery-.js` if the User hits Escape in every case. |\n\n#### Snippet `gitignore.def.json`\n``` json\n{\n  \"name\": \"Gitignore\",\n  \"description\": \"download from github\",\n  \"files_and_folders\": [\n    \".gitignore|\u003ccomment\u003e|[https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore]|[https://raw.githubusercontent.com/github/gitignore/master/Global/OSX.gitignore]|[https://raw.githubusercontent.com/github/gitignore/master/Global/Windows.gitignore]\"\n  ],\n  \"content\": {\n    \"comment\": \"# downloaded from github\\n\\n\"\n  }\n}\n```\n#### Creates\n\n| Path            | Description |\n| :-------------- | :---------- |\n| `.gitignore`    | Downloads gitignore files for linux, osx and windows |\n\n## Inspired by\nhttps://github.com/bit101/STProjectMaker\n\n## License\nSee \"UNLICENSE\" file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffailedcode%2Fextendedtemplates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffailedcode%2Fextendedtemplates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffailedcode%2Fextendedtemplates/lists"}