Merge pull request #5691 from ninjadq/add_style_in_markdown

Add github flavered table in markdown
This commit is contained in:
Mia ZHOU 2018-08-23 14:07:51 +08:00 committed by GitHub
commit 17099240c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 83 additions and 33 deletions

View File

@ -1,37 +1,80 @@
.content-wrapper {
margin-top:20px;
padding: 0 0 0 15px;
margin-top: 20px;
padding: 0 0 0 15px;
.md-container {
border: solid 1px #ddd;
}
.summary-container {
padding: 0;
table {
background-color: #f2f2f2;
margin-top: 0.5rem;
}
.content-group {
margin-bottom: 30px;
}
.content-icon {
margin-right: 6px;
}
.text-wrapper {
word-break: break-all;
}
}
.cmd-title {
white-space: nowrap;
vertical-align: middle;
}
.cmd-content {
width: 100%;
}
}
.md-container {
border: solid 1px #ddd;
}
.summary-container {
padding:0;
table {
background-color: #F2F2F2;
margin-top: 0.5rem;
}
.content-group {
margin-bottom: 30px;
}
.content-icon {
margin-right: 6px;
}
.text-wrapper {
word-break: break-all;
}
@mixin align-text-mixin($values...) {
@each $var in $values {
&[align="$var"] {
text-align: $var;
}
}
}
.cmd-title {
white-space: nowrap;
vertical-align: middle;
}
%code-block {
background: #ddd;
border-radius: 2px;
padding: 2px 4px;
}
.cmd-content {
width: 100%;
.md-div {
::ng-deep {
code:not([class*="language-"]) {
@extend %code-block;
color: #657b83;
}
}
pre:not([class*="language-"]) {
background: #fdf6e3;
code:not([class*="language-"]) {
@extend %code-block;
background: transparent;
}
}
table {
display: block;
width: 100%;
overflow: auto;
padding: 0;
border-spacing: 0;
border-collapse: collapse;
margin-bottom: 16px;
td,
th {
padding: 6px 13px;
border: 1px solid #ddd;
@include align-text-mixin(left, right, center);
}
tr {
&:nth-child(2n) {
background-color: #f2f2f2;
}
}
}
}
}

View File

@ -160,9 +160,16 @@ export class ChartVersionComponent implements OnInit {
deleteVersions(versions: HelmChartVersion[]) {
if (versions && versions.length < 1) { return; }
let successCount: number;
let totalCount = this.chartVersions.length;
let versionObs = versions.map(v => this.deleteVersion(v));
Observable.forkJoin(versionObs).finally(() => this.refresh()).subscribe(res => {
if (this.chartVersions.length === versionObs.length) {
Observable.forkJoin(versionObs).finally(() => {
if (totalCount !== successCount) {
this.refresh();
}
}).subscribe(res => {
successCount = res.filter(r => r.state === OperationState.success).length;
if (totalCount === successCount) {
this.backEvt.emit();
}
});