From 4939806ae705953cfc1ca8cf54f20d98e9be9d03 Mon Sep 17 00:00:00 2001 From: Dean Anderson Date: Thu, 27 Sep 2018 16:51:01 -0400 Subject: customTag will supply ISO date format if user configured format empty Added separate templates for author name {author} and email {email} Added method to make multiple template substitutions in a string customTag will now replace {author}, {email}, {date} and {year} templates --- src/Config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Config.ts') diff --git a/src/Config.ts b/src/Config.ts index 54d227a..b33aff2 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -49,7 +49,9 @@ class Generic { public paramTemplate: string = "@param {param} "; public returnTemplate: string = "@return {type} "; public linesToGet: number = 20; - public authorTag: string = "@author your name"; + public authorName: string = "your name"; + public authorEmail: string = "you@domain.com"; + public authorTag: string = "@author {author} ({email})"; public dateTemplate: string = "@date {date}"; public dateFormat: string = "YYYY-MM-DD"; public generateSmartText: boolean = true; @@ -86,6 +88,8 @@ export class Config { values.Generic.returnTemplate = Generic.getConfiguration().get("returnTemplate", values.Generic.returnTemplate); values.Generic.linesToGet = Generic.getConfiguration().get("linesToGet", values.Generic.linesToGet); values.Generic.authorTag = Generic.getConfiguration().get("authorTag", values.Generic.authorTag); + values.Generic.authorName = Generic.getConfiguration().get("authorName", values.Generic.authorName); + values.Generic.authorEmail = Generic.getConfiguration().get("authorEmail", values.Generic.authorEmail); values.Generic.dateTemplate = Generic.getConfiguration().get("dateTemplate", values.Generic.dateTemplate); values.Generic.dateFormat = Generic.getConfiguration().get("dateFormat", values.Generic.dateFormat); values.Generic.generateSmartText = Generic.getConfiguration().get("generateSmartText", values.Generic.generateSmartText); @@ -98,6 +102,8 @@ export class Config { public readonly paramTemplateReplace: string = "{param}"; public readonly typeTemplateReplace: string = "{type}"; public readonly nameTemplateReplace: string = "{name}"; + public readonly authorTemplateReplace: string = "{author}"; + public readonly emailTemplateReplace: string = "{email}"; public readonly dateTemplateReplace: string = "{date}"; public readonly yearTemplateReplace: string = "{year}"; public readonly textTemplateReplace: string = "{text}"; -- cgit v1.2.3