Skip to content

Commit

Permalink
feat: use webcomponent replace to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 24, 2020
1 parent 41669fc commit de38dac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/presentation/design/design.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<component-path></component-path>
<component-markdown-render [src]="'assets/docs/design.md'"></component-markdown-render>
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ export class MarkdownRenderComponent implements OnInit, OnChanges, AfterViewInit
if (changes.src) {
this.mindmapIndex = 0;
this.chartIndex = 0;
this.webComponentsIndex = 0;
this.chartInfos = [];
this.mermaidData = [];
this.graphvizData = [];
this.webComponentsData = [];
}
}

Expand Down Expand Up @@ -155,7 +157,7 @@ export class MarkdownRenderComponent implements OnInit, OnChanges, AfterViewInit
setTimeout(() => this.renderEcharts(), 50);
setTimeout(() => this.gotoHeading(), 500);

setTimeout(() => this.loadWebComponents(), 100);
setTimeout(() => this.loadWebComponents(), 50);
}

private gotoHeading() {
Expand Down Expand Up @@ -622,7 +624,7 @@ export class MarkdownRenderComponent implements OnInit, OnChanges, AfterViewInit
data
});

return `<${data.name} class="webcomponents-plugins"></${data.name}>`;
return `<div class="webcomponents-plugins"><${data.name} id="${id}"></${data.name}></div>`;
}

private loadWebComponents() {
Expand Down
15 changes: 15 additions & 0 deletions src/assets/docs/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```webcomponents
{
"name": "wc-devops-path",
"src": "https://phodal.github.io/devops-path/path.js",
"props": []
}
```

```webcomponents
{
"name": "wc-devops-periodic",
"src": "https://phodal.github.io/devops-periodic/elements.js",
"props": []
}
```
8 changes: 0 additions & 8 deletions src/assets/docs/tool.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# 工具

```webcomponents
{
"name": "wc-devops-periodic",
"src": "https://phodal.github.io/devops-periodic/elements.js",
"props": []
}
```

DevOps 工具功能

```process-step
Expand Down

0 comments on commit de38dac

Please sign in to comment.