Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Created January 5, 2017 23:14
Show Gist options
  • Save shawnbot/8133c1a1ca077142bf1d15cb442b96fd to your computer and use it in GitHub Desktop.
Save shawnbot/8133c1a1ca077142bf1d15cb442b96fd to your computer and use it in GitHub Desktop.
Fractal live context editor configuration

This is a minimal fractal.js for testing the live context data editor proposed in this PR.

'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