Permalink
Browse files

feat(manual): global index

  • Loading branch information...
h13i32maru committed Dec 18, 2016
1 parent 0d30880 commit a887852316c2c29ea377ed67d9415bf11dc1b630
View
@@ -22,6 +22,7 @@
}
],
"manual": {
+ "globalIndex": true,
"asset": "./manual/asset",
"index": "./manual/index.md",
"overview": ["./manual/overview.md", "./manual/feature.md"],
@@ -239,6 +239,10 @@ export default class DocBuilder {
ice.drop('manualHeaderLink', !this._config.manual);
+ if (this._config.manual && this._config.manual.globalIndex) {
+ ice.drop('manualHeaderLink');
+ }
+
ice.load('nav', this._buildNavDoc());
return ice;
}
@@ -33,6 +33,12 @@ export default class ManualDocBuilder extends DocBuilder {
ice.attr('baseUrl', 'href', baseUrl, IceCap.MODE_WRITE);
ice.attr('rootContainer', 'class', ' manual-index');
callback(ice.html, fileName);
+
+ if (this._config.manual.globalIndex) {
+ ice.attr('baseUrl', 'href', './', IceCap.MODE_WRITE);
+ callback(ice.html, 'index.html');
+ }
+
ice.attr('rootContainer', 'class', ' manual-index', IceCap.MODE_REMOVE);
}
@@ -176,7 +182,7 @@ export default class ManualDocBuilder extends DocBuilder {
let card = `<h1>${label}</h1>`;
const nextAll = $el.nextAll();
- for (let i = 0 ; i < nextAll.length; i++) {
+ for (let i = 0; i < nextAll.length; i++) {
const next = nextAll.get(i);
const tagName = next.tagName.toLowerCase();
if (tagName === 'h1') return;
@@ -191,7 +197,7 @@ export default class ManualDocBuilder extends DocBuilder {
const ice = new IceCap(this._readTemplate('manualCardIndex.html'));
ice.loop('cards', cards, (i, card, ice)=>{
- ice.text('label', card.label) ;
+ ice.text('label', card.label);
ice.attr('link', 'href', card.link);
ice.load('card', card.card);
});
@@ -755,15 +755,15 @@ table.test-summary .test-target > span:first-child {
}
.manual-index .manual-card-wrap {
- width: 33%;
+ width: 25%;
padding: 10px 20px 10px 0;
box-sizing: border-box;
}
.manual-index .manual-card-wrap > h1 {
border: none;
margin: 0;
- font-size: 1.5em;
+ font-size: 1.2em;
}
.manual-index .manual-card {
View
@@ -19,7 +19,9 @@
* @property {string[]} [scripts=[]]
* @property {{type: string, source: string, includes: string[], excludes: string[]}} test
* @property {Object} [manual]
+ * @property {boolean} manual.globalIndex
* @property {string} manual.asset
+ * @property {string} manual.index
* @property {string[]} manual.overview
* @property {string[]} manual.design
* @property {string[]} manual.installation

0 comments on commit a887852

Please sign in to comment.