Skip to content

Commit

Permalink
feat(coverage): remove coverage badge hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Sep 19, 2016
1 parent a665c5d commit 6869b06
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 90 deletions.
1 change: 0 additions & 1 deletion doc/tutorial-example/my-project2/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<span class="esdoc-coverage"></span>
# My Project
this is My Project README
1 change: 0 additions & 1 deletion doc/tutorial-example/my-project3/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<span class="esdoc-coverage"></span>
# My Project
this is My Project README
1 change: 0 additions & 1 deletion doc/tutorial-example/my-project4/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<span class="esdoc-coverage"></span>
# My Project
this is My Project README
1 change: 0 additions & 1 deletion doc/tutorial-example/my-project5/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<span class="esdoc-coverage"></span>
# My Project
this is My Project README
25 changes: 0 additions & 25 deletions src/Publisher/Builder/DocBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,31 +1008,6 @@ export default class DocBuilder {
}
}

/**
* build coverage html.
* @param {CoverageObject} coverageObj - target coverage object.
* @returns {string} html of coverage badge.
* @private
* @deprecated
*/
_buildCoverageHTML(coverageObj) {
let coverage = Math.floor(100 * coverageObj.actualCount / coverageObj.expectCount);
let colorClass;
if (coverage < 50) {
colorClass = 'esdoc-coverage-low';
} else if (coverage < 90) {
colorClass = 'esdoc-coverage-middle';
} else {
colorClass = 'esdoc-coverage-high';
}

let html = `<a href="https://esdoc.org" class="esdoc-coverage-wrap">
<span class="esdoc-coverage-label">document</span><span class="esdoc-coverage-ratio ${colorClass}">${coverage}%</span>
</a>`;

return html;
}

//_buildAuthorHTML(doc, separator = '\n') {
// if (!doc.author) return '';
//
Expand Down
12 changes: 1 addition & 11 deletions src/Publisher/Builder/IndexDocBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ export default class IndexDocBuilder extends DocBuilder {
ice.load('index', indexContent);
}

let result = ice.html;

// fixme: deprecated
if (this._config.coverage) {
let $ = cheerio.load(result);
if ($('.esdoc-coverage').length) {
console.log('[deprecated] coverage badge is deprecated. use badge of ESDoc Hosting Service(https://doc.esdoc.org)');
}
}

return result;
return ice.html;
}
}
49 changes: 0 additions & 49 deletions src/Publisher/Builder/template/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -740,55 +740,6 @@ table.test-summary .test-target > span:first-child {
display: inline-block;
}

/* coverage badge */
.esdoc-coverage {
display: inline-block;
height: 20px;
vertical-align: top;
}

h1 .esdoc-coverage {
position: relative;
top: -4px;
}

.esdoc-coverage-wrap {
color: white;
font-size: 12px;
font-weight: 500;
}

.esdoc-coverage-label {
padding: 3px 4px 3px 6px;
background: linear-gradient(to bottom, #5e5e5e 0%,#4c4c4c 100%);
border-radius: 4px 0 0 4px;
display: inline-block;
height: 20px;
box-sizing: border-box;
line-height: 14px;
}

.esdoc-coverage-ratio {
padding: 3px 6px 3px 4px;
border-radius: 0 4px 4px 0;
display: inline-block;
height: 20px;
box-sizing: border-box;
line-height: 14px;
}

.esdoc-coverage-low {
background: linear-gradient(to bottom, #db654f 0%,#c9533d 100%);
}

.esdoc-coverage-middle {
background: linear-gradient(to bottom, #dab226 0%,#c9a179 100%);
}

.esdoc-coverage-high {
background: linear-gradient(to bottom, #4fc921 0%,#3eb810 100%);
}

.github-markdown .manual-toc {
padding-left: 0;
}
Expand Down
1 change: 0 additions & 1 deletion test/fixture/package/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Build Status](https://travis-ci.org/esdoc/esdoc.svg?branch=master)](https://travis-ci.org/esdoc/esdoc)
[![Coverage Status](https://coveralls.io/repos/esdoc/esdoc/badge.svg)](https://coveralls.io/r/esdoc/esdoc)
<span class="esdoc-coverage"></span>

# ESDoc Test Fixture
this is ESDoc Test Fixture README.
Expand Down

0 comments on commit 6869b06

Please sign in to comment.