-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nacara.js
153 lines (145 loc) · 4.83 KB
/
nacara.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
const standard = require('nacara/dist/layouts/standard/Export').default;
const mdMessage = require('nacara/dist/js/utils').mdMessage;
const React = require('react');
const prelude = require('nacara/dist/layouts/standard/Prelude');
const markdown = require('nacara/dist/js/utils').markdown;
const demoLayout = (model, pageContext) => {
return new Promise((resolve, reject) => {
// Use the markdown converter exposed by your F# layout
const html = { __html: markdown(pageContext.Content, model.Config.Plugins.Markdown) };
const content =
<div>
<div className="content container is-hidden-touch">
<div dangerouslySetInnerHTML={html} />
</div >
<section className="hero is-fullheight has-text-centered is-hidden-desktop">
<div className="hero-body">
<div className="container">
<article className="message is-danger">
<div className="message-header">
<p>Unsupported device</p>
</div>
<div className="message-body">
Sorry, the demo is only availble from a desktop
</div>
</article>
</div>
</div>
</section>
{/* Add dummy navigation buttons to avoid menu.js to crash, to fix in Nacara */}
<div className="navigate-to-previous"></div>
<div className="navigate-to-next"></div>
</div>;
// Re-use existing base page (writting in F#)
const page = prelude.basePage(model, pageContext.Attributes.Title, content);
resolve(page);
})
}
module.exports = {
// ...
layouts: {
default: standard.Default,
changelog: standard.Changelog,
demo: demoLayout // Add your layout here
},
// ...
}
module.exports = {
githubURL: "https://github.com/thoth-org/Thoth.Elmish.Toast",
url: "https://thoth-org.github.io/",
source: "docs",
output: "docs_deploy",
baseUrl: "/Thoth.Elmish.Toast/",
editUrl: "https://github.com/thoth-org/Thoth.Elmish.Toast/edit/master/docs",
title: "Thoth.Elmish.Toast",
debug: true,
version: "2.1.0",
navbar: {
showVersion: true,
links: [
{
href: "/Thoth.Elmish.Toast/index.html",
label: "Documentation",
icon: "fas fa-book"
},
{
href: "/Thoth.Elmish.Toast/demo.html",
label: "Demo",
icon: "fas fa-laptop-code"
},
{
href: "/Thoth.Elmish.Toast/changelog.html",
label: "Changelog",
icon: "fas fa-tasks"
},
{
href: "https://gitter.im/fable-compiler/Fable",
label: "Support",
icon: "fab fa-gitter",
isExternal: true
},
{
href: "https://github.com/thoth-org/Thoth.Elmish.Toast",
icon: "fab fa-github",
isExternal: true
},
{
href: "https://twitter.com/MangelMaxime",
icon: "fab fa-twitter",
isExternal: true,
color: "#55acee"
}
]
},
lightner: {
backgroundColor: "#FAFAFA",
textColor: "",
themeFile: "./paket-files/grammars/akamud/vscode-theme-onelight/themes/OneLight.json",
grammars: [
"./paket-files/grammars/ionide/ionide-fsgrammar/grammar/fsharp.json",
]
},
layouts: {
default: standard.Default,
changelog: standard.Changelog,
demo: demoLayout
},
plugins: {
markdown: [
{
path: 'markdown-it-container',
args: [
'warning',
mdMessage("warning")
]
},
{
path: 'markdown-it-container',
args: [
'info',
mdMessage("info")
]
},
{
path: 'markdown-it-container',
args: [
'success',
mdMessage("success")
]
},
{
path: 'markdown-it-container',
args: [
'danger',
mdMessage("danger")
]
},
{
path: 'nacara/dist/js/markdown-it-anchored.js'
},
{
path: 'nacara/dist/js/markdown-it-toc.js'
}
]
}
};