-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
82 lines (70 loc) · 2.2 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
'use strict';
module.exports = {
name: require('./package').name,
contentFor(type, config) {
if (
type === 'head-footer' &&
config.modulePrefix === 'dummy' &&
config.environment != 'test'
) {
return [
'tailwindcss@^2.0/dist/base.min.css',
'tailwindcss@^2.0/dist/components.min.css',
'@tailwindcss/typography@^0.4/dist/typography.min.css',
'tailwindcss@^2.0/dist/utilities.min.css',
]
.map((css) => `<link href="https://unpkg.com/${css}" rel="stylesheet">`)
.join('');
}
if (
type === 'body-footer' &&
config.modulePrefix === 'dummy' &&
config.environment != 'test'
) {
return `<script>Prism.plugins.customClass.prefix('prism--')</script>`;
}
},
included(includer) {
if (includer.parent) {
throw new Error(
`ember-concord-doc should be in your package.json's devDependencies`
);
} else if (includer.name === this.project.name()) {
throw new Error(
`ember-concord-doc cannot be used to document an application`
);
}
if (!includer.options.snippetSearchPaths) {
includer.options.snippetSearchPaths = ['addon', 'tests/dummy/app'];
}
if (!includer.options['ember-prism']) {
includer.options['ember-prism'] = {};
}
if (!includer.options['ember-prism'].components) {
includer.options['ember-prism'].components = [
'markup',
'markup-templating',
'handlebars',
'javascript',
'css',
];
}
if (!includer.options['ember-prism'].plugins) {
includer.options['ember-prism'].plugins = ['custom-class'];
}
if (!includer.options['ember-md-block']) {
includer.options['ember-md-block'] = {};
}
if (!includer.options['ember-md-block'].wrapper) {
includer.options['ember-md-block'].wrapper = {};
}
if (!includer.options['ember-md-block'].wrapper.begin) {
includer.options['ember-md-block'].wrapper.begin =
'<div class="prose max-w-none">';
}
if (!includer.options['ember-md-block'].wrapper.end) {
includer.options['ember-md-block'].wrapper.end = '</div>';
}
this._super.included.apply(this, arguments);
},
};