From a6e14b2643c6434e75dc339d1f99fec3c7ea90ff Mon Sep 17 00:00:00 2001 From: Ken Hawkins Date: Fri, 27 Nov 2020 10:52:37 +0100 Subject: [PATCH] chore: swap vf-core dev theme to mandlebrot (#1262) Following conversations in #1260 and #1261, we don't really need a custom fractal theme anymore. This swaps back to the default theme for vf-core development. It also removes the vf-frctl-theme (which could still be resurrected from npm, if needed) --- .../developing/getting-started/structure.njk | 19 +-- tools/vf-config/index.js | 2 +- tools/vf-core/package.json | 3 +- tools/vf-frctl-theme/.gitignore | 5 - tools/vf-frctl-theme/.npmignore | 15 -- tools/vf-frctl-theme/CHANGELOG.md | 15 -- tools/vf-frctl-theme/LICENSE | 27 ---- tools/vf-frctl-theme/README.md | 21 --- tools/vf-frctl-theme/dist/css/default.css | 40 ------ tools/vf-frctl-theme/index.js | 3 - tools/vf-frctl-theme/package.json | 26 ---- .../vf-frctl-theme/src/extensions/markdown.js | 88 ------------ tools/vf-frctl-theme/src/extensions/render.js | 59 -------- tools/vf-frctl-theme/src/filters.js | 85 ----------- tools/vf-frctl-theme/src/theme.js | 136 ------------------ tools/vf-frctl-theme/views/layouts/doc.njk | 36 ----- tools/vf-frctl-theme/views/layouts/frame.njk | 10 -- tools/vf-frctl-theme/views/layouts/pen.njk | 39 ----- tools/vf-frctl-theme/views/layouts/pjax.njk | 3 - tools/vf-frctl-theme/views/layouts/render.njk | 14 -- .../vf-frctl-theme/views/layouts/skeleton.njk | 27 ---- tools/vf-frctl-theme/views/macros/errors.njk | 13 -- tools/vf-frctl-theme/views/macros/image.njk | 5 - .../views/macros/navigation.njk | 40 ------ tools/vf-frctl-theme/views/macros/render.njk | 11 -- tools/vf-frctl-theme/views/macros/status.njk | 48 ------- .../views/pages/components/detail.njk | 4 - .../views/pages/components/preview.njk | 5 - .../views/pages/components/render.njk | 5 - tools/vf-frctl-theme/views/pages/doc.njk | 62 -------- tools/vf-frctl-theme/views/pages/error.njk | 21 --- .../views/partials/browser/browser.njk | 22 --- .../views/partials/browser/component-list.njk | 63 -------- .../views/partials/browser/panel-html.njk | 21 --- .../views/partials/browser/panel-info.njk | 33 ----- .../views/partials/browser/panel-notes.njk | 9 -- .../partials/browser/panel-resources.njk | 54 ------- .../views/partials/content/overview.njk | 32 ----- tools/vf-frctl-theme/views/partials/foot.njk | 25 ---- .../vf-frctl-theme/views/partials/header.njk | 23 --- .../views/partials/navigation/assets.njk | 8 -- .../views/partials/navigation/components.njk | 3 - .../views/partials/navigation/docs.njk | 5 - .../views/partials/navigation/navigation.njk | 7 - .../views/partials/pen/browser.njk | 21 --- .../views/partials/pen/header.njk | 4 - .../views/partials/pen/preview.njk | 86 ----------- .../views/partials/stylesheets.njk | 8 -- 48 files changed, 13 insertions(+), 1298 deletions(-) delete mode 100644 tools/vf-frctl-theme/.gitignore delete mode 100644 tools/vf-frctl-theme/.npmignore delete mode 100644 tools/vf-frctl-theme/CHANGELOG.md delete mode 100644 tools/vf-frctl-theme/LICENSE delete mode 100644 tools/vf-frctl-theme/README.md delete mode 100644 tools/vf-frctl-theme/dist/css/default.css delete mode 100644 tools/vf-frctl-theme/index.js delete mode 100644 tools/vf-frctl-theme/package.json delete mode 100644 tools/vf-frctl-theme/src/extensions/markdown.js delete mode 100644 tools/vf-frctl-theme/src/extensions/render.js delete mode 100644 tools/vf-frctl-theme/src/filters.js delete mode 100644 tools/vf-frctl-theme/src/theme.js delete mode 100644 tools/vf-frctl-theme/views/layouts/doc.njk delete mode 100644 tools/vf-frctl-theme/views/layouts/frame.njk delete mode 100644 tools/vf-frctl-theme/views/layouts/pen.njk delete mode 100644 tools/vf-frctl-theme/views/layouts/pjax.njk delete mode 100644 tools/vf-frctl-theme/views/layouts/render.njk delete mode 100644 tools/vf-frctl-theme/views/layouts/skeleton.njk delete mode 100644 tools/vf-frctl-theme/views/macros/errors.njk delete mode 100644 tools/vf-frctl-theme/views/macros/image.njk delete mode 100644 tools/vf-frctl-theme/views/macros/navigation.njk delete mode 100644 tools/vf-frctl-theme/views/macros/render.njk delete mode 100644 tools/vf-frctl-theme/views/macros/status.njk delete mode 100644 tools/vf-frctl-theme/views/pages/components/detail.njk delete mode 100644 tools/vf-frctl-theme/views/pages/components/preview.njk delete mode 100644 tools/vf-frctl-theme/views/pages/components/render.njk delete mode 100644 tools/vf-frctl-theme/views/pages/doc.njk delete mode 100644 tools/vf-frctl-theme/views/pages/error.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/browser.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/component-list.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/panel-html.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/panel-info.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/panel-notes.njk delete mode 100644 tools/vf-frctl-theme/views/partials/browser/panel-resources.njk delete mode 100644 tools/vf-frctl-theme/views/partials/content/overview.njk delete mode 100644 tools/vf-frctl-theme/views/partials/foot.njk delete mode 100644 tools/vf-frctl-theme/views/partials/header.njk delete mode 100644 tools/vf-frctl-theme/views/partials/navigation/assets.njk delete mode 100644 tools/vf-frctl-theme/views/partials/navigation/components.njk delete mode 100644 tools/vf-frctl-theme/views/partials/navigation/docs.njk delete mode 100644 tools/vf-frctl-theme/views/partials/navigation/navigation.njk delete mode 100644 tools/vf-frctl-theme/views/partials/pen/browser.njk delete mode 100644 tools/vf-frctl-theme/views/partials/pen/header.njk delete mode 100644 tools/vf-frctl-theme/views/partials/pen/preview.njk delete mode 100644 tools/vf-frctl-theme/views/partials/stylesheets.njk diff --git a/tools/vf-component-library/src/site/developing/getting-started/structure.njk b/tools/vf-component-library/src/site/developing/getting-started/structure.njk index ffd6b7f810..6d0435402f 100644 --- a/tools/vf-component-library/src/site/developing/getting-started/structure.njk +++ b/tools/vf-component-library/src/site/developing/getting-started/structure.njk @@ -27,9 +27,8 @@ You can find the Design Tokens in `vf-core/components/vf-design-tokens`. The `vf-core` repo contains three types of files: 1. Components that are located in `./components` -2. Build scripts located in the root of the project (mainly) -3. The web interface `./tools/vf-frctl-theme` - +2. Build scripts located in the `.tools/` of the project (mainly) +3. The public web interface `./tools/vf-component-library` ## Detailed overview @@ -44,13 +43,17 @@ The `vf-core` repo contains three types of files: | | ... │ └── vf-video-teaser ├── docs (documentation files for the web interface) - ├── fractal.js (configuration for the web component library) - ├── gulpfile.js ├── lerna.json ├── package.json ├── public (dynamic folder used for rendering of global CSS, JS, component assets) └── tools - ├── component-generator (make new components) - ├── css-generator (build requirement) - └── vf-frctl-theme (web interface) + ├── vf-component-generator (make new components) + ├── vf-component-initilization (collect components from the file system) + ├── vf-component-library (web interface) + ├── vf-core (the central build process) + | ├── gulpfile.js + | └── fractal.js (configuration for the web component library) + ├── vf-frctl-extensions (extensions useful when manipulating Fractal-specific data) + ├── vf-extensions (reusable utilities for VF projects) + └── vf-sass-compilation (compile invites) diff --git a/tools/vf-config/index.js b/tools/vf-config/index.js index 6b8bb9a677..fe44c0820d 100644 --- a/tools/vf-config/index.js +++ b/tools/vf-config/index.js @@ -42,7 +42,7 @@ global.vfName = config.vfConfig.vfName || "Visual Framework 2.0"; global.vfNamespace = config.vfConfig.vfNamespace || "vf-"; global.vfComponentPath = config.vfConfig.vfComponentPath || path.resolve('.', 'components'); global.vfBuildDestination = config.vfConfig.vfBuildDestination || 'temp/build-files'; -global.vfThemePath = config.vfConfig.vfThemePath || './tools/vf-frctl-theme'; +global.vfThemePath = config.vfConfig.vfThemePath || '@frctl/mandelbrot'; global.vfBuildFractalMode = config.vfConfig.vfBuildFractalMode || 'normal'; global.vfVersion = vfCoreConfig.version || 'not-specified'; const componentPath = path.resolve('.', global.vfComponentPath).replace(/\\/g, '/'); diff --git a/tools/vf-core/package.json b/tools/vf-core/package.json index 9ee94d3cb7..21152aed25 100644 --- a/tools/vf-core/package.json +++ b/tools/vf-core/package.json @@ -8,7 +8,7 @@ "vfName": "Visual Framework 2.0", "vfHomepage": "https://stable.visual-framework.dev", "vfBuildFractalMode": "normal", - "vfThemePath": "@visual-framework/vf-frctl-theme", + "vfThemePath": "@frctl/mandelbrot", "vfComponentPath": "../../components" }, "scripts": { @@ -28,7 +28,6 @@ "@visual-framework/vf-component-generator": "^1.0.4", "@visual-framework/vf-component-initialization": "^1.1.1", "@visual-framework/vf-frctl-extensions": "^1.0.0-alpha.2", - "@visual-framework/vf-frctl-theme": "^1.0.4", "@visual-framework/vf-sass-compilation": "^1.0.3", "chalk": "^4.0.0", "del": "^6.0.0", diff --git a/tools/vf-frctl-theme/.gitignore b/tools/vf-frctl-theme/.gitignore deleted file mode 100644 index b88ead1d91..0000000000 --- a/tools/vf-frctl-theme/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -# We commit `dist` -# So we don't have to npm install and gulp for ci to get 1 css file. -# Depending if we stick with this or use 11ty as a component/pattern library, we'll need revisit. -#dist diff --git a/tools/vf-frctl-theme/.npmignore b/tools/vf-frctl-theme/.npmignore deleted file mode 100644 index 8c1ef811a4..0000000000 --- a/tools/vf-frctl-theme/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -components -bin -.github -.travis.yml -CHANGELOG.md -CONTRIBUTING.md -public -build -.max-age -.gitlab-ci.yml -temp -backstop_data -yarn.lock -node_modules diff --git a/tools/vf-frctl-theme/CHANGELOG.md b/tools/vf-frctl-theme/CHANGELOG.md deleted file mode 100644 index da85635030..0000000000 --- a/tools/vf-frctl-theme/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -### 1.0.2 - -- adds 'context' for the logo - -### 1.0.1 - -- Makes use of 'full width' which is useful for componets using `vf-u-fullbleed` or similar - -### 1.0.0 - -- updates to fractal theme layout - -### 0.0.2-alpha.0 - -- Version bump only for package @visual-framework/vf-frctl-theme diff --git a/tools/vf-frctl-theme/LICENSE b/tools/vf-frctl-theme/LICENSE deleted file mode 100644 index 0f00613512..0000000000 --- a/tools/vf-frctl-theme/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Forked from `@fractal/mandelbrot` by EMBL. - -This file incorporates work covered by the following copyright and -permission notice: - -The MIT License (MIT) - -Copyright (c) 2016 Clearleft - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/vf-frctl-theme/README.md b/tools/vf-frctl-theme/README.md deleted file mode 100644 index a69eea4084..0000000000 --- a/tools/vf-frctl-theme/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# VF Fractal Theme - -The default web UI theme for the VF 2.0. - -Forked (and heavily changed) from the default Fractal Mandelbrot theme, but you -will still find value in the Fractal [documentation](http://fractal.build/guide) -for details on configuration. - -## Major differences from Mandelbrot - -- Much less CSS, JS - - Instead we leverage the core VF library -- Exposes components directly to the template layer - - build the component library with your components `{% "@vf-component" %}` -- Theme layer uses `.njk` instead of `.nunj` - -## History - -### 0.0.1 - -Initial release, fork of `@fractal/mandelbrot` diff --git a/tools/vf-frctl-theme/dist/css/default.css b/tools/vf-frctl-theme/dist/css/default.css deleted file mode 100644 index 0899cd3f3d..0000000000 --- a/tools/vf-frctl-theme/dist/css/default.css +++ /dev/null @@ -1,40 +0,0 @@ -/* Edge cases just for the component library */ -/* Ensure the nested iframe preview of components is appropretly sized */ -.Pen-panel { - height: auto !important; -} -.Pen-panel .Preview-iframe { - width: 100%; -} - -.Preview-iframe { - border: 1px solid rgba(0, 0, 0, .1); - border-left: 0; - border-right: 0; - padding: 2rem 0; -} -.Frame-body { - grid-column: 2 / -2; -} - -.Pen { grid-column: 1 / -1; } -.Pen .vf-page-header__heading { grid-column: 2 / -2; } -.Pen .component-info { grid-column: 2 / -2; } -.Pen .vf-tabs { grid-column: 2 / -2; } -.Preview { - margin-left: calc(50% - 50vw); - width: 100vw; -} -.preview-component-list { grid-column: 2 / -2; } -.Preview-wrapper .vf-figure__caption { - margin: 0 auto; - max-width: 87.5em; - padding: 0 16px; - width: 100%; -} - -.Pen { - margin: 0 auto; - max-width: var(--vf-body-width); - padding: 0; -} diff --git a/tools/vf-frctl-theme/index.js b/tools/vf-frctl-theme/index.js deleted file mode 100644 index 2ef42299f8..0000000000 --- a/tools/vf-frctl-theme/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./src/theme'); diff --git a/tools/vf-frctl-theme/package.json b/tools/vf-frctl-theme/package.json deleted file mode 100644 index 6356f734b7..0000000000 --- a/tools/vf-frctl-theme/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "author": { - "name": "EMBL", - "email": "ken.hawkins@embl.de" - }, - "bugs": { - "url": "https://github.com/visual-framework/vf-frctl-theme/issues" - }, - "description": "The default theme for the Visual Framework component library.", - "homepage": "https://github.com/visual-framework/vf-frctl-theme#readme", - "license": "MIT", - "main": "index.js", - "name": "@visual-framework/vf-frctl-theme", - "repository": { - "type": "git", - "url": "git+https://github.com/visual-framework/vf-frctl-theme.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 0" - }, - "publishConfig": { - "access": "public" - }, - "version": "1.0.4", - "gitHead": "bc7aae5f4d394bb907d39e4adfb471da248de474" -} diff --git a/tools/vf-frctl-theme/src/extensions/markdown.js b/tools/vf-frctl-theme/src/extensions/markdown.js deleted file mode 100644 index eb6bab078a..0000000000 --- a/tools/vf-frctl-theme/src/extensions/markdown.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const renderMarkdown = require('marked'); -const nunjucks = require('nunjucks'); - -// Add support for markdown blocks inside html -// Sample: -/* -
-{% markdown %} -## Tip! -Confused? Rule of thumb: if you use a component to make other components, name it for what is (i.e. "vf-box"). -{% endmarkdown %} -
-*/ - -// Note: The structure of this file's paramaters are slightly different so we can't easily reuse the /tools/vf-frctl-extensions/markdown.js -// Though it might be something we revisit - -module.exports = function(theme, env, app, fractal){ - - // port of https://github.com/zephraph/nunjucks-markdown - // Licence: https://github.com/zephraph/nunjucks-markdown/blob/master/LICENSE - function MarkdownExtenstion() { - - this.tags = ['markdown']; - - this.parse = function(parser, nodes, lexer) { - var tok = parser.nextToken(); - - // Parse the markdown tag and collect any arguments - var args = parser.parseSignature(null, true); - parser.advanceAfterBlockEnd(tok.value); - - // If arguments, return the fileTag constructed node - if(args.children.length > 0) - return new nodes.CallExtension(this, 'fileTag', args); - - // Otherwise parse until the close block and move the parser to the next position - var body = parser.parseUntilBlocks('endmarkdown'); - - // I found Nunjucks to be incredibly convoluted on how to just get some data into the BlockTag function, - // this finally worked by faking another template node. - var tabStart = new nodes.NodeList(0, 0, [new nodes.Output(0, 0, [new nodes.TemplateData(0, 0, (tok.colno - 1))])]); - - parser.advanceAfterBlockEnd(); - - // Return the constructed blockTag node - return new nodes.CallExtension(this, 'run', args, [body, tabStart]); - }; - - // Markdown rendering for the file tag. Use the nunjucks.render function to render - // the actual contents of the file. Pass the results through the markdown renderer. - this.fileTag = function(environment, file) { - return new nunjucks.runtime.SafeString(renderMarkdown(env.render(file, environment.ctx))); - } - - // Markdown rendering for the block. Pretty simple, just get the body text and pass - // it through the markdown renderer. - this.run = function(context, body, tabStart) { - - var body = body(); - var spacesRegex = /^[\s]+/; - var tabStart = tabStart(); // The column postion of the {% markdown %} tag. - - if (tabStart > 0) { // If the {% markdown %} tag is tabbed in, normalize the content to the same depth. - body = body.split(/\r?\n/); // Split into lines. - body = body.map(function(line) { - var startSpaces = line.match(spacesRegex); - if (startSpaces && startSpaces[0].length >= tabStart) { // If the content is not at the same or greater tab depth, do nothing.. - return line.slice(tabStart); // Subtract the column postion from the start of the string. - } else if (startSpaces) { - return line.slice(startSpaces[0].length); - } else { - return line; - } - }); - body = body.join("\n"); // Rejoin into one string. - } - - return new nunjucks.runtime.SafeString(renderMarkdown(body)); - } - - } - - env.engine.addExtension('markdown', new MarkdownExtenstion()); - -}; diff --git a/tools/vf-frctl-theme/src/extensions/render.js b/tools/vf-frctl-theme/src/extensions/render.js deleted file mode 100644 index f1bcbd1769..0000000000 --- a/tools/vf-frctl-theme/src/extensions/render.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const _ = require('lodash'); -const Path = require('path'); -const beautifyHTML = require('js-beautify').html; -const utils = require('@frctl/fractal').utils; - -module.exports = function(theme, env, app, fractal){ - - // port of https://github.com/frctl/nunjucks/blob/develop/src/extensions/render.js - function RenderExtension() { - - this.tags = ['render']; - - this.parse = function (parser, nodes) { - var tok = parser.nextToken(); - var args = parser.parseSignature(null, true); - parser.advanceAfterBlockEnd(tok.value); - return new nodes.CallExtensionAsync(this, 'run', args); - }; - - this.run = function () { - - const source = fractal.components; - const args = Array.from(arguments); - const rootContext = args[0].ctx; - const callback = args.pop(); - args.shift(); - const handle = args[0]; - let context = args[1]; - const merge = args[2] || false; - const entity = source.find(handle); - if (!entity) { - throw new Error(`Could not render component '${handle}' - component not found.`); - } - const defaultContext = entity.isComponent ? entity.variants().default().context : entity.context; - if (!context) { - context = defaultContext; - } else if (merge) { - context = utils.defaultsDeep(context, defaultContext); - } - - source.resolve(context).then(context => { - // fix env for rendered components - // let env = JSON.parse(JSON.stringify(rootContext._env)); - context._env = env; - entity.render(context).then(html => { - callback(null, html); - }).catch(err => { - callback(err); - }); - }); - }; - } - - env.engine.addExtension('render', new RenderExtension()); - - - }; diff --git a/tools/vf-frctl-theme/src/filters.js b/tools/vf-frctl-theme/src/filters.js deleted file mode 100644 index 465c5fd930..0000000000 --- a/tools/vf-frctl-theme/src/filters.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const _ = require('lodash'); -const Path = require('path'); -const beautifyHTML = require('js-beautify').html; -const utils = require('@frctl/fractal').utils; - -module.exports = function(theme, env, app, fractal) { - - env.engine.addFilter('path', function(path){ - let request = env.request || this.lookup('_request'); - return (! env || env.server) ? path : utils.relUrlPath(path, _.get(request, 'path', '/'), fractal.web.get('builder.urls')); - }); - - env.engine.addFilter('url', function(item){ - if (item.isDoc) { - if (!item.path) { - return '/'; - } - return theme.urlFromRoute('page', {path: item.path}); - } else if (item.isComponent || item.isVariant) { - return theme.urlFromRoute('component', {handle: item.handle}); - } else if (item.isAssetSource) { - return theme.urlFromRoute('asset-source', {name: item.name}); - } else if (item.isAsset) { - return Path.join('/', app.get('web.assets.mount'), item.srcPath); - } - throw new Error(`Cannot generate URL for ${item}`); - }); - - env.engine.addFilter('beautify', function(str) { - const defaults = { - indent_size: 4, - preserve_newlines: true, - max_preserve_newlines: 1 - }; - - let beautifyOptions = theme.getOption('beautify') || {}; - - if (typeof beautifyOptions === 'function') { - return beautifyOptions(str); - } - - beautifyOptions = _.merge({}, defaults, beautifyOptions); - - return beautifyHTML(str, beautifyOptions); - }); - - env.engine.addFilter('resourceUrl', function(str) { - return `/${app.web.get('assets.mount')}/components/${Path.relative(Path.resolve(app.components.get('path')), Path.resolve(str))}`; - }); - - env.engine.addFilter('componentPath', function(str) { - return Path.relative(process.cwd(), Path.join(app.components.get('path'), Path.relative(Path.resolve(app.components.get('path')), Path.resolve(str)))); - }); - - env.engine.addFilter('fileSize', function formatBytes(bytes, decimals) { - if(bytes == 0) return '0 Byte'; - let k = 1000; // or 1024 for binary - let dm = decimals + 1 || 3; - let sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; - let i = Math.floor(Math.log(bytes) / Math.log(k)); - return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; - }); - - env.engine.addFilter('linkRefs', function(str, item) { - if (! (item.isComponent || item.isVariant)) { - return str; - } - const refs = item.references; - return str.replace(new RegExp(`(${refs.map(r => `\@${r.handle}`).join('|')})`, 'g'), (handle) => { - try { - let url = theme.urlFromRoute('component', { - handle: handle.replace('@', '') - }); - const pathify = env.engine.getGlobal('path'); - url = pathify.call(this, url); - return `${handle}`; - } catch(e) { - return handle; - } - }); - }); - - }; diff --git a/tools/vf-frctl-theme/src/theme.js b/tools/vf-frctl-theme/src/theme.js deleted file mode 100644 index ef177757f2..0000000000 --- a/tools/vf-frctl-theme/src/theme.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -const Path = require('path'); -const _ = require('lodash'); -const Theme = require('@frctl/fractal').WebTheme; -const packageJSON = require('../package.json'); - -module.exports = function(options, fractal){ - - const config = _.defaultsDeep(_.clone(options || {}), { - skin: 'default', - rtl: false, - lang: 'en', - styles: 'default', - scripts: 'default', - format: 'YAML', - static: { - mount: 'themes/vf-frctl-theme', - }, - version: packageJSON.version, - favicon: null - }); - - // config.panels = config.panels || ['html', 'view', 'context', 'resources', 'info', 'notes']; - config.panels = config.panels || ['html', 'resources', 'info']; - config.nav = config.nav || ['components','docs','assets']; - config.styles = [].concat(config.styles).concat(config.stylesheet).filter(url => url).map(url => (url === 'default' ? `/${config.static.mount}/css/${config.skin}.css` : url)); - config.scripts = [].concat(config.scripts).filter(url => url).map(url => (url === 'default' ? `/${config.static.mount}/js/vf-frctl-theme.js` : url)); - config.favicon = config.favicon || `/${config.static.mount}/favicon.ico`; - - const assetSourceName = 'components'; - - const theme = new Theme(Path.join(__dirname, '..', 'views'), config); - - // console.log(fractal); - - theme.setErrorView('pages/error.njk'); - - theme.addStatic(Path.join(__dirname, '..' , 'dist'), `/${config.static.mount}`); - - theme.addRoute('/', { - handle: 'overview', - view: 'pages/doc.njk', - }); - - theme.addRoute('/docs', { - redirect: '/' - }); - - theme.addRoute('/components', { - redirect: '/' - }); - - theme.addRoute('/assets', { - redirect: '/' - }); - - theme.addRoute('/assets/:name', { - handle: 'asset-source', - view: 'pages/assets.njk' - }, function(app){ - return app.assets.visible().map(asset => ({name: asset.name})); - }); - - theme.addRoute('/components/preview/:handle', { - handle: 'preview', - view: 'pages/components/preview.njk' - }, getHandles); - - theme.addRoute('/components/render/:handle', { - handle: 'render', - view: 'pages/components/render.njk' - }, getHandles); - - theme.addRoute('/components/detail/:handle', { - handle: 'component', - view: 'pages/components/detail.njk' - }, getHandles); - - theme.addRoute('/components/raw/:handle/:asset', { - handle: 'component-resource', - static: function(params, app){ - const component = app.components.find(`@${params.handle}`); - if (component) { - return Path.join(component.viewDir, params.asset); - } - throw new Error('Component not found'); - } - }, getResources); - - theme.addRoute('/docs/:path([^\?]+?)', { - handle: 'page', - view: 'pages/doc.njk' - }, function(app){ - return app.docs.filter(d => (!d.isHidden && d.path !== '')).flatten().map(page => ({path: page.path})); - }); - - theme.on('init', function(env, app){ - require('./filters')(theme, env, app, fractal); - require('./extensions/render.js')(theme, env, app, fractal); - require('./extensions/markdown.js')(theme, env, app, fractal); - }); - - let handles = null; - - function getHandles(app) { - app.components.on('updated', () => (handles = null)); - if (handles) { - return handles; - } - handles = []; - app.components.flatten().each(comp => { - handles.push(comp.handle); - if (comp.variants().size > 1) { - comp.variants().each(variant => handles.push(variant.handle)); - } - }); - handles = handles.map(h => ({handle: h})); - return handles; - } - - function getResources(app) { - let params = []; - app.components.flatten().each(comp => { - params = params.concat(comp.resources().flatten().toArray().map(res => { - return { - handle: comp.handle, - asset: res.base - }; - })); - }); - return params; - } - - return theme; -}; diff --git a/tools/vf-frctl-theme/views/layouts/doc.njk b/tools/vf-frctl-theme/views/layouts/doc.njk deleted file mode 100644 index d1deb2ba4c..0000000000 --- a/tools/vf-frctl-theme/views/layouts/doc.njk +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "layouts/pjax.njk" if request.isPjax else "layouts/frame.njk" %} - -{% block content %} - - -
-
- -
-
-

{{ page.title }} {% if status.length >= 3 %}{{ status.val }}{% else %}alpha{% endif %}

- {% if page.lede %} -

{{ page.lede }}

- {% endif %} - {% if page.intro %} -

{{ page.intro }}

- {% endif %} -
-
- {% if docContent %} -
-
- - {% block docContent %}{% endblock %} - -
-
- {% endif %} - - {% if request.path == '/' %} - {# Only show component list on documentation homepage #} - {% include 'partials/content/overview.njk' %} - {% endif %} - - -{% endblock %} diff --git a/tools/vf-frctl-theme/views/layouts/frame.njk b/tools/vf-frctl-theme/views/layouts/frame.njk deleted file mode 100644 index 9b9dbe6f6f..0000000000 --- a/tools/vf-frctl-theme/views/layouts/frame.njk +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "layouts/skeleton.njk" %} -{% import "macros/navigation.njk" as nav %} - -{% block page %} - -{% include 'partials/header.njk' %} - - {% block content %}{% endblock %} - -{% endblock %} diff --git a/tools/vf-frctl-theme/views/layouts/pen.njk b/tools/vf-frctl-theme/views/layouts/pen.njk deleted file mode 100644 index bf239f1638..0000000000 --- a/tools/vf-frctl-theme/views/layouts/pen.njk +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "layouts/pjax.njk" if request.isPjax else "layouts/frame.njk" %} -{% import "macros/image.njk" as img %} -{% import "macros/status.njk" as status %} -{% import "macros/errors.njk" as errors %} - -{% set page = { - title: entity.title -} %} - -{% set previewUrl = path(frctl.theme.urlFromRoute('preview', {handle: entity.handle})) %} - -{% block content %} - -{% if frctl.env.server and frctl.env.sync %} - {% set rendered = false %} -{% else %} - {% set rendered = entity.render(null, renderEnv, { preview: true, collate: true }) | async(true) %} - {% if rendered | isError %} - {% set error = rendered %} - {% set renderError %}{{ errors.renderError('component', error.message) }}{% endset %} - {% set rendered = false %} - {% endif %} -{%- endif %} - -
- - {% block penContent %} - - {% include "partials/pen/header.njk" %} - - {% include "partials/pen/preview.njk" %} - - {% include "partials/pen/browser.njk" %} - - {% endblock %} - -
- -{% endblock %} diff --git a/tools/vf-frctl-theme/views/layouts/pjax.njk b/tools/vf-frctl-theme/views/layouts/pjax.njk deleted file mode 100644 index c8b3c45da2..0000000000 --- a/tools/vf-frctl-theme/views/layouts/pjax.njk +++ /dev/null @@ -1,3 +0,0 @@ -
-{% block content %}{% endblock %} -
diff --git a/tools/vf-frctl-theme/views/layouts/render.njk b/tools/vf-frctl-theme/views/layouts/render.njk deleted file mode 100644 index c142f13d20..0000000000 --- a/tools/vf-frctl-theme/views/layouts/render.njk +++ /dev/null @@ -1,14 +0,0 @@ -{% if not entity %}{{ throw(404, "Component '" + request.params.handle + "' not found.") }}{% endif -%} - -{% set rendered = entity.render(null, renderEnv, { preview: withLayout, collate: withCollation }) | async(true) %} - -{% if rendered | isError -%} -{% extends 'layouts/frame.njk' %} -{% set error = rendered %} -{% set page = { - title: 'Error rendering component ' + request.params.handle -} %} -{% block content -%}{% import "macros/errors.njk" as errors -%}{{ errors.renderError('component', error.message, error.stack) }}{% endblock %} -{%- else -%} -{{ rendered }} -{%- endif %} diff --git a/tools/vf-frctl-theme/views/layouts/skeleton.njk b/tools/vf-frctl-theme/views/layouts/skeleton.njk deleted file mode 100644 index 11fa2c006f..0000000000 --- a/tools/vf-frctl-theme/views/layouts/skeleton.njk +++ /dev/null @@ -1,27 +0,0 @@ - - - - {% render '@vf-no-js' %} - {% if page.title %}{{ page.title }} component | {% endif %}{{ frctl.get('project.title') }} - - - {% render '@vf-favicon' %} - {% if _config.project.environment.local %} - - {% endif %} - {% if _config.project.environment.production %} - - {% endif %} - - {% render '@vf-polyfill-js' %} - {% include 'partials/stylesheets.njk' %} - - -{% block page %}{% endblock %} -{% include 'partials/foot.njk' %} - - diff --git a/tools/vf-frctl-theme/views/macros/errors.njk b/tools/vf-frctl-theme/views/macros/errors.njk deleted file mode 100644 index 0c6df322bd..0000000000 --- a/tools/vf-frctl-theme/views/macros/errors.njk +++ /dev/null @@ -1,13 +0,0 @@ -{% macro renderError(type, message, stack) %} -
-

Error rendering {{ type }}

-
- {{ message | markdown }} -
- {% if stack %} - -
{{ stack }}
-
- {% endif %} -
-{% endmacro %} diff --git a/tools/vf-frctl-theme/views/macros/image.njk b/tools/vf-frctl-theme/views/macros/image.njk deleted file mode 100644 index c27e794670..0000000000 --- a/tools/vf-frctl-theme/views/macros/image.njk +++ /dev/null @@ -1,5 +0,0 @@ -{% macro svg(name, fill='#222', width='20px', height='20px', viewbox='0 0 320 320') %} - -{% include 'icons/' + name + '.njk' %} - -{% endmacro %} diff --git a/tools/vf-frctl-theme/views/macros/navigation.njk b/tools/vf-frctl-theme/views/macros/navigation.njk deleted file mode 100644 index e9bc73fcd2..0000000000 --- a/tools/vf-frctl-theme/views/macros/navigation.njk +++ /dev/null @@ -1,40 +0,0 @@ -{% import "macros/status.njk" as status %} - -{% macro tree(root, current, request) %} -
- -
    - {{ leaves(root.filter('isHidden', false).items(), root, current, 2, request) }} -
-
-{% endmacro %} - -{% macro leaves(items, root, current, depth, request) %} - {% for item in items %} - {% if item.isCollection or (item.isComponent and not item.isCollated and item.variants().filter('isHidden', false).size > 1) %} -
  • -

    - {{ item.label }} - {% if item.isComponent and item.variants().size > 1 %} - {% if item.status %}{{ status.unlabelled(item.status) }}{% endif %} - {% endif %} -

    -
      - {% if item.isComponent and not item.isCollated %} - {% set items = item.variants().filter('isHidden', false).items() %} - {% else %} - {% set items = item.filter('isHidden', false).items() %} - {% endif %} - {{ leaves(items, root, current, (depth + 1), request) }} -
    -
  • - {% else %} - {% set isCurrent = true if (current and (current.id == item.id)) else false %} -
  • - - {{ item.label }}{% if item.status %}{{ status.unlabelled(item.status) }}{% endif %} - -
  • - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/tools/vf-frctl-theme/views/macros/render.njk b/tools/vf-frctl-theme/views/macros/render.njk deleted file mode 100644 index 12f0a6ebe1..0000000000 --- a/tools/vf-frctl-theme/views/macros/render.njk +++ /dev/null @@ -1,11 +0,0 @@ -{% macro entity(rendered) %} -{% if rendered | isError %} -{# -If render fails, return nothing. -{% set renderError %}{% endset %} -{{ renderError | highlight('html') }} -#} -{% else %} -{{ rendered | beautify | highlight('html') }} -{% endif %} -{% endmacro %} diff --git a/tools/vf-frctl-theme/views/macros/status.njk b/tools/vf-frctl-theme/views/macros/status.njk deleted file mode 100644 index 90c184d4ae..0000000000 --- a/tools/vf-frctl-theme/views/macros/status.njk +++ /dev/null @@ -1,48 +0,0 @@ -{% macro _dot(color, label) %}{% endmacro %} - -{% macro _tag(color, label) %} -{{ label }} -{% endmacro %} - -{% macro _dots(status) %} -{% if status.statuses %} -{% for stat in status.statuses %} -{{ _dot(stat.color, stat.label) }} -{% endfor %} -{% else %} -{{ _dot(status.color, status.label) }} -{% endif %} -{% endmacro %} - -{% macro _tags(status) %} -{% if status.statuses %} -{% for stat in status.statuses %} -{{ _tag(stat.color, stat.label) }} -{% endfor %} -{% else %} -{{ _tag(status.color, status.label) }} -{% endif %} -{% endmacro %} - -{% macro labelled(status, modifier) %} -{% if status %} -
    - - {{ _dots(status) }} -
    -{% endif %} -{% endmacro %} - -{% macro unlabelled(status, modifier) %} -{% if status %} -{{ _dots(status) }} -{% endif %} -{% endmacro %} - -{% macro tag(status, modifier) %} -{% if status %} - -{{ _tag(status.color, status.label) }} - -{% endif %} -{% endmacro %} diff --git a/tools/vf-frctl-theme/views/pages/components/detail.njk b/tools/vf-frctl-theme/views/pages/components/detail.njk deleted file mode 100644 index 848b2c8892..0000000000 --- a/tools/vf-frctl-theme/views/pages/components/detail.njk +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "layouts/pen.njk" %} - -{% set entity = frctl.components.find('@' + request.params.handle) %} -{% if not entity %}{{ throw(404, "Component '" + request.params.handle + "' not found.") }}{% endif %} diff --git a/tools/vf-frctl-theme/views/pages/components/preview.njk b/tools/vf-frctl-theme/views/pages/components/preview.njk deleted file mode 100644 index 212d09022a..0000000000 --- a/tools/vf-frctl-theme/views/pages/components/preview.njk +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'layouts/render.njk' %} - -{% set entity = frctl.components.find('@' + request.params.handle) -%} -{% set withLayout = true -%} -{% set withCollation = true -%} diff --git a/tools/vf-frctl-theme/views/pages/components/render.njk b/tools/vf-frctl-theme/views/pages/components/render.njk deleted file mode 100644 index d2be88c2ba..0000000000 --- a/tools/vf-frctl-theme/views/pages/components/render.njk +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'layouts/render.njk' %} - -{% set entity = frctl.components.find('@' + request.params.handle) -%} -{% set withLayout = false -%} -{% set withCollation = true -%} diff --git a/tools/vf-frctl-theme/views/pages/doc.njk b/tools/vf-frctl-theme/views/pages/doc.njk deleted file mode 100644 index 326328bf63..0000000000 --- a/tools/vf-frctl-theme/views/pages/doc.njk +++ /dev/null @@ -1,62 +0,0 @@ -{% extends "layouts/doc.njk"%} -{% import "macros/status.njk" as status %} - -{% set pathParam = request.params.path %} -{% set doc = frctl.docs.find('path', pathParam | default('')) %} - -{% if pathParam and not doc %}{{ throw(404, 'Page not found') }}{% endif %} - -{% set page = { - title: doc.title | default('VF 2.0 Component library') | default(frctl.get('project.title')) | default('Welcome to your component library'), - lede: doc.lede | default('Browse all the components included in the Visual Framework 2.0 core.'), - intro: doc.intro | default('Use this website to browse components, understand the consituent CSS, JS templates, and to install from npm.') -} %} - -{% set status = status.tag(doc.status) %} - -{% block docContent %} - -
    - -{% block pageContent %} -{% import "macros/errors.njk" as errors %} -{% if doc %} - {% set contents = doc.render(null, renderEnv) | async(true) %} - {% if contents | isError %} - {{ errors.renderError('page', contents.message) }} - {% else %} - {{ contents }} - {% endif %} -{% endif %} -{% endblock %} -
    - -{% render '@vf-divider' %} - -{% if frctl.docs %} -{% render '@vf-heading', {"type": "large", "title": "In this section"} %} -{% endif %} - -{% if doc %} - {% set docSection = doc.path.split("/") %} - - {% if docSection != "" %} - - {% endif %} -{% endif %} - - -{% endblock %} diff --git a/tools/vf-frctl-theme/views/pages/error.njk b/tools/vf-frctl-theme/views/pages/error.njk deleted file mode 100644 index 84e50d9cd5..0000000000 --- a/tools/vf-frctl-theme/views/pages/error.njk +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "layouts/doc.njk" %} - -{% set page = { - title: ('Not found' if error.status == '404' else error.name) | default('An error has occurred') -} %} - -{% block docContent %} - -
    - -
    - {{ error.message | default('No more information is available.') | markdown }} -
    - - {% if error.stack and error.status != '404' %} -
    {{ error.stack }}
    - {% endif %} - -
    - -{% endblock %} diff --git a/tools/vf-frctl-theme/views/partials/browser/browser.njk b/tools/vf-frctl-theme/views/partials/browser/browser.njk deleted file mode 100644 index 28c5f866b8..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/browser.njk +++ /dev/null @@ -1,22 +0,0 @@ -
    - - {# - {% include 'partials/browser/controls.njk' %} - {% asyncAll panel in frctl.theme.get('panels') %} - {% include 'partials/browser/panel-' + panel + '.njk' %} - {% endall %} - #} - {% include 'partials/browser/panel-info.njk' %} - - {% include 'partials/browser/panel-html.njk' %} - -
    -
    -
    -
    -
    - {% include 'partials/browser/panel-resources.njk' %} -
    -
    - -
    diff --git a/tools/vf-frctl-theme/views/partials/browser/component-list.njk b/tools/vf-frctl-theme/views/partials/browser/component-list.njk deleted file mode 100644 index 1bb21bedfd..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/component-list.njk +++ /dev/null @@ -1,63 +0,0 @@ -{% import "macros/status.njk" as status %} - -

    All the components

    - -{% macro componentByType(displayName='Layout', type='layout', description='') %} -
    -
    -

    - {{ displayName }} - -

    -

    - {{ description }} -

    -
    -
    - {% asyncEach component in frctl.components %} - - {# handle component collections, aka "subcomponents" #} - {% if component.isCollection == true and component.isHidden == false %} - {% for subcomponent in component %} - {% if subcomponent.context['component-type'] == type and subcomponent.isHidden != true %} -

    - {{ subcomponent.label }} -

    - {% endif %} - {% endfor %} - {% endif %} - - {% if component.context['component-type'] == type %} -

    - {{ component.label }} -

    - {% endif %} - {% endeach %} -
    -
    -
    -{% endmacro %} - -{{ componentByType('Layout', type='layout', description='Put stuff in columns.') }} - -{{ componentByType('Elements', type='element', description='The micro elements of the component library.') }} - -{{ componentByType('Blocks', type='block', description='Simple components like sections headers, galleries and so on.') }} - -{{ componentByType('Container', type='container', description='More complex components that sometimes have specific layout, like page intros, mastheads, news sections and so on.') }} - -{{ componentByType('Boilerplates', type='boilerplate', description='Whole-page templates that are a collection of many components.') }} - -{{ componentByType('Utilities', type='utility', description='Utility classes to help where neeed.') }} - -{{ componentByType('EMBL Layout', type='embl-layout', description='EMBLs way to put stuff in columns.') }} - -{{ componentByType('EMBL Elements', type='embl-element', description='EMBLs micro elements of the component library.') }} - -{{ componentByType('EMBL Blocks', type='embl-block', description='Simple components from EMBL like sections headers, galleries and so on.') }} - -{{ componentByType('EMBL Containers', type='embl-container', description='More complex EMBL components that sometimes have specific layout, like page intros, mastheads, news sections and so on.') }} - -{{ componentByType('EMBL Boilerplates', type='embl-boilerplate', description='Whole-page templates that are a collection of many components.') }} - -{{ componentByType('Deprecated', type='deprecated', description='These components are no longer maintained.') }} diff --git a/tools/vf-frctl-theme/views/partials/browser/panel-html.njk b/tools/vf-frctl-theme/views/partials/browser/panel-html.njk deleted file mode 100644 index cf75fba316..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/panel-html.njk +++ /dev/null @@ -1,21 +0,0 @@ -{% import "macros/render.njk" as render %} -{% if not ((entity.preview == '@preview--blocks') or (entity.preview == '@preview--elements')) %} -

    Code example

    - - {% if entity.isVariant or entity.variants().size == 1 %} -
    
    -{%- set renderedItem = render.entity(entity.render(null, renderEnv, {preview: false, collate: false},entity) | async(true)) | trim -%}
    -{%- if renderedItem != '' -%}
    -{{ renderedItem | trim }}
    -{% else %}
    -{{ entity.content | highlight('html') }}
    -{% endif -%}
    -  
    - {% else %} - {% for variant in entity.variants().items() %} -
    {{ '<!-- ' + variant.label + ' -->' }}
    -{{ render.entity(variant.render(null, renderEnv, {preview: false, collate: false}) | async(true)) | trim }}
    -
    - {% endfor %} - {% endif %} -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/browser/panel-info.njk b/tools/vf-frctl-theme/views/partials/browser/panel-info.njk deleted file mode 100644 index df6dfef835..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/panel-info.njk +++ /dev/null @@ -1,33 +0,0 @@ -

    Component information

    - diff --git a/tools/vf-frctl-theme/views/partials/browser/panel-notes.njk b/tools/vf-frctl-theme/views/partials/browser/panel-notes.njk deleted file mode 100644 index 6feb6112b9..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/panel-notes.njk +++ /dev/null @@ -1,9 +0,0 @@ -
    -

    Notes

    -{% if entity.notes %} -
    - {{ frctl.docs.renderString(entity.notes, renderEnv) | async }} -
    -{% else %} -

    There are no notes for this item.

    -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/browser/panel-resources.njk b/tools/vf-frctl-theme/views/partials/browser/panel-resources.njk deleted file mode 100644 index 44a678af07..0000000000 --- a/tools/vf-frctl-theme/views/partials/browser/panel-resources.njk +++ /dev/null @@ -1,54 +0,0 @@ -{% set compHandle = entity.component().handle %} -{% for collection in entity.resources().items() %} -{% if collection.size %} -

    Resources and files

    - -
    -
      - - {% for resource in collection.items() %} - {% if resource.base != 'package-lock.json' %} -
    • - {{ resource.base }} -
    • - {% endif %} - {% endfor %} -
    -
    - -
    - {% for resource in collection.items() %} - {% if resource.base != 'package-lock.json' %} -
    -
    - {% if resource.isBinary and resource.isImage %} - - {% elif not resource.isBinary %} -
    -          {{ resource.contents | highlight(resource.lang) }}
    -        
    - {% else %} -

    Previews are currently not available for this file type.

    - {% endif %} -
    - -

    File information

    - -
    - {% endif %} - {% endfor %} -
    - -{% endif %} -{% endfor %} diff --git a/tools/vf-frctl-theme/views/partials/content/overview.njk b/tools/vf-frctl-theme/views/partials/content/overview.njk deleted file mode 100644 index f8b54b55e1..0000000000 --- a/tools/vf-frctl-theme/views/partials/content/overview.njk +++ /dev/null @@ -1,32 +0,0 @@ -{% import "macros/status.njk" as status %} - -{# Docs inside the component library should be thin, - instead they should be on a centralised documentation site. - https://github.com/visual-framework/vf-core/issues/447#issuecomment-507190595 - Rather linking to pages we make a container-ized list of the docs (the best nav is no nav) #} -{% asyncEach item in frctl.docs %} - {% asyncEach menuitem in item %} - {# {% if menuitem.isIndex == true %} #} -
    -
    -

    {{ menuitem.title }}

    -
    -
    -

    {{ menuitem.context.intro }}

    - - {{ menuitem.content | markdown }} - {# #} - {#
    #} -
    -
    - {# {% endif %} #} - {% endeach %} -{% endeach %} - -
    -
    - {% include 'partials/browser/component-list.njk' %} -
    -
    diff --git a/tools/vf-frctl-theme/views/partials/foot.njk b/tools/vf-frctl-theme/views/partials/foot.njk deleted file mode 100644 index f9f1b0a78b..0000000000 --- a/tools/vf-frctl-theme/views/partials/foot.njk +++ /dev/null @@ -1,25 +0,0 @@ -{% for script in frctl.theme.get('scripts') %} - -{% endfor %} -{% if frctl.env.server %} - -{% else %} - -{% endif %} - - diff --git a/tools/vf-frctl-theme/views/partials/header.njk b/tools/vf-frctl-theme/views/partials/header.njk deleted file mode 100644 index 7459dbb077..0000000000 --- a/tools/vf-frctl-theme/views/partials/header.njk +++ /dev/null @@ -1,23 +0,0 @@ -
    -
    - {% if frctl.env.server %} - {% render '@vf-logo', {logo_href: path('/', request), logo_text: frctl.get('project.title'), image: path('../../assets/vf-logo/assets/logo.svg',request) } %} - {% else %} - {% render '@vf-logo', {logo_href: path('/', request), logo_text: frctl.get('project.title'), image: 'https://dev.assets.emblstatic.net/vf/develop/assets/vf-logo/assets/logo.svg' } %} - {% endif %} - - -
    -
    diff --git a/tools/vf-frctl-theme/views/partials/navigation/assets.njk b/tools/vf-frctl-theme/views/partials/navigation/assets.njk deleted file mode 100644 index b7eb61c3a9..0000000000 --- a/tools/vf-frctl-theme/views/partials/navigation/assets.njk +++ /dev/null @@ -1,8 +0,0 @@ -{% if frctl.assets.visible().length %} -

    {{ frctl.get('assets.label') }}

    - {% for item in frctl.assets.visible() %} - - {{ item.label }} - - {% endfor %} -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/navigation/components.njk b/tools/vf-frctl-theme/views/partials/navigation/components.njk deleted file mode 100644 index 2ab7f72e62..0000000000 --- a/tools/vf-frctl-theme/views/partials/navigation/components.njk +++ /dev/null @@ -1,3 +0,0 @@ -{% if frctl.components.size %} - {{ nav.tree(frctl.components, entity, request) }} -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/navigation/docs.njk b/tools/vf-frctl-theme/views/partials/navigation/docs.njk deleted file mode 100644 index 8d2d954fc7..0000000000 --- a/tools/vf-frctl-theme/views/partials/navigation/docs.njk +++ /dev/null @@ -1,5 +0,0 @@ -{% if frctl.docs.size %} - -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/navigation/navigation.njk b/tools/vf-frctl-theme/views/partials/navigation/navigation.njk deleted file mode 100644 index b579ae3e86..0000000000 --- a/tools/vf-frctl-theme/views/partials/navigation/navigation.njk +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/tools/vf-frctl-theme/views/partials/pen/browser.njk b/tools/vf-frctl-theme/views/partials/pen/browser.njk deleted file mode 100644 index a52c31517a..0000000000 --- a/tools/vf-frctl-theme/views/partials/pen/browser.njk +++ /dev/null @@ -1,21 +0,0 @@ -
    - {% if entity.notes %} -
    - {{ frctl.docs.renderString(entity.notes, renderEnv) | async }} -
    - {% else %} -

    There are no notes for this item.

    - {% endif %} - -
    - {% include 'partials/browser/browser.njk' %} -
    -
    - - -{% if request.path != '/' %} - {# Only show component list on documentation homepage #} -
    - {% include 'partials/browser/component-list.njk' %} -
    -{% endif %} diff --git a/tools/vf-frctl-theme/views/partials/pen/header.njk b/tools/vf-frctl-theme/views/partials/pen/header.njk deleted file mode 100644 index 7033e1bed8..0000000000 --- a/tools/vf-frctl-theme/views/partials/pen/header.njk +++ /dev/null @@ -1,4 +0,0 @@ -

    - {{ entity.title }} - {{ status.tag(entity.status) }} -

    diff --git a/tools/vf-frctl-theme/views/partials/pen/preview.njk b/tools/vf-frctl-theme/views/partials/pen/preview.njk deleted file mode 100644 index cbee17fd22..0000000000 --- a/tools/vf-frctl-theme/views/partials/pen/preview.njk +++ /dev/null @@ -1,86 +0,0 @@ - - - - - {% if entity.isComponent %} - {% set variants = entity.variants() %} - {% else %} - {% set variants = entity.parent.variants() %} - {% endif %} - {% if variants.size > 1 and entity.preview != '@preview--blocks' and entity.preview != '@preview--elements' %} -
    -

    This component has variants:

    -
      - {% for variant in variants.items() %} - - {% if entity.handle == variant.handle %} -
    • - - {{ variant.label }} - -
    • - {% else %} - {% if variant.isHidden == false %} -
    • - - {{ variant.label }} - -
    • - {% endif %} {# end variant.isHidden #} - {% endif %} {# end entity.handle == variant.handle #} - - {% endfor %} -
    - -
    - - {% endif %} - - - - -{% import "macros/render.njk" as render %} -{% if (entity.preview == '@preview--blocks') or (entity.preview == '@preview--elements') -%} -
    - - {% for item in variants %} - {% if item.isHidden == false %} -

    Variant {{ item.label }}

    -{% set rendered = item.render(null, renderEnv, { preview: withLayout, collate: withCollation }) | async(true) %} -{{ rendered }} -
    -
    -{{ render.entity(item.render(null, renderEnv, {preview: false, collate: false}) | async(true)) | trim }}
    -
    -
    - -
    - {% endif %} - {% endfor %} -
    -{% else %} -
    -
    - {% if renderError -%} - {{ renderError }} - {% else %} - - {%- endif %} -

    - Open the above preview in a new window: - With layout Open - Component only Open -

    - -
    -
    -{%- endif %} diff --git a/tools/vf-frctl-theme/views/partials/stylesheets.njk b/tools/vf-frctl-theme/views/partials/stylesheets.njk deleted file mode 100644 index 6e9d4ba824..0000000000 --- a/tools/vf-frctl-theme/views/partials/stylesheets.njk +++ /dev/null @@ -1,8 +0,0 @@ -{% if frctl.env.server %} - -{% else %} - -{% endif %} -{% for stylesheet in frctl.theme.get('styles') %} - -{% endfor %}