Skip to content

Commit

Permalink
Merge pull request #343 from 0x41head/activity-desc
Browse files Browse the repository at this point in the history
feature: added markdown rendering to activity desc in circular heatmap
  • Loading branch information
wurstbrot authored Dec 19, 2024
2 parents 98c70bc + 9c33198 commit 1b4ddad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ <h2>Nothing to show</h2>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<p [innerHTML]="activityDetails.description"></p>
<div
*ngIf="
markdown.render(activityDetails.description);
else ifFileIsNotAMarkdown
">
<p
[innerHTML]="
markdown.render(activityDetails.description)
"></p>
</div>
<ng-template #ifFileIsNotAMarkdown>
<p [innerHTML]="activityDetails.description"></p>
</ng-template>
</ng-template>
</mat-expansion-panel>
<mat-expansion-panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as d3 from 'd3';
import * as yaml from 'js-yaml';
import { Router } from '@angular/router';
import { MatChip } from '@angular/material/chips';
import * as md from 'markdown-it';

export interface activitySchema {
uuid: string;
Expand Down Expand Up @@ -56,6 +57,7 @@ export class CircularHeatmapComponent implements OnInit {
segment_labels: string[] = [];
activityDetails: any;
showOverlay: boolean;
markdown: md = md();

constructor(
private yaml: ymlService,
Expand Down

0 comments on commit 1b4ddad

Please sign in to comment.