Skip to content

Commit

Permalink
feat: #12 add simple template for square
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 3, 2020
1 parent 7a8be71 commit 4362eba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/app/shared/ledge-render/ledge-render.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
<div class="list-style list-style-{{item.config.type}}">
<div *ngFor="let listItem of item.data;let index = index;" class="list-style-item item-{{index}}">
{{listItem.name}}

<ng-template #recursiveList let-list>
<div *ngFor="let item of list" class="sub-item">
<div class="list-style-item">{{item.name}}</div>
<div *ngIf="item.children && item.children.length > 0">
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container>
</div>
</div>
</ng-template>
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: listItem.children }"></ng-container>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/ledge-render/ledge-render.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export class LedgeRenderComponent implements OnInit, AfterViewInit, OnChanges {
break;
case 'list-style':
const listData = LedgeMarkdownConverter.toJson(codeBlock.text);
console.log(listData.lists);
this.markdownData.push({
type: 'list-style',
data: listData.lists[0].children,
Expand Down
1 change: 1 addition & 0 deletions src/styles/mdstyles/_list-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
font-size: 1.2em;
padding: 3em 0 0 0;

.sub-item,
&.sub-item {
.list-style-item {
font-size: 0.8em;
Expand Down

0 comments on commit 4362eba

Please sign in to comment.