Skip to content

Commit

Permalink
feat: #12 <render> add process step syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 1, 2020
1 parent 6975385 commit bf76757
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
27 changes: 26 additions & 1 deletion src/app/presentation/ledge-helper/ledge-helper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ export class LedgeHelperComponent implements OnInit {
content = `
# Syntax Test
\`\`\`process-step
- 平台层
- 运维平台
- 小米私有云
- 小米生态云
- 能力层
- 团队注册
- 一键接入
- 检测扫描工具集成
- 发布部署
- 标准化工具接入
- 工具层
- Gitlab
- Phabricator
- Jenkins on K8s
- 代码质量扫描
- 安全/法律合规扫描
- 二进制&产出物存储
- 二进制安全扫描
- 二进制法务审计扫描
- 部署服务
- 数据层
- 数据智能应用
- 研发效能数据仓库
\`\`\`
\`\`\`javascript
console.log('hello, world');
\`\`\`
Expand All @@ -25,7 +51,6 @@ console.log('hello, world');
| Git | TSLint | Git (history) | Jasmine | GitHub Action | GitHub Traffic | GitHub Projects |
| GitHub | Code Climate | | Jest | | Google Analysis | |
\`\`\`
`;

constructor() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,19 @@
<div [innerHTML]="item.data"></div>
</div>

<div *ngSwitchCase="'process-step'">
<div class="markdown-process-step">
<div class="process-step-column" *ngFor="let row of item.data.childrens">
<div class="process-title">{{row.name}}</div>
<div class="process-body">
<div class="process-step-item" *ngFor="let cell of row.childrens">{{cell.name}}</div>
</div>
</div>
</div>
</div>

<div *ngSwitchCase="'process-table'">
<div class="process-table markdown-table">
{{stringify(item.data)}}
<div class="table-container" role="table" aria-label="Destinations">
<div class="flex-table header" role="rowgroup">
<div class="flex-row cell type_{{index}}" *ngFor="let header of item.data.header;let index = index;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ export class LedgeRenderComponent implements OnInit, AfterViewInit, OnChanges {
data: this.buildBarChartData(chartData.tables[0])
});
break;
case 'process-step':
const stepData = LedgeMarkdownConverter.toJson(codeBlock.text);
this.markdownData.push({
type: 'process-step',
data: stepData.lists[0]
});
break;
case 'process-table':
const tableData = LedgeMarkdownConverter.toJson(codeBlock.text);
this.markdownData.push({
Expand Down
3 changes: 2 additions & 1 deletion src/assets/docs/casestudies/xiaomi.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ config: {"type": "group-square"}


架构分析:

```process-step
- 平台层
- 运维平台
Expand All @@ -88,7 +89,7 @@ config: {"type": "group-square"}
- 工具层
- Gitlab
- Phabricator
-Jenkis on K8s
- Jenkins on K8s
- 代码质量扫描
- 安全/法律合规扫描
- 二进制&产出物存储
Expand Down

0 comments on commit bf76757

Please sign in to comment.