This is a minimal fractal.js
for testing the live context data editor proposed in this PR.
Created
January 5, 2017 23:14
-
-
Save shawnbot/8133c1a1ca077142bf1d15cb442b96fd to your computer and use it in GitHub Desktop.
Fractal live context editor configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fractal = require('@frctl/fractal').create(); | |
fractal.components.set('path', __dirname + '/components'); | |
fractal.components.set('ext', '.njk'); | |
fractal.components.engine('@frctl/nunjucks'); | |
fractal.components.set('default.preview', '@preview'); | |
// this is what makes it work | |
fractal.components.set('context.editable', true); | |
const mandelbrot = require('./'); | |
const codemirrorPath = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.22.0'; | |
const theme = mandelbrot({ | |
format: 'yaml', | |
panels: ['context', 'html'], | |
scripts: [ | |
`${codemirrorPath}/codemirror.min.js`, | |
`${codemirrorPath}/mode/yaml/yaml.min.js`, | |
'default', | |
], | |
styles: [ | |
`${codemirrorPath}/codemirror.min.css`, | |
'default', | |
] | |
}); | |
fractal.web.theme(theme); | |
module.exports = fractal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment