-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_guide_html.R
More file actions
254 lines (217 loc) · 5.72 KB
/
create_guide_html.R
File metadata and controls
254 lines (217 loc) · 5.72 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#!/usr/bin/env Rscript
# Script to convert GUIDE.md to HTML
# Requires: markdown or pandoc
# Try using markdown package first
tryCatch({
library(markdown)
# Read the markdown file
guide_md <- readFile("GUIDE.md")
# Convert to HTML
html_content <- markdownToHTML(
text = guide_md,
extensions = c("tables", "fenced_code", "autolink"),
stylesheet = NA
)
# Add CSS styling
styled_html <- paste0('
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>shinyModals Complete Guide</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
padding: 60px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #2c3e50;
font-size: 2.5em;
margin: 0.5em 0;
border-bottom: 3px solid #3498db;
padding-bottom: 0.3em;
}
h2 {
color: #34495e;
font-size: 1.8em;
margin: 1.2em 0 0.6em 0;
padding-top: 0.5em;
}
h3 {
color: #3498db;
font-size: 1.3em;
margin: 1em 0 0.4em 0;
}
h4 {
color: #555;
font-size: 1.1em;
margin: 0.8em 0 0.3em 0;
}
p {
margin: 0.8em 0;
}
code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 3px;
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
font-size: 0.9em;
color: #d63384;
}
pre {
background: #2c3e50;
color: #ecf0f1;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
margin: 1em 0;
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
font-size: 0.9em;
line-height: 1.4;
}
pre code {
background: none;
padding: 0;
color: inherit;
}
ul, ol {
margin: 0.8em 0 0.8em 2em;
}
li {
margin: 0.4em 0;
}
table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
font-size: 0.95em;
}
table th {
background: #34495e;
color: white;
padding: 12px;
text-align: left;
font-weight: 600;
}
table td {
border-bottom: 1px solid #ddd;
padding: 10px 12px;
}
table tr:hover {
background: #f9f9f9;
}
blockquote {
border-left: 4px solid #3498db;
padding-left: 1em;
margin: 1em 0;
color: #666;
font-style: italic;
}
a {
color: #3498db;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.toc {
background: #ecf0f1;
padding: 20px;
border-radius: 5px;
margin: 2em 0;
}
.toc h2 {
margin-top: 0;
}
.toc ul {
margin: 0.5em 0 0 1.5em;
}
.toc li {
margin: 0.3em 0;
}
.example {
background: #f0f7ff;
border-left: 4px solid #3498db;
padding: 15px;
margin: 1em 0;
border-radius: 3px;
}
.note {
background: #fffbea;
border-left: 4px solid #f39c12;
padding: 15px;
margin: 1em 0;
border-radius: 3px;
}
.warning {
background: #ffe6e6;
border-left: 4px solid #e74c3c;
padding: 15px;
margin: 1em 0;
border-radius: 3px;
}
hr {
border: none;
border-top: 2px solid #ecf0f1;
margin: 2em 0;
}
.page-break {
page-break-before: always;
}
footer {
text-align: center;
color: #999;
margin-top: 3em;
padding-top: 2em;
border-top: 1px solid #ecf0f1;
font-size: 0.9em;
}
@media print {
body {
background: white;
padding: 0;
}
.container {
box-shadow: none;
padding: 40px;
}
a {
color: #0066cc;
}
}
</style>
</head>
<body>
<div class="container">
', html_content, '
<footer>
<p>shinyModals v0.4.0 | Generated December 10, 2025</p>
</footer>
</div>
</body>
</html>
')
# Write HTML file
writeLines(styled_html, "GUIDE.html")
cat("✓ HTML guide created successfully: GUIDE.html\n")
}, error = function(e) {
cat("Note: markdown package not installed for HTML conversion\n")
cat("Install it with: install.packages(\"markdown\")\n")
})