From 4f03856ba33c8e4bee266dbf41dc19dcb9970d10 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 1 May 2018 13:03:23 +0300 Subject: [PATCH] Scaffolding for the flavors page --- docs/build-docs.js | 59 ++++++++++++++++++++ docs/doc-fragments/buildYourOwnFlavor.js | 29 ++++++++++ docs/doc-fragments/customizationFragments.js | 4 ++ docs/doc-fragments/premadeFlavors.js | 7 +-- docs/v3/customization.html | 0 docs/v3/flavors.html | 34 +++++++++++ 6 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 docs/doc-fragments/buildYourOwnFlavor.js create mode 100644 docs/doc-fragments/customizationFragments.js create mode 100644 docs/v3/customization.html create mode 100644 docs/v3/flavors.html diff --git a/docs/build-docs.js b/docs/build-docs.js index 46a83f1..b7c14d7 100644 --- a/docs/build-docs.js +++ b/docs/build-docs.js @@ -190,3 +190,62 @@ fs.writeFile(docOutputPath, ${documentEnd}`, function(err) { if(err) return console.log(err); console.log("Documentation file generated!"); } ); + +// CUSTOMIZATION +var custFragments = require('./doc-fragments/customizationFragments'); // Gets all customization fragments as a list. +var custOutputPath = './docs/v3/flavors.html'; // This path is relative to package.json. + +var customizationStart = ` + + +mini.css - Flavors + + + + + + + + +`; +var customizationEnd = ``; + +var customizationAppShellStart = `
+ + + +  Github + + +  Docs + +
+
`; +var customizationAppShellEnd = `
`; + +var customizationAppSidebarStart = ` +`; + +var customizationMainStart = `
`; +var customizationMainEnd = `
`; + +var customizationFragments = custFragments.map(f => buildCustomizationFragment(f)).join('
'); +var customizationLinks = [buildLink(custFragments[0]), '
', ...custFragments[1].sections.map(f => buildLink(f))].join(''); + +function buildCustomizationFragment(fragment){ + var fragmentHtml = `
+

${fragment.title}

+
${fragment.content}
+
`; + return fragmentHtml; +} + +fs.writeFile(custOutputPath, + `${customizationStart}${customizationAppShellStart} + ${customizationAppSidebarStart}${customizationLinks}${customizationAppSidebarEnd} + ${customizationMainStart}${customizationFragments}${customizationMainEnd} + ${customizationAppShellEnd} + ${customizationEnd}`, + function(err) { if(err) return console.log(err); console.log("Flavors file generated!"); } +); diff --git a/docs/doc-fragments/buildYourOwnFlavor.js b/docs/doc-fragments/buildYourOwnFlavor.js new file mode 100644 index 0000000..57b1ab9 --- /dev/null +++ b/docs/doc-fragments/buildYourOwnFlavor.js @@ -0,0 +1,29 @@ +var version = require('../vinf').version; +module.exports = { + id: 'build-your-own-flavor', + title: 'Build your own flavor', + content: `

`, + sections: [ + {id: 'textual-content', title: 'Textual content'}, + {id: 'color-palette', title: 'Color palette'}, + {id: 'universal-styles', title: 'Universal styles'}, + {id: 'grid', title: 'Grid'}, + {id: 'cards', title: 'Cards'}, + {id: 'forms-and-input', title: 'Forms & input'}, + {id: 'buttons', title: 'Buttons'}, + {id: 'header', title: 'Header'}, + {id: 'navbar', title: 'Navigation bar'}, + {id: 'footer', title: 'Footer'}, + {id: 'menu-drawer', title: 'Menu drawer'}, + {id: 'tables', title: 'Tables'}, + {id: 'text-highlighting', title: 'Text highlighting'}, + {id: 'toasts', title: 'Toasts'}, + {id: 'tooltips', title: 'Tooltips'}, + {id: 'modals', title: 'Modal dialogs'}, + {id: 'collapse', title: 'Spoilers & accordions'}, + {id: 'progress', title: 'Progress bars'}, + {id: 'donut-spinner', title: 'Donut spinners'}, + {id: 'icons', title: 'Icons'}, + {id: 'utility', title: 'Utilities'} + ] +} diff --git a/docs/doc-fragments/customizationFragments.js b/docs/doc-fragments/customizationFragments.js new file mode 100644 index 0000000..a046f1c --- /dev/null +++ b/docs/doc-fragments/customizationFragments.js @@ -0,0 +1,4 @@ +var premadeFlavors = require('./premadeFlavors'); +var buildYourOwn = require('./buildYourOwnFlavor'); + +module.exports = [premadeFlavors, buildYourOwn] diff --git a/docs/doc-fragments/premadeFlavors.js b/docs/doc-fragments/premadeFlavors.js index 09399d2..ef6d062 100644 --- a/docs/doc-fragments/premadeFlavors.js +++ b/docs/doc-fragments/premadeFlavors.js @@ -2,10 +2,5 @@ var version = require('../vinf').version; module.exports = { id: 'prebuilt-flavors', title: 'Prebuilt flavors', - content: `

mini.css comes with a few prebuild flavors out of the box, so you can get started without having to finetune every little aspect of your CSS framework:

-
` + content: `

We have some prebuilt flavors:

` } diff --git a/docs/v3/customization.html b/docs/v3/customization.html new file mode 100644 index 0000000..e69de29 diff --git a/docs/v3/flavors.html b/docs/v3/flavors.html new file mode 100644 index 0000000..fdcb547 --- /dev/null +++ b/docs/v3/flavors.html @@ -0,0 +1,34 @@ + + + +mini.css - Flavors + + + + + + + + +
+ + + +  Github + + +  Docs + +
+
+ + +
+

Prebuilt flavors

+

We have some prebuilt flavors:

  • Default
  • Dark
+

+

Build your own flavor

+

+
+
+ \ No newline at end of file