-
Notifications
You must be signed in to change notification settings - Fork 73
feature(customize) : Add the default path for the custom template #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- According to the document specification of Sublime Text(see: http://docs.sublimetext.info/en/sublime-text-3/basic_concepts.html#the-user-package), custom data for the user's plug-in should be stored in the `Packages/User` folder. - `Packages/User` folder data can be used for synchronization between multiple machines.(see: https://packagecontrol.io/docs/syncing) - So I created the `FileHeader-template/header` and `FileHeader-template/body` folders in the `Packages/User` directory, which are used as the default directory for the template files.
|
Hi, I'm wondering that have you tested it? Actually it doesn't work since |
|
I'm sure I've tested it, and it works fine.You may need to carefully review the code. |
| BODY_PATH = os.path.join(PLUGIN_PATH, 'template/body') | ||
| INSTALLED_PLGIN_PATH = os.path.abspath(os.path.dirname(__file__)) | ||
| DEFAULT_CUSTOM_TEMPLATE_HEADER_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template/header') | ||
| DEFAULT_CUSTOM_TEMPLATE_BODY_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template/body') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change it to below may be better:
DEFAULT_CUSTOM_TEMPLATE_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template') DEFAULT_CUSTOM_TEMPLATE_HEADER_PATH = os.path.join(DEFAULT_CUSTOM_TEMPLATE_PATH, 'header') DEFAULT_CUSTOM_TEMPLATE_BODY_PATH = os.path.join(DEFAULT_CUSTOM_TEMPLATE_PATH, 'body')
|
Yeah, you are right, sorry. I write some review to make the code more clean. After you modified it, I'll merge it. Thanks:) |
|
Thank you for your revision. |
Packages/Userfolder.Packages/Userfolder data can be used for synchronization between multiple machines.(see: https://packagecontrol.io/docs/syncing)FileHeader-template/headerandFileHeader-template/bodyfolders in thePackages/Userdirectory, which are used as the default directory for the template files.