MDXP icon indicating copy to clipboard operation
MDXP copied to clipboard

Feature Request: Use of external template

Open dannief opened this issue 4 years ago • 1 comments

Noticed the package used to bootstrap a new project has a default template. Would love to be able to create a new presentation based on a template hosted somewhere or from another mom package

dannief avatar May 28 '21 04:05 dannief

I am currently quite busy and do not have much time to work on this repository. You can copy the create-webpack directory, change the content in the template and reupload that as your own repository to enable different templates.

Currently, the code in the create-webpack package downloads a specific folder from github, through the codeload.github.com url. I am not sure if there are similar urls for other code hosting websites like gitlab, but we could probably extend the code to enable another argument of the style: -t <user>/<repo>/<path>, which would then try to download a template from that github repository.
Finally, we need to clearly notify the user we are not responsible for downloading malicious code or files! :)

If you want to, feel free to send in a PR for this feature.

  1. Add an extra -t, --template flag in cli.js, with a default value of 0phoff/MDXP/packages/webpack/template
  2. Pass the string to the create() function
  3. Warn user about malicious code (if default was not used).
  4. Split the template string argument in separate <user>, <repo>, <path> strings and pass those to the getTar() function

0phoff avatar Jun 16 '21 09:06 0phoff