Skip to content

Commit a887852

Browse files
committed
feat(manual): global index
1 parent 0d30880 commit a887852

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

esdoc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
}
2323
],
2424
"manual": {
25+
"globalIndex": true,
2526
"asset": "./manual/asset",
2627
"index": "./manual/index.md",
2728
"overview": ["./manual/overview.md", "./manual/feature.md"],

src/Publisher/Builder/DocBuilder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ export default class DocBuilder {
239239

240240
ice.drop('manualHeaderLink', !this._config.manual);
241241

242+
if (this._config.manual && this._config.manual.globalIndex) {
243+
ice.drop('manualHeaderLink');
244+
}
245+
242246
ice.load('nav', this._buildNavDoc());
243247
return ice;
244248
}

src/Publisher/Builder/ManualDocBuilder.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ export default class ManualDocBuilder extends DocBuilder {
3333
ice.attr('baseUrl', 'href', baseUrl, IceCap.MODE_WRITE);
3434
ice.attr('rootContainer', 'class', ' manual-index');
3535
callback(ice.html, fileName);
36+
37+
if (this._config.manual.globalIndex) {
38+
ice.attr('baseUrl', 'href', './', IceCap.MODE_WRITE);
39+
callback(ice.html, 'index.html');
40+
}
41+
3642
ice.attr('rootContainer', 'class', ' manual-index', IceCap.MODE_REMOVE);
3743
}
3844

@@ -176,7 +182,7 @@ export default class ManualDocBuilder extends DocBuilder {
176182
let card = `<h1>${label}</h1>`;
177183
const nextAll = $el.nextAll();
178184

179-
for (let i = 0 ; i < nextAll.length; i++) {
185+
for (let i = 0; i < nextAll.length; i++) {
180186
const next = nextAll.get(i);
181187
const tagName = next.tagName.toLowerCase();
182188
if (tagName === 'h1') return;
@@ -191,7 +197,7 @@ export default class ManualDocBuilder extends DocBuilder {
191197

192198
const ice = new IceCap(this._readTemplate('manualCardIndex.html'));
193199
ice.loop('cards', cards, (i, card, ice)=>{
194-
ice.text('label', card.label) ;
200+
ice.text('label', card.label);
195201
ice.attr('link', 'href', card.link);
196202
ice.load('card', card.card);
197203
});

src/Publisher/Builder/template/css/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,15 @@ table.test-summary .test-target > span:first-child {
755755
}
756756

757757
.manual-index .manual-card-wrap {
758-
width: 33%;
758+
width: 25%;
759759
padding: 10px 20px 10px 0;
760760
box-sizing: border-box;
761761
}
762762

763763
.manual-index .manual-card-wrap > h1 {
764764
border: none;
765765
margin: 0;
766-
font-size: 1.5em;
766+
font-size: 1.2em;
767767
}
768768

769769
.manual-index .manual-card {

src/Typedef/typedef.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
* @property {string[]} [scripts=[]]
2020
* @property {{type: string, source: string, includes: string[], excludes: string[]}} test
2121
* @property {Object} [manual]
22+
* @property {boolean} manual.globalIndex
2223
* @property {string} manual.asset
24+
* @property {string} manual.index
2325
* @property {string[]} manual.overview
2426
* @property {string[]} manual.design
2527
* @property {string[]} manual.installation

0 commit comments

Comments
 (0)