@life-and-dev/mdsite 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +228 -0
- package/bin/mdsite.js +3 -0
- package/dist/commands/commands.test.d.ts +1 -0
- package/dist/commands/commands.test.js +302 -0
- package/dist/commands/commands.test.js.map +1 -0
- package/dist/commands/generate.d.ts +1 -0
- package/dist/commands/generate.js +20 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +16 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/prepare.d.ts +1 -0
- package/dist/commands/prepare.js +111 -0
- package/dist/commands/prepare.js.map +1 -0
- package/dist/commands/prepare.test.d.ts +1 -0
- package/dist/commands/prepare.test.js +131 -0
- package/dist/commands/prepare.test.js.map +1 -0
- package/dist/commands/preview.d.ts +5 -0
- package/dist/commands/preview.js +62 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/start.d.ts +5 -0
- package/dist/commands/start.js +50 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/stop.d.ts +1 -0
- package/dist/commands/stop.js +26 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/workflows.test.d.ts +1 -0
- package/dist/commands/workflows.test.js +183 -0
- package/dist/commands/workflows.test.js.map +1 -0
- package/dist/config/default-mdsite-config.d.ts +2 -0
- package/dist/config/default-mdsite-config.js +82 -0
- package/dist/config/default-mdsite-config.js.map +1 -0
- package/dist/config/default-mdsite-config.test.d.ts +1 -0
- package/dist/config/default-mdsite-config.test.js +42 -0
- package/dist/config/default-mdsite-config.test.js.map +1 -0
- package/dist/config/mdsite-config.d.ts +42 -0
- package/dist/config/mdsite-config.js +74 -0
- package/dist/config/mdsite-config.js.map +1 -0
- package/dist/config/mdsite-config.test.d.ts +1 -0
- package/dist/config/mdsite-config.test.js +115 -0
- package/dist/config/mdsite-config.test.js.map +1 -0
- package/dist/config/menu.d.ts +3 -0
- package/dist/config/menu.js +58 -0
- package/dist/config/menu.js.map +1 -0
- package/dist/config/menu.test.d.ts +1 -0
- package/dist/config/menu.test.js +53 -0
- package/dist/config/menu.test.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +133 -0
- package/dist/index.test.js.map +1 -0
- package/dist/process/child-process.d.ts +9 -0
- package/dist/process/child-process.js +142 -0
- package/dist/process/child-process.js.map +1 -0
- package/dist/process/child-process.test.d.ts +1 -0
- package/dist/process/child-process.test.js +131 -0
- package/dist/process/child-process.test.js.map +1 -0
- package/dist/process/runtime-state.d.ts +16 -0
- package/dist/process/runtime-state.js +42 -0
- package/dist/process/runtime-state.js.map +1 -0
- package/dist/process/runtime-state.test.d.ts +1 -0
- package/dist/process/runtime-state.test.js +57 -0
- package/dist/process/runtime-state.test.js.map +1 -0
- package/dist/renderer/mdsite-nuxt.d.ts +22 -0
- package/dist/renderer/mdsite-nuxt.js +194 -0
- package/dist/renderer/mdsite-nuxt.js.map +1 -0
- package/dist/renderer/mdsite-nuxt.test.d.ts +1 -0
- package/dist/renderer/mdsite-nuxt.test.js +226 -0
- package/dist/renderer/mdsite-nuxt.test.js.map +1 -0
- package/mdsite-nuxt/app/app.vue +7 -0
- package/mdsite-nuxt/app/assets/css/bible-tooltips.css +87 -0
- package/mdsite-nuxt/app/assets/css/markdown.css +195 -0
- package/mdsite-nuxt/app/assets/css/print.css +133 -0
- package/mdsite-nuxt/app/components/AppBar.vue +138 -0
- package/mdsite-nuxt/app/components/AppFooter.vue +88 -0
- package/mdsite-nuxt/app/components/AppNavigation.vue +162 -0
- package/mdsite-nuxt/app/components/AppTableOfContents.vue +149 -0
- package/mdsite-nuxt/app/components/BreadcrumbNav.vue +139 -0
- package/mdsite-nuxt/app/components/NavigationTree.vue +169 -0
- package/mdsite-nuxt/app/components/SearchBox.vue +212 -0
- package/mdsite-nuxt/app/components/TocItem.vue +75 -0
- package/mdsite-nuxt/app/components/TreeNode.vue +264 -0
- package/mdsite-nuxt/app/components/content/MarkdownAlert.vue +42 -0
- package/mdsite-nuxt/app/components/content/Mermaid.vue +103 -0
- package/mdsite-nuxt/app/components/content/ProseA.vue +57 -0
- package/mdsite-nuxt/app/components/content/ProseBlockquote.vue +14 -0
- package/mdsite-nuxt/app/components/content/ProsePre.vue +49 -0
- package/mdsite-nuxt/app/components/content/ProseTable.vue +143 -0
- package/mdsite-nuxt/app/composables/useAppTheme.ts +89 -0
- package/mdsite-nuxt/app/composables/useBibleTooltips.ts +21 -0
- package/mdsite-nuxt/app/composables/useBreadcrumbs.ts +70 -0
- package/mdsite-nuxt/app/composables/useContentPostProcessing.ts +89 -0
- package/mdsite-nuxt/app/composables/useNavigationTree.ts +174 -0
- package/mdsite-nuxt/app/composables/useSearchIndex.ts +47 -0
- package/mdsite-nuxt/app/composables/useSearchRelevance.test.ts +255 -0
- package/mdsite-nuxt/app/composables/useSearchRelevance.ts +207 -0
- package/mdsite-nuxt/app/composables/useSidebarState.ts +62 -0
- package/mdsite-nuxt/app/composables/useSiteConfig.ts +37 -0
- package/mdsite-nuxt/app/composables/useSourceEdit.ts +69 -0
- package/mdsite-nuxt/app/composables/useTableOfContents.ts +141 -0
- package/mdsite-nuxt/app/composables/useTableParser.ts +106 -0
- package/mdsite-nuxt/app/composables/useTooltipConfig.ts +20 -0
- package/mdsite-nuxt/app/config/themes.ts +17 -0
- package/mdsite-nuxt/app/layouts/default.vue +376 -0
- package/mdsite-nuxt/app/pages/[...slug].vue +56 -0
- package/mdsite-nuxt/app/pages/index.vue +54 -0
- package/mdsite-nuxt/app/plugins/bible-tooltips.client.ts +401 -0
- package/mdsite-nuxt/app/plugins/bible-tooltips.test.ts +284 -0
- package/mdsite-nuxt/app/types/content.d.ts +10 -0
- package/mdsite-nuxt/app/types/table.ts +57 -0
- package/mdsite-nuxt/app/utils/bible-book-names.ts +37 -0
- package/mdsite-nuxt/app/utils/bible-verse-utils.test.ts +148 -0
- package/mdsite-nuxt/app/utils/bible-verse-utils.ts +236 -0
- package/mdsite-nuxt/content.config.ts +18 -0
- package/mdsite-nuxt/example.config.yml +67 -0
- package/mdsite-nuxt/nuxt.config.ts +247 -0
- package/mdsite-nuxt/package-lock.json +15922 -0
- package/mdsite-nuxt/package.json +50 -0
- package/mdsite-nuxt/playwright.config.js +47 -0
- package/mdsite-nuxt/public/robots.txt +2 -0
- package/mdsite-nuxt/scripts/generate-favicons.ts +192 -0
- package/mdsite-nuxt/scripts/generate-indices.ts +508 -0
- package/mdsite-nuxt/scripts/renderer-hooks.test.ts +277 -0
- package/mdsite-nuxt/scripts/renderer-hooks.ts +141 -0
- package/mdsite-nuxt/scripts/start.test.ts +164 -0
- package/mdsite-nuxt/scripts/start.ts +55 -0
- package/mdsite-nuxt/scripts/sync-content.ts +504 -0
- package/mdsite-nuxt/tsconfig.json +18 -0
- package/mdsite-nuxt/utils/mdsite-config.ts +240 -0
- package/mdsite-nuxt/vitest.config.ts +7 -0
- package/package.json +36 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import { getDomainThemes } from './app/config/themes'
|
|
4
|
+
import { createBibleReferencePatterns } from './app/utils/bible-book-names'
|
|
5
|
+
import { runBuildFallbackHooks } from './scripts/renderer-hooks'
|
|
6
|
+
import { loadMdsiteConfigSync } from './utils/mdsite-config'
|
|
7
|
+
|
|
8
|
+
const mdsite = loadMdsiteConfigSync()
|
|
9
|
+
const siteConfig = mdsite.config
|
|
10
|
+
|
|
11
|
+
export default defineNuxtConfig({
|
|
12
|
+
compatibilityDate: '2025-07-15',
|
|
13
|
+
devtools: { enabled: true },
|
|
14
|
+
|
|
15
|
+
runtimeConfig: {
|
|
16
|
+
public: {
|
|
17
|
+
contentDomain: path.basename(mdsite.contentDir),
|
|
18
|
+
contentPath: mdsite.contentDir,
|
|
19
|
+
siteConfig
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
typescript: {
|
|
24
|
+
strict: true,
|
|
25
|
+
typeCheck: false
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
nitro: {
|
|
29
|
+
preset: 'static' // Pure static preset - no SPA fallbacks
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
ssr: true,
|
|
33
|
+
|
|
34
|
+
css: [
|
|
35
|
+
'~/assets/css/markdown.css',
|
|
36
|
+
'~/assets/css/print.css',
|
|
37
|
+
'~/assets/css/bible-tooltips.css'
|
|
38
|
+
],
|
|
39
|
+
|
|
40
|
+
modules: [
|
|
41
|
+
'vuetify-nuxt-module',
|
|
42
|
+
'@nuxt/content'
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
content: {},
|
|
46
|
+
|
|
47
|
+
vite: {
|
|
48
|
+
build: {
|
|
49
|
+
rollupOptions: {
|
|
50
|
+
external: ['fs/promises', 'path']
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
app: {
|
|
56
|
+
head: {
|
|
57
|
+
link: [
|
|
58
|
+
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg', sizes: 'any' },
|
|
59
|
+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico', sizes: '32x32' },
|
|
60
|
+
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
|
|
61
|
+
{ rel: 'manifest', href: '/site.webmanifest' },
|
|
62
|
+
{ rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css' },
|
|
63
|
+
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap' }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
hooks: {
|
|
69
|
+
// Wrap Bible verses in spans BEFORE markdown is parsed to AST
|
|
70
|
+
// This prevents hydration mismatch by ensuring server and client HTML match
|
|
71
|
+
'content:file:beforeParse': (ctx: { file: any }) => {
|
|
72
|
+
const { file } = ctx
|
|
73
|
+
if (!file.id.endsWith('.md')) return
|
|
74
|
+
|
|
75
|
+
const excludedContexts = ['```', '~~~', '<code', '<pre', '<a ']
|
|
76
|
+
|
|
77
|
+
// Check if we're inside excluded context
|
|
78
|
+
const isInExcludedContext = (text: string, index: number): boolean => {
|
|
79
|
+
const before = text.substring(0, index)
|
|
80
|
+
|
|
81
|
+
// Check for code blocks
|
|
82
|
+
const codeBlockCount = (before.match(/```/g) || []).length
|
|
83
|
+
if (codeBlockCount % 2 === 1) return true
|
|
84
|
+
|
|
85
|
+
// Check for inline code blocks - count backticks in the current line
|
|
86
|
+
const lastNewline = before.lastIndexOf('\n')
|
|
87
|
+
const currentLine = lastNewline === -1 ? before : before.substring(lastNewline + 1)
|
|
88
|
+
const backtickCount = (currentLine.match(/`/g) || []).length
|
|
89
|
+
if (backtickCount % 2 === 1) return true
|
|
90
|
+
|
|
91
|
+
// Check for links - rough check for [text](url) format
|
|
92
|
+
const lastOpenBracket = before.lastIndexOf('[')
|
|
93
|
+
const lastCloseBracket = before.lastIndexOf(']')
|
|
94
|
+
if (lastOpenBracket > lastCloseBracket) return true
|
|
95
|
+
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Process GFM Alerts (> [!NOTE])
|
|
100
|
+
const alertPattern = /^> \[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*(.*(?:\n>.*)*)/gm
|
|
101
|
+
file.body = file.body.replace(alertPattern, (match: any, type: string, content: string, offset: number) => {
|
|
102
|
+
if (isInExcludedContext(file.body, offset)) return match
|
|
103
|
+
|
|
104
|
+
const cleanContent = content.split('\n')
|
|
105
|
+
.map((line: string) => line.replace(/^>\s?/, ''))
|
|
106
|
+
.join('\n')
|
|
107
|
+
return `::markdown-alert{type="${type.toLowerCase()}"}\n${cleanContent.trim()}\n::\n`
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const enableBibleTooltips = siteConfig.features?.bibleTooltips ?? false
|
|
111
|
+
|
|
112
|
+
if (!enableBibleTooltips) return
|
|
113
|
+
|
|
114
|
+
console.log('📖 Processing Bible verses in:', file.id)
|
|
115
|
+
|
|
116
|
+
const patterns = createBibleReferencePatterns()
|
|
117
|
+
|
|
118
|
+
// Process each pattern
|
|
119
|
+
patterns.forEach(pattern => {
|
|
120
|
+
const matches: Array<{ index: number; text: string }> = []
|
|
121
|
+
|
|
122
|
+
let match
|
|
123
|
+
while ((match = pattern.exec(file.body)) !== null) {
|
|
124
|
+
if (!isInExcludedContext(file.body, match.index)) {
|
|
125
|
+
matches.push({
|
|
126
|
+
index: match.index,
|
|
127
|
+
text: match[0]
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
pattern.lastIndex = 0
|
|
132
|
+
|
|
133
|
+
// Replace matches in reverse order to preserve indices
|
|
134
|
+
matches.reverse().forEach(({ index, text }) => {
|
|
135
|
+
const before = file.body.substring(0, index)
|
|
136
|
+
const after = file.body.substring(index + text.length)
|
|
137
|
+
const wrapped = `<span class="bible-ref" data-reference="${text}">${text}</span>`
|
|
138
|
+
file.body = before + wrapped + after
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
'build:before': async () => {
|
|
144
|
+
if (process.argv.includes('prepare') || !mdsite.configPath || process.env.MDSITE_RENDERER_ORCHESTRATED === '1') {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
await runBuildFallbackHooks(siteConfig.site.name)
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
vuetify: {
|
|
153
|
+
vuetifyOptions: {
|
|
154
|
+
theme: {
|
|
155
|
+
themes: getDomainThemes(process.env.CONTENT)
|
|
156
|
+
},
|
|
157
|
+
// Minimal component defaults - MD3 compliant
|
|
158
|
+
defaults: {
|
|
159
|
+
// Form Controls
|
|
160
|
+
VTextField: {
|
|
161
|
+
rounded: 'pill',
|
|
162
|
+
variant: 'outlined',
|
|
163
|
+
hideDetails: 'auto',
|
|
164
|
+
},
|
|
165
|
+
VTextarea: {
|
|
166
|
+
variant: 'outlined',
|
|
167
|
+
hideDetails: 'auto'
|
|
168
|
+
},
|
|
169
|
+
VSelect: {
|
|
170
|
+
variant: 'outlined',
|
|
171
|
+
hideDetails: 'auto'
|
|
172
|
+
},
|
|
173
|
+
VCheckbox: {
|
|
174
|
+
color: 'primary',
|
|
175
|
+
hideDetails: 'auto'
|
|
176
|
+
},
|
|
177
|
+
VRadioGroup: {
|
|
178
|
+
density: 'compact'
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
// Layout Components
|
|
182
|
+
VCard: {
|
|
183
|
+
color: 'surface',
|
|
184
|
+
elevation: 0,
|
|
185
|
+
rounded: 'xl',
|
|
186
|
+
variant: 'flat'
|
|
187
|
+
},
|
|
188
|
+
VCardActions: {
|
|
189
|
+
class: 'justify-end pa-4'
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
// Interactive Components
|
|
193
|
+
VBtn: {
|
|
194
|
+
variant: 'flat',
|
|
195
|
+
rounded: 'pill',
|
|
196
|
+
elevation: 0,
|
|
197
|
+
color: 'primary',
|
|
198
|
+
class: 'transition-all'
|
|
199
|
+
},
|
|
200
|
+
'VBtn[color="secondary"]': {
|
|
201
|
+
variant: 'outlined'
|
|
202
|
+
},
|
|
203
|
+
VDataTable: {
|
|
204
|
+
variant: 'outlined',
|
|
205
|
+
itemsPerPage: 25,
|
|
206
|
+
showSelect: false
|
|
207
|
+
},
|
|
208
|
+
VDialog: {
|
|
209
|
+
maxWidth: '600px',
|
|
210
|
+
elevation: 24
|
|
211
|
+
},
|
|
212
|
+
VAlert: {
|
|
213
|
+
variant: 'tonal'
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
// Navigation Components
|
|
217
|
+
VTabs: {
|
|
218
|
+
color: 'primary'
|
|
219
|
+
},
|
|
220
|
+
VAppBar: {
|
|
221
|
+
elevation: 1,
|
|
222
|
+
color: 'surface-appbar'
|
|
223
|
+
},
|
|
224
|
+
VNavigationDrawer: {
|
|
225
|
+
elevation: 12,
|
|
226
|
+
color: 'surface-rail',
|
|
227
|
+
style: 'z-index: 1010;'
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
// Additional Components
|
|
231
|
+
VChip: {
|
|
232
|
+
variant: 'flat'
|
|
233
|
+
},
|
|
234
|
+
VSwitch: {
|
|
235
|
+
color: 'primary',
|
|
236
|
+
hideDetails: 'auto'
|
|
237
|
+
},
|
|
238
|
+
VListItem: {
|
|
239
|
+
color: 'secondary'
|
|
240
|
+
},
|
|
241
|
+
VMenu: {
|
|
242
|
+
elevation: 8
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
})
|