-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractal3.js
64 lines (56 loc) · 1.75 KB
/
fractal3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path')
// Create and export a fractal instance
const fractal = module.exports = require('@frctl/fractal').create()
// Customize theme
const mandelbrot = require('@frctl/mandelbrot')({
format: 'yaml',
nav: ['docs', 'components'],
skin: 'white',
styles: ['default', '/css/vui.css']
})
// Project config
fractal.set('project.title', 'videa.design/sandbox')
fractal.set('project.description', 'Build. Document. Integrate')
fractal.set('project.version', '0.1.0')
fractal.set('project.lastUpdated', new Date())
// Template Engine config
const mdAbbr = require('markdown-it-abbr')
const mdFootnote = require('markdown-it-footnote')
const md = require('markdown-it')({
html: true,
xhtmlOut: true,
typographer: true
}).use(mdAbbr).use(mdFootnote)
const nunjucksDate = require('nunjucks-date')
const nunjucks = require('@frctl/nunjucks')({
paths: ['docs'],
filters: {
date: nunjucksDate,
markdown (str) {
return md.render(str)
},
markdownInline (str) {
return md.renderInline(str)
},
slugify (str) {
return str.toLowerCase().replace(/[^\w]+/g, '')
},
stringify () {
return JSON.stringify(this, null, '\t')
}
}
})
// Components config
fractal.components.engine(nunjucks)
fractal.components.set('ext', '.html')
fractal.components.set('path', path.join(__dirname, 'src/components'))
fractal.components.set('label', 'Components')
// Docs config
fractal.docs.engine(nunjucks)
fractal.docs.set('ext', '.md')
fractal.docs.set('path', path.join(__dirname, 'src/docs'))
// Web UI config
fractal.web.theme(mandelbrot)
fractal.web.set('static.path', path.join(__dirname, 'static'))
fractal.web.set('builder.dest', '/Users/vtolbert/videa/design/patterns')
// fractal.web.set('builder.urls.ext', null)