Is there a reason the template has to be MD? #73

Closed
jabbera opened this Issue Feb 7, 2017 · 1 comment

Projects

None yet

2 participants

@jabbera
jabbera commented Feb 7, 2017 edited

Can I make my template html? I'm interested in emailing out release notes and MD is not a great format for that if you are an outlook shop.

Thanks,
Mike

@rfennell
Owner
rfennell commented Feb 7, 2017

No there is no a reason it has to be markdown. You just need to build a template using HTML tags. All the task does is replace the $build etc. PowerShell Tokens with values by evaluating each line as string in PowerShell.

I had a quick try with a release template (as shown below) and it work OK for me. You can of course made the HTML much neater to get the format you are after

<h1>Release notes for release $defname </h1>
<b>Release Number</b>  : $($release.name)  <br>  
<b>Release completed</b> $("{0:dd/MM/yy HH:mm:ss}" -f [datetime]$release.modifiedOn) <br>

<b>Changes since last successful releases to '$stagename'</b> </br>   
<b>Including releases:</b></br>
 $(($releases | select-object -ExpandProperty name) -join ", " )   
</br></br>
<hr>
<h2>Builds </h2>  
@@BUILDLOOP@@
<h3>$($build.definition.name) </h3>  
<b>Build Number</b>  : $($build.buildnumber)    
<b>Build completed</b> $("{0:dd/MM/yy HH:mm:ss}" -f [datetime]$build.finishTime)     
<b>Source Branch</b> $($build.sourceBranch)  
  
<h3>Associated work items  </h3>
@@WILOOP@@  
<li> <b>$($widetail.fields.'System.WorkItemType') $($widetail.id)</b> [Assigned by: $($widetail.fields.'System.AssignedTo')] $($widetail.fields.'System.Title')  
@@WILOOP@@  
  
<h3>Associated change sets/commits </h3> 
@@CSLOOP@@  
<li> <b>ID $($csdetail.changesetid)$($csdetail.commitid)$($csdetail.id)</b> $($csdetail.comment)    
@@CSLOOP@@  
<hr>
@@BUILDLOOP@@

I will update the Wiki tonight to describe this different usage

@rfennell rfennell closed this Feb 7, 2017
@rfennell rfennell added a commit that referenced this issue Feb 7, 2017
@rfennell Added a sample showing an HTML template
A sample that shows the generate release notes task can be used to generate HTML as well as Markdown #73
416e10d
@rfennell rfennell added a commit that referenced this issue Feb 7, 2017
@rfennell Updated the readme notes for #73
Pointing out that you can use other formats for the template
2090a55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment