mordoc 0.1.1
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 +240 -0
- package/bin/cli.js +81 -0
- package/dist/build/Builder.d.ts +91 -0
- package/dist/build/Builder.d.ts.map +1 -0
- package/dist/build/Builder.js +391 -0
- package/dist/build/Builder.js.map +1 -0
- package/dist/build/ClientBundler.d.ts +36 -0
- package/dist/build/ClientBundler.d.ts.map +1 -0
- package/dist/build/ClientBundler.js +132 -0
- package/dist/build/ClientBundler.js.map +1 -0
- package/dist/build/HtmlGenerator.d.ts +46 -0
- package/dist/build/HtmlGenerator.d.ts.map +1 -0
- package/dist/build/HtmlGenerator.js +200 -0
- package/dist/build/HtmlGenerator.js.map +1 -0
- package/dist/build/SearchIndexer.d.ts +31 -0
- package/dist/build/SearchIndexer.d.ts.map +1 -0
- package/dist/build/SearchIndexer.js +116 -0
- package/dist/build/SearchIndexer.js.map +1 -0
- package/dist/cli/build.d.ts +20 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +111 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/create-app.d.ts +14 -0
- package/dist/cli/create-app.d.ts.map +1 -0
- package/dist/cli/create-app.js +216 -0
- package/dist/cli/create-app.js.map +1 -0
- package/dist/cli/dev.d.ts +20 -0
- package/dist/cli/dev.d.ts.map +1 -0
- package/dist/cli/dev.js +169 -0
- package/dist/cli/dev.js.map +1 -0
- package/dist/client/App.d.ts +17 -0
- package/dist/client/App.d.ts.map +1 -0
- package/dist/client/App.js +94 -0
- package/dist/client/App.js.map +1 -0
- package/dist/client/contexts/ConfigContext.d.ts +22 -0
- package/dist/client/contexts/ConfigContext.d.ts.map +1 -0
- package/dist/client/contexts/ConfigContext.js +27 -0
- package/dist/client/contexts/ConfigContext.js.map +1 -0
- package/dist/client/contexts/ContentContext.d.ts +31 -0
- package/dist/client/contexts/ContentContext.d.ts.map +1 -0
- package/dist/client/contexts/ContentContext.js +46 -0
- package/dist/client/contexts/ContentContext.js.map +1 -0
- package/dist/client/contexts/SearchContext.d.ts +38 -0
- package/dist/client/contexts/SearchContext.d.ts.map +1 -0
- package/dist/client/contexts/SearchContext.js +207 -0
- package/dist/client/contexts/SearchContext.js.map +1 -0
- package/dist/client/contexts/ThemeContext.d.ts +23 -0
- package/dist/client/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/client/contexts/ThemeContext.js +62 -0
- package/dist/client/contexts/ThemeContext.js.map +1 -0
- package/dist/client/hooks/useContent.d.ts +12 -0
- package/dist/client/hooks/useContent.d.ts.map +1 -0
- package/dist/client/hooks/useContent.js +74 -0
- package/dist/client/hooks/useContent.js.map +1 -0
- package/dist/client/hooks/useNavigation.d.ts +15 -0
- package/dist/client/hooks/useNavigation.d.ts.map +1 -0
- package/dist/client/hooks/useNavigation.js +101 -0
- package/dist/client/hooks/useNavigation.js.map +1 -0
- package/dist/client/hooks/useSearch.d.ts +22 -0
- package/dist/client/hooks/useSearch.d.ts.map +1 -0
- package/dist/client/hooks/useSearch.js +64 -0
- package/dist/client/hooks/useSearch.js.map +1 -0
- package/dist/client/main.d.ts +5 -0
- package/dist/client/main.d.ts.map +1 -0
- package/dist/client/main.js +66 -0
- package/dist/client/main.js.map +1 -0
- package/dist/components/Callout.d.ts +9 -0
- package/dist/components/Callout.d.ts.map +1 -0
- package/dist/components/Callout.js +24 -0
- package/dist/components/Callout.js.map +1 -0
- package/dist/components/Card.d.ts +10 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +15 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/CardGrid.d.ts +8 -0
- package/dist/components/CardGrid.d.ts.map +1 -0
- package/dist/components/CardGrid.js +9 -0
- package/dist/components/CardGrid.js.map +1 -0
- package/dist/components/CodeBlock.d.ts +24 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock.js +76 -0
- package/dist/components/CodeBlock.js.map +1 -0
- package/dist/components/ContentPage.d.ts +9 -0
- package/dist/components/ContentPage.d.ts.map +1 -0
- package/dist/components/ContentPage.js +36 -0
- package/dist/components/ContentPage.js.map +1 -0
- package/dist/components/Header.d.ts +14 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +30 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/Heading.d.ts +16 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/Heading.js +31 -0
- package/dist/components/Heading.js.map +1 -0
- package/dist/components/Image.d.ts +8 -0
- package/dist/components/Image.d.ts.map +1 -0
- package/dist/components/Image.js +24 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/Layout.d.ts +14 -0
- package/dist/components/Layout.d.ts.map +1 -0
- package/dist/components/Layout.js +32 -0
- package/dist/components/Layout.js.map +1 -0
- package/dist/components/MarkdocRenderer.d.ts +15 -0
- package/dist/components/MarkdocRenderer.d.ts.map +1 -0
- package/dist/components/MarkdocRenderer.js +73 -0
- package/dist/components/MarkdocRenderer.js.map +1 -0
- package/dist/components/MobileMenu.d.ts +14 -0
- package/dist/components/MobileMenu.d.ts.map +1 -0
- package/dist/components/MobileMenu.js +45 -0
- package/dist/components/MobileMenu.js.map +1 -0
- package/dist/components/PageNavigation.d.ts +9 -0
- package/dist/components/PageNavigation.d.ts.map +1 -0
- package/dist/components/PageNavigation.js +23 -0
- package/dist/components/PageNavigation.js.map +1 -0
- package/dist/components/SearchModal.d.ts +9 -0
- package/dist/components/SearchModal.d.ts.map +1 -0
- package/dist/components/SearchModal.js +74 -0
- package/dist/components/SearchModal.js.map +1 -0
- package/dist/components/SideNav.d.ts +9 -0
- package/dist/components/SideNav.d.ts.map +1 -0
- package/dist/components/SideNav.js +66 -0
- package/dist/components/SideNav.js.map +1 -0
- package/dist/components/TableOfContents.d.ts +10 -0
- package/dist/components/TableOfContents.d.ts.map +1 -0
- package/dist/components/TableOfContents.js +151 -0
- package/dist/components/TableOfContents.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +50 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -0
- package/dist/config/ConfigLoader.js +214 -0
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/StyleCompiler.d.ts +17 -0
- package/dist/config/StyleCompiler.d.ts.map +1 -0
- package/dist/config/StyleCompiler.js +116 -0
- package/dist/config/StyleCompiler.js.map +1 -0
- package/dist/config/ThemeGenerator.d.ts +14 -0
- package/dist/config/ThemeGenerator.d.ts.map +1 -0
- package/dist/config/ThemeGenerator.js +129 -0
- package/dist/config/ThemeGenerator.js.map +1 -0
- package/dist/content/ContentLoader.d.ts +70 -0
- package/dist/content/ContentLoader.d.ts.map +1 -0
- package/dist/content/ContentLoader.js +146 -0
- package/dist/content/ContentLoader.js.map +1 -0
- package/dist/content/ContentProcessor.d.ts +84 -0
- package/dist/content/ContentProcessor.d.ts.map +1 -0
- package/dist/content/ContentProcessor.js +380 -0
- package/dist/content/ContentProcessor.js.map +1 -0
- package/dist/content/RouteManager.d.ts +69 -0
- package/dist/content/RouteManager.d.ts.map +1 -0
- package/dist/content/RouteManager.js +143 -0
- package/dist/content/RouteManager.js.map +1 -0
- package/dist/styles/components/callout.d.ts +11 -0
- package/dist/styles/components/callout.d.ts.map +1 -0
- package/dist/styles/components/callout.js +83 -0
- package/dist/styles/components/callout.js.map +1 -0
- package/dist/styles/components/card.d.ts +11 -0
- package/dist/styles/components/card.d.ts.map +1 -0
- package/dist/styles/components/card.js +179 -0
- package/dist/styles/components/card.js.map +1 -0
- package/dist/styles/components/codeblock.d.ts +11 -0
- package/dist/styles/components/codeblock.d.ts.map +1 -0
- package/dist/styles/components/codeblock.js +249 -0
- package/dist/styles/components/codeblock.js.map +1 -0
- package/dist/styles/components/content.d.ts +11 -0
- package/dist/styles/components/content.d.ts.map +1 -0
- package/dist/styles/components/content.js +198 -0
- package/dist/styles/components/content.js.map +1 -0
- package/dist/styles/components/fonts.d.ts +11 -0
- package/dist/styles/components/fonts.d.ts.map +1 -0
- package/dist/styles/components/fonts.js +34 -0
- package/dist/styles/components/fonts.js.map +1 -0
- package/dist/styles/components/header.d.ts +11 -0
- package/dist/styles/components/header.d.ts.map +1 -0
- package/dist/styles/components/header.js +293 -0
- package/dist/styles/components/header.js.map +1 -0
- package/dist/styles/components/heading.d.ts +11 -0
- package/dist/styles/components/heading.d.ts.map +1 -0
- package/dist/styles/components/heading.js +115 -0
- package/dist/styles/components/heading.js.map +1 -0
- package/dist/styles/components/layout.d.ts +11 -0
- package/dist/styles/components/layout.d.ts.map +1 -0
- package/dist/styles/components/layout.js +79 -0
- package/dist/styles/components/layout.js.map +1 -0
- package/dist/styles/components/mobilemenu.d.ts +11 -0
- package/dist/styles/components/mobilemenu.d.ts.map +1 -0
- package/dist/styles/components/mobilemenu.js +112 -0
- package/dist/styles/components/mobilemenu.js.map +1 -0
- package/dist/styles/components/reset.d.ts +11 -0
- package/dist/styles/components/reset.d.ts.map +1 -0
- package/dist/styles/components/reset.js +131 -0
- package/dist/styles/components/reset.js.map +1 -0
- package/dist/styles/components/searchmodal.d.ts +11 -0
- package/dist/styles/components/searchmodal.d.ts.map +1 -0
- package/dist/styles/components/searchmodal.js +333 -0
- package/dist/styles/components/searchmodal.js.map +1 -0
- package/dist/styles/components/sidenav.d.ts +11 -0
- package/dist/styles/components/sidenav.d.ts.map +1 -0
- package/dist/styles/components/sidenav.js +209 -0
- package/dist/styles/components/sidenav.js.map +1 -0
- package/dist/styles/components/toc.d.ts +11 -0
- package/dist/styles/components/toc.d.ts.map +1 -0
- package/dist/styles/components/toc.js +112 -0
- package/dist/styles/components/toc.js.map +1 -0
- package/dist/styles/components/typography.d.ts +11 -0
- package/dist/styles/components/typography.d.ts.map +1 -0
- package/dist/styles/components/typography.js +247 -0
- package/dist/styles/components/typography.js.map +1 -0
- package/dist/styles/components/utility.d.ts +11 -0
- package/dist/styles/components/utility.d.ts.map +1 -0
- package/dist/styles/components/utility.js +231 -0
- package/dist/styles/components/utility.js.map +1 -0
- package/dist/styles/types.d.ts +79 -0
- package/dist/styles/types.d.ts.map +1 -0
- package/dist/styles/types.js +7 -0
- package/dist/styles/types.js.map +1 -0
- package/dist/styles/utils.d.ts +21 -0
- package/dist/styles/utils.d.ts.map +1 -0
- package/dist/styles/utils.js +50 -0
- package/dist/styles/utils.js.map +1 -0
- package/dist/styles/variables/main.d.ts +15 -0
- package/dist/styles/variables/main.d.ts.map +1 -0
- package/dist/styles/variables/main.js +116 -0
- package/dist/styles/variables/main.js.map +1 -0
- package/dist/types/config.d.ts +43 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +7 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/content.d.ts +46 -0
- package/dist/types/content.d.ts.map +1 -0
- package/dist/types/content.js +7 -0
- package/dist/types/content.js.map +1 -0
- package/dist/types/navigation.d.ts +45 -0
- package/dist/types/navigation.d.ts.map +1 -0
- package/dist/types/navigation.js +7 -0
- package/dist/types/navigation.js.map +1 -0
- package/dist/utils/language-utils.d.ts +41 -0
- package/dist/utils/language-utils.d.ts.map +1 -0
- package/dist/utils/language-utils.js +79 -0
- package/dist/utils/language-utils.js.map +1 -0
- package/dist/utils/slugify.d.ts +20 -0
- package/dist/utils/slugify.d.ts.map +1 -0
- package/dist/utils/slugify.js +44 -0
- package/dist/utils/slugify.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global design tokens (MORDOC variables)
|
|
3
|
+
* Provides default values and merge logic for global styling variables
|
|
4
|
+
*/
|
|
5
|
+
import { GlobalVariables } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Get default global variables
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGlobalDefaults(): GlobalVariables;
|
|
10
|
+
/**
|
|
11
|
+
* Merge user overrides with global defaults
|
|
12
|
+
* Only allows customization of typography (font families)
|
|
13
|
+
*/
|
|
14
|
+
export declare function mergeGlobalOverrides(userOverrides?: Record<string, string>): GlobalVariables;
|
|
15
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/styles/variables/main.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,eAAe,CA4FnD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,eAAe,CAqBjB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Global design tokens (MORDOC variables)
|
|
4
|
+
* Provides default values and merge logic for global styling variables
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getGlobalDefaults = getGlobalDefaults;
|
|
8
|
+
exports.mergeGlobalOverrides = mergeGlobalOverrides;
|
|
9
|
+
/**
|
|
10
|
+
* Get default global variables
|
|
11
|
+
*/
|
|
12
|
+
function getGlobalDefaults() {
|
|
13
|
+
return {
|
|
14
|
+
// Colors - Light mode
|
|
15
|
+
primaryColorLight: '#171717',
|
|
16
|
+
primaryColorDark: '#fafafa',
|
|
17
|
+
secondaryColorLight: '#525252',
|
|
18
|
+
secondaryColorDark: '#b3b3b3',
|
|
19
|
+
backgroundColorLight: '#ffffff',
|
|
20
|
+
backgroundColorDark: '#0a0a0a',
|
|
21
|
+
surfaceColorLight: '#f8f8f8',
|
|
22
|
+
surfaceColorDark: '#1a1a1a',
|
|
23
|
+
textPrimaryLight: '#1c1c1c',
|
|
24
|
+
textPrimaryDark: '#e5e5e5',
|
|
25
|
+
textSecondaryLight: '#525252',
|
|
26
|
+
textSecondaryDark: '#c9c9c9',
|
|
27
|
+
textDisabledLight: '#cccccc',
|
|
28
|
+
textDisabledDark: '#404040',
|
|
29
|
+
borderColorLight: '#e5e5e5',
|
|
30
|
+
borderColorDark: '#262626',
|
|
31
|
+
linkColorLight: '#171717',
|
|
32
|
+
linkColorDark: '#fafafa',
|
|
33
|
+
// Status colors
|
|
34
|
+
successColorLight: '#2d3436',
|
|
35
|
+
successColorDark: '#dfe6e9',
|
|
36
|
+
warningColorLight: '#636e72',
|
|
37
|
+
warningColorDark: '#b2bec3',
|
|
38
|
+
errorColorLight: '#1a1a1a',
|
|
39
|
+
errorColorDark: '#ffffff',
|
|
40
|
+
infoColorLight: '#2d3436',
|
|
41
|
+
infoColorDark: '#dfe6e9',
|
|
42
|
+
// Navigation colors
|
|
43
|
+
navTextColorLight: '#666666',
|
|
44
|
+
navTextColorDark: '#b3b3b3',
|
|
45
|
+
navHoverColorLight: '#171717',
|
|
46
|
+
navHoverColorDark: '#fafafa',
|
|
47
|
+
navActiveColorLight: '#171717',
|
|
48
|
+
navActiveColorDark: '#fafafa',
|
|
49
|
+
// Typography
|
|
50
|
+
fontFamilyBase: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
51
|
+
fontFamilyHeading: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
52
|
+
fontFamilyMono: '"SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace',
|
|
53
|
+
// Spacing (locked)
|
|
54
|
+
spacingXs: '0.25rem',
|
|
55
|
+
spacingSm: '0.5rem',
|
|
56
|
+
spacingMd: '1rem',
|
|
57
|
+
spacingLg: '1.5rem',
|
|
58
|
+
spacingXl: '2rem',
|
|
59
|
+
spacing2xl: '3rem',
|
|
60
|
+
spacing3xl: '4rem',
|
|
61
|
+
// Font sizes (locked)
|
|
62
|
+
fontSizeXs: '0.75rem',
|
|
63
|
+
fontSizeSm: '0.875rem',
|
|
64
|
+
fontSizeBase: '1rem',
|
|
65
|
+
fontSizeLg: '1.25rem',
|
|
66
|
+
fontSizeXl: '1.5rem',
|
|
67
|
+
fontSize2xl: '2rem',
|
|
68
|
+
fontSize3xl: '2.25rem',
|
|
69
|
+
fontSize4xl: '2.75rem',
|
|
70
|
+
// Font weights (locked)
|
|
71
|
+
fontWeightNormal: 400,
|
|
72
|
+
fontWeightMedium: 500,
|
|
73
|
+
fontWeightSemibold: 600,
|
|
74
|
+
fontWeightBold: 700,
|
|
75
|
+
// Line heights (locked)
|
|
76
|
+
lineHeightTight: 1.25,
|
|
77
|
+
lineHeightNormal: 1.5,
|
|
78
|
+
lineHeightRelaxed: 1.75,
|
|
79
|
+
// Border radius (locked)
|
|
80
|
+
borderRadiusSm: '0.125rem',
|
|
81
|
+
borderRadiusMd: '0.25rem',
|
|
82
|
+
borderRadiusLg: '0.5rem',
|
|
83
|
+
borderRadiusFull: '9999px',
|
|
84
|
+
// Container widths (locked)
|
|
85
|
+
containerWidthSm: '640px',
|
|
86
|
+
containerWidthMd: '768px',
|
|
87
|
+
containerWidthLg: '1024px',
|
|
88
|
+
containerWidthXl: '1280px',
|
|
89
|
+
// Layout dimensions (locked)
|
|
90
|
+
headerHeight: '4rem',
|
|
91
|
+
sidebarWidth: '16rem',
|
|
92
|
+
sidebarCollapsedWidth: '4rem',
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Merge user overrides with global defaults
|
|
97
|
+
* Only allows customization of typography (font families)
|
|
98
|
+
*/
|
|
99
|
+
function mergeGlobalOverrides(userOverrides) {
|
|
100
|
+
const defaults = getGlobalDefaults();
|
|
101
|
+
if (!userOverrides) {
|
|
102
|
+
return defaults;
|
|
103
|
+
}
|
|
104
|
+
// Whitelist of customizable global variables
|
|
105
|
+
const customizableKeys = [
|
|
106
|
+
'fontFamilyBase', 'fontFamilyHeading', 'fontFamilyMono',
|
|
107
|
+
];
|
|
108
|
+
const merged = { ...defaults };
|
|
109
|
+
customizableKeys.forEach(key => {
|
|
110
|
+
if (userOverrides[key] !== undefined) {
|
|
111
|
+
merged[key] = userOverrides[key];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return merged;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/styles/variables/main.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration type definitions for Mordoc
|
|
3
|
+
* These interfaces define the structure of user configuration files
|
|
4
|
+
*/
|
|
5
|
+
export interface NavigationItem {
|
|
6
|
+
label: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
external?: boolean;
|
|
10
|
+
children?: NavigationItem[];
|
|
11
|
+
sidenavRef?: string;
|
|
12
|
+
}
|
|
13
|
+
export type SideNavConfig = NavigationItem[];
|
|
14
|
+
export type TopNavConfig = NavigationItem[];
|
|
15
|
+
export interface LanguageConfig {
|
|
16
|
+
code: string;
|
|
17
|
+
label: string;
|
|
18
|
+
default?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SiteMetadata {
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
keywords?: string[];
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AssetConfig {
|
|
27
|
+
logo?: string;
|
|
28
|
+
logoDark?: string;
|
|
29
|
+
favicon?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SiteConfig {
|
|
32
|
+
metadata: SiteMetadata;
|
|
33
|
+
languages: LanguageConfig[];
|
|
34
|
+
defaultLanguage: string;
|
|
35
|
+
navigation: {
|
|
36
|
+
sidenav: SideNavConfig;
|
|
37
|
+
topnav?: TopNavConfig;
|
|
38
|
+
additionalSidenavs?: Record<string, SideNavConfig>;
|
|
39
|
+
};
|
|
40
|
+
assets: AssetConfig;
|
|
41
|
+
assetsPath: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC;AAC7C,MAAM,MAAM,YAAY,GAAG,cAAc,EAAE,CAAC;AAG5C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAGD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,OAAO,EAAE,aAAa,CAAC;QACvB,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content type definitions for Mordoc
|
|
3
|
+
* These interfaces define the structure of processed markdown content
|
|
4
|
+
*/
|
|
5
|
+
import type { RenderableTreeNode } from '@markdoc/markdoc';
|
|
6
|
+
export interface Frontmatter {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
order?: number;
|
|
10
|
+
draft?: boolean;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
date?: string;
|
|
13
|
+
author?: string;
|
|
14
|
+
sidenavRef?: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface TocEntry {
|
|
18
|
+
id: string;
|
|
19
|
+
text: string;
|
|
20
|
+
level: number;
|
|
21
|
+
children?: TocEntry[];
|
|
22
|
+
}
|
|
23
|
+
export type TableOfContents = TocEntry[];
|
|
24
|
+
export interface ContentMetadata {
|
|
25
|
+
slug: string;
|
|
26
|
+
filePath: string;
|
|
27
|
+
language: string;
|
|
28
|
+
path: string;
|
|
29
|
+
dirPath: string;
|
|
30
|
+
frontmatter: Frontmatter;
|
|
31
|
+
toc: TableOfContents;
|
|
32
|
+
wordCount: number;
|
|
33
|
+
readingTime: number;
|
|
34
|
+
}
|
|
35
|
+
export type MarkdocRenderableNode = RenderableTreeNode;
|
|
36
|
+
export interface ProcessedContent {
|
|
37
|
+
metadata: ContentMetadata;
|
|
38
|
+
renderable: MarkdocRenderableNode;
|
|
39
|
+
rawContent?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ContentDataFile {
|
|
42
|
+
metadata: ContentMetadata;
|
|
43
|
+
renderable: MarkdocRenderableNode;
|
|
44
|
+
}
|
|
45
|
+
export type ContentMap = Map<string, ProcessedContent>;
|
|
46
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG3D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAGD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAGD,MAAM,MAAM,eAAe,GAAG,QAAQ,EAAE,CAAC;AAGzC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,eAAe,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAGvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,qBAAqB,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,qBAAqB,CAAC;CACnC;AAGD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation type definitions for Mordoc
|
|
3
|
+
* These interfaces define routing and navigation structures
|
|
4
|
+
*/
|
|
5
|
+
export interface Route {
|
|
6
|
+
path: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
dirPath: string;
|
|
9
|
+
language: string;
|
|
10
|
+
}
|
|
11
|
+
export type RouteMap = Map<string, Route>;
|
|
12
|
+
export interface NavigationNode {
|
|
13
|
+
label: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
order?: number;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
external?: boolean;
|
|
18
|
+
icon?: string;
|
|
19
|
+
children?: NavigationNode[];
|
|
20
|
+
}
|
|
21
|
+
export type NavigationTree = NavigationNode[];
|
|
22
|
+
export interface PageNavigationLink {
|
|
23
|
+
label: string;
|
|
24
|
+
path: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PageNavigation {
|
|
27
|
+
prev?: PageNavigationLink;
|
|
28
|
+
next?: PageNavigationLink;
|
|
29
|
+
}
|
|
30
|
+
export interface LanguageAlternative {
|
|
31
|
+
code: string;
|
|
32
|
+
label: string;
|
|
33
|
+
path?: string;
|
|
34
|
+
available: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type LanguageSwitcher = LanguageAlternative[];
|
|
37
|
+
export interface NavigationContext {
|
|
38
|
+
currentPath: string;
|
|
39
|
+
currentLanguage: string;
|
|
40
|
+
sidenav: NavigationTree;
|
|
41
|
+
topnav?: NavigationTree;
|
|
42
|
+
pageNavigation: PageNavigation;
|
|
43
|
+
languageSwitcher: LanguageSwitcher;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAG1C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAGD,MAAM,MAAM,cAAc,GAAG,cAAc,EAAE,CAAC;AAG9C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAGD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAGD,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;AAGrD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language utility functions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Extract language code from a file path
|
|
6
|
+
* Examples:
|
|
7
|
+
* "en/getting-started.md" -> "en"
|
|
8
|
+
* "es/guias/inicio.md" -> "es"
|
|
9
|
+
* "getting-started.md" -> null (no language prefix)
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractLanguageFromPath(filePath: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Remove language prefix from a file path
|
|
14
|
+
* Examples:
|
|
15
|
+
* "en/getting-started.md" -> "getting-started.md"
|
|
16
|
+
* "es/guias/inicio.md" -> "guias/inicio.md"
|
|
17
|
+
* "getting-started.md" -> "getting-started.md" (no change)
|
|
18
|
+
*/
|
|
19
|
+
export declare function removeLanguagePrefix(filePath: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Build a URL path with optional language prefix
|
|
22
|
+
* Examples:
|
|
23
|
+
* ("getting-started", "en", "en") -> "/getting-started" (default language, no prefix)
|
|
24
|
+
* ("getting-started", "es", "en") -> "/es/getting-started"
|
|
25
|
+
* ("", "en", "en") -> "/" (home page, default language)
|
|
26
|
+
* ("", "es", "en") -> "/es" (home page, non-default language)
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildPathWithLanguage(slug: string, language: string, defaultLanguage: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Validate language code format
|
|
31
|
+
* Returns true if the code looks like a valid language code (2-3 lowercase letters)
|
|
32
|
+
*/
|
|
33
|
+
export declare function isValidLanguageCode(code: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get relative content path (path within the language directory)
|
|
36
|
+
* Examples:
|
|
37
|
+
* "en/getting-started.md" -> "getting-started.md"
|
|
38
|
+
* "en/guides/quick-start.md" -> "guides/quick-start.md"
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRelativeContentPath(filePath: string): string;
|
|
41
|
+
//# sourceMappingURL=language-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-utils.d.ts","sourceRoot":"","sources":["../../src/utils/language-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASvE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,MAAM,CAgBR;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Language utility functions
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractLanguageFromPath = extractLanguageFromPath;
|
|
7
|
+
exports.removeLanguagePrefix = removeLanguagePrefix;
|
|
8
|
+
exports.buildPathWithLanguage = buildPathWithLanguage;
|
|
9
|
+
exports.isValidLanguageCode = isValidLanguageCode;
|
|
10
|
+
exports.getRelativeContentPath = getRelativeContentPath;
|
|
11
|
+
/**
|
|
12
|
+
* Extract language code from a file path
|
|
13
|
+
* Examples:
|
|
14
|
+
* "en/getting-started.md" -> "en"
|
|
15
|
+
* "es/guias/inicio.md" -> "es"
|
|
16
|
+
* "getting-started.md" -> null (no language prefix)
|
|
17
|
+
*/
|
|
18
|
+
function extractLanguageFromPath(filePath) {
|
|
19
|
+
const parts = filePath.split('/');
|
|
20
|
+
// Check if the first segment looks like a language code (2-3 letters)
|
|
21
|
+
if (parts.length > 1 && /^[a-z]{2,3}$/i.test(parts[0])) {
|
|
22
|
+
return parts[0].toLowerCase();
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Remove language prefix from a file path
|
|
28
|
+
* Examples:
|
|
29
|
+
* "en/getting-started.md" -> "getting-started.md"
|
|
30
|
+
* "es/guias/inicio.md" -> "guias/inicio.md"
|
|
31
|
+
* "getting-started.md" -> "getting-started.md" (no change)
|
|
32
|
+
*/
|
|
33
|
+
function removeLanguagePrefix(filePath) {
|
|
34
|
+
const language = extractLanguageFromPath(filePath);
|
|
35
|
+
if (language) {
|
|
36
|
+
// Remove the language prefix and leading slash
|
|
37
|
+
return filePath.substring(language.length + 1);
|
|
38
|
+
}
|
|
39
|
+
return filePath;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build a URL path with optional language prefix
|
|
43
|
+
* Examples:
|
|
44
|
+
* ("getting-started", "en", "en") -> "/getting-started" (default language, no prefix)
|
|
45
|
+
* ("getting-started", "es", "en") -> "/es/getting-started"
|
|
46
|
+
* ("", "en", "en") -> "/" (home page, default language)
|
|
47
|
+
* ("", "es", "en") -> "/es" (home page, non-default language)
|
|
48
|
+
*/
|
|
49
|
+
function buildPathWithLanguage(slug, language, defaultLanguage) {
|
|
50
|
+
// Normalize slug (remove leading/trailing slashes)
|
|
51
|
+
let normalizedSlug = slug.replace(/^\/+|\/+$/g, '');
|
|
52
|
+
// Special case: 'index' at root should map to home page (empty string)
|
|
53
|
+
if (normalizedSlug === 'index') {
|
|
54
|
+
normalizedSlug = '';
|
|
55
|
+
}
|
|
56
|
+
// If default language, don't add language prefix
|
|
57
|
+
if (language === defaultLanguage) {
|
|
58
|
+
return normalizedSlug ? `/${normalizedSlug}` : '/';
|
|
59
|
+
}
|
|
60
|
+
// Non-default language, add language prefix
|
|
61
|
+
return normalizedSlug ? `/${language}/${normalizedSlug}` : `/${language}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validate language code format
|
|
65
|
+
* Returns true if the code looks like a valid language code (2-3 lowercase letters)
|
|
66
|
+
*/
|
|
67
|
+
function isValidLanguageCode(code) {
|
|
68
|
+
return /^[a-z]{2,3}$/.test(code);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get relative content path (path within the language directory)
|
|
72
|
+
* Examples:
|
|
73
|
+
* "en/getting-started.md" -> "getting-started.md"
|
|
74
|
+
* "en/guides/quick-start.md" -> "guides/quick-start.md"
|
|
75
|
+
*/
|
|
76
|
+
function getRelativeContentPath(filePath) {
|
|
77
|
+
return removeLanguagePrefix(filePath);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=language-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-utils.js","sourceRoot":"","sources":["../../src/utils/language-utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AASH,0DASC;AASD,oDASC;AAUD,sDAoBC;AAMD,kDAEC;AAQD,wDAEC;AAlFD;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,QAAgB;IACtD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,sEAAsE;IACtE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,QAAgB;IACnD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAEnD,IAAI,QAAQ,EAAE,CAAC;QACb,+CAA+C;QAC/C,OAAO,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,IAAY,EACZ,QAAgB,EAChB,eAAuB;IAEvB,mDAAmD;IACnD,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAEpD,uEAAuE;IACvE,IAAI,cAAc,KAAK,OAAO,EAAE,CAAC;QAC/B,cAAc,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,iDAAiD;IACjD,IAAI,QAAQ,KAAK,eAAe,EAAE,CAAC;QACjC,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACrD,CAAC;IAED,4CAA4C;IAC5C,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,QAAgB;IACrD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slugify utility - Converts strings to URL-friendly slugs
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Convert a string to a URL-friendly slug
|
|
6
|
+
* Examples:
|
|
7
|
+
* "Getting Started" -> "getting-started"
|
|
8
|
+
* "API Reference!" -> "api-reference"
|
|
9
|
+
* "Hello_World" -> "hello-world"
|
|
10
|
+
*/
|
|
11
|
+
export declare function slugify(text: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a file path to a slug by removing extension and slugifying
|
|
14
|
+
* Examples:
|
|
15
|
+
* "getting-started.md" -> "getting-started"
|
|
16
|
+
* "API Reference.md" -> "api-reference"
|
|
17
|
+
* "guides/Quick Start.md" -> "quick-start"
|
|
18
|
+
*/
|
|
19
|
+
export declare function filePathToSlug(filePath: string): string;
|
|
20
|
+
//# sourceMappingURL=slugify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../src/utils/slugify.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU5C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYvD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Slugify utility - Converts strings to URL-friendly slugs
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.slugify = slugify;
|
|
7
|
+
exports.filePathToSlug = filePathToSlug;
|
|
8
|
+
/**
|
|
9
|
+
* Convert a string to a URL-friendly slug
|
|
10
|
+
* Examples:
|
|
11
|
+
* "Getting Started" -> "getting-started"
|
|
12
|
+
* "API Reference!" -> "api-reference"
|
|
13
|
+
* "Hello_World" -> "hello-world"
|
|
14
|
+
*/
|
|
15
|
+
function slugify(text) {
|
|
16
|
+
return text
|
|
17
|
+
.toString()
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.trim()
|
|
20
|
+
.replace(/\s+/g, '-') // Replace spaces with -
|
|
21
|
+
.replace(/[^\w\-]+/g, '') // Remove all non-word chars except hyphens
|
|
22
|
+
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
|
23
|
+
.replace(/^-+/, '') // Trim - from start of text
|
|
24
|
+
.replace(/-+$/, ''); // Trim - from end of text
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Convert a file path to a slug by removing extension and slugifying
|
|
28
|
+
* Examples:
|
|
29
|
+
* "getting-started.md" -> "getting-started"
|
|
30
|
+
* "API Reference.md" -> "api-reference"
|
|
31
|
+
* "guides/Quick Start.md" -> "quick-start"
|
|
32
|
+
*/
|
|
33
|
+
function filePathToSlug(filePath) {
|
|
34
|
+
// Get the filename without extension
|
|
35
|
+
const fileName = filePath.split('/').pop()?.replace(/\.mdx?$/, '') || '';
|
|
36
|
+
// If the filename is 'index', use the parent directory name
|
|
37
|
+
if (fileName === 'index') {
|
|
38
|
+
const parts = filePath.split('/');
|
|
39
|
+
// Get the parent directory, or use 'index' if at root
|
|
40
|
+
return parts.length > 1 ? slugify(parts[parts.length - 2]) : 'index';
|
|
41
|
+
}
|
|
42
|
+
return slugify(fileName);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=slugify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slugify.js","sourceRoot":"","sources":["../../src/utils/slugify.ts"],"names":[],"mappings":";AAAA;;GAEG;;AASH,0BAUC;AASD,wCAYC;AAtCD;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI;SACR,QAAQ,EAAE;SACV,WAAW,EAAE;SACb,IAAI,EAAE;SACN,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,wBAAwB;SAC7C,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,2CAA2C;SACpE,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,mCAAmC;SAC1D,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,4BAA4B;SAC/C,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B;AACnD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC7C,qCAAqC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IAEzE,4DAA4D;IAC5D,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,sDAAsD;QACtD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACvE,CAAC;IAED,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mordoc",
|
|
3
|
+
"repoitory" :{
|
|
4
|
+
"type": "git",
|
|
5
|
+
"url": "https://github.com/shiva-varanasi/mordoc.git"
|
|
6
|
+
},
|
|
7
|
+
"version": "0.1.1",
|
|
8
|
+
"description": "A static site generator for documentation with SSG + SPA capabilities",
|
|
9
|
+
"bin": {
|
|
10
|
+
"mordoc": "./bin/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"compile": "tsc",
|
|
17
|
+
"dev": "node bin/cli.js dev",
|
|
18
|
+
"build": "node bin/cli.js build",
|
|
19
|
+
"prepublishOnly": "tsc"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"documentation",
|
|
23
|
+
"static-site-generator",
|
|
24
|
+
"ssg",
|
|
25
|
+
"markdown",
|
|
26
|
+
"markdoc",
|
|
27
|
+
"react"
|
|
28
|
+
],
|
|
29
|
+
"author": "Shiva Varanasi",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@markdoc/markdoc": "^0.5.4",
|
|
33
|
+
"fast-glob": "^3.3.3",
|
|
34
|
+
"js-yaml": "^4.1.0",
|
|
35
|
+
"pagefind": "^1.4.0",
|
|
36
|
+
"prismjs": "^1.30.0",
|
|
37
|
+
"react": "^19.2.3",
|
|
38
|
+
"react-dom": "^19.2.3",
|
|
39
|
+
"react-router-dom": "^7.9.3",
|
|
40
|
+
"sirv-cli": "^2.0.2",
|
|
41
|
+
"ws": "^8.18.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/js-yaml": "^4.0.9",
|
|
45
|
+
"@types/node": "^24.6.2",
|
|
46
|
+
"@types/react": "^19.2.3",
|
|
47
|
+
"@types/react-dom": "^19.2.3",
|
|
48
|
+
"@types/prismjs": "^1.26.5",
|
|
49
|
+
"@types/ws": "^8.18.1",
|
|
50
|
+
"esbuild": "^0.25.10",
|
|
51
|
+
"eslint": "^9.36.0",
|
|
52
|
+
"prettier": "^3.6.2",
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|