@adminide-stack/yantra-help-browser 12.0.16-alpha.2 → 12.0.16-alpha.21
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/lib/components/HelpCenterFooter.d.ts.map +1 -1
- package/lib/components/HelpCenterFooter.js +93 -85
- package/lib/components/HelpCenterFooter.js.map +1 -1
- package/lib/components/HelpCenterHeader.d.ts +1 -5
- package/lib/components/HelpCenterHeader.d.ts.map +1 -1
- package/lib/components/HelpCenterHeader.js +67 -69
- package/lib/components/HelpCenterHeader.js.map +1 -1
- package/lib/components/Logo.d.ts.map +1 -1
- package/lib/components/Logo.js +3 -2
- package/lib/components/Logo.js.map +1 -1
- package/lib/components/SearchBar.d.ts +8 -0
- package/lib/components/SearchBar.d.ts.map +1 -0
- package/lib/components/SearchBar.js +234 -0
- package/lib/components/SearchBar.js.map +1 -0
- package/lib/components/SidebarSearch.d.ts +8 -0
- package/lib/components/SidebarSearch.d.ts.map +1 -0
- package/lib/components/SidebarSearch.js +114 -0
- package/lib/components/SidebarSearch.js.map +1 -0
- package/lib/components/navbar/index.d.ts.map +1 -1
- package/lib/components/navbar/index.js +5 -4
- package/lib/components/navbar/index.js.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +19 -1
- package/lib/compute.js.map +1 -1
- package/lib/pages/CategoryCollection/index.d.ts.map +1 -1
- package/lib/pages/CategoryCollection/index.js +5 -11
- package/lib/pages/CategoryCollection/index.js.map +1 -1
- package/lib/pages/HelpCenter/components/HelpCategoryCard.d.ts +2 -0
- package/lib/pages/HelpCenter/components/HelpCategoryCard.d.ts.map +1 -1
- package/lib/pages/HelpCenter/components/HelpCategoryCard.js +135 -50
- package/lib/pages/HelpCenter/components/HelpCategoryCard.js.map +1 -1
- package/lib/pages/HelpCenter/components/Icons.d.ts +10 -0
- package/lib/pages/HelpCenter/components/Icons.d.ts.map +1 -1
- package/lib/pages/HelpCenter/components/Icons.js +211 -1
- package/lib/pages/HelpCenter/components/Icons.js.map +1 -1
- package/lib/pages/HelpCenter/components/PopularArticle.d.ts.map +1 -1
- package/lib/pages/HelpCenter/components/PopularArticle.js +17 -23
- package/lib/pages/HelpCenter/components/PopularArticle.js.map +1 -1
- package/lib/pages/HelpCenter/index.d.ts.map +1 -1
- package/lib/pages/HelpCenter/index.js +106 -37
- package/lib/pages/HelpCenter/index.js.map +1 -1
- package/lib/pages/HelpCenter/mockData.d.ts.map +1 -1
- package/lib/pages/HelpCenter/mockData.js +14 -6
- package/lib/pages/HelpCenter/mockData.js.map +1 -1
- package/lib/pages/LandingPage/components/HeroSection.d.ts +0 -1
- package/lib/pages/LandingPage/components/HeroSection.d.ts.map +1 -1
- package/lib/pages/LandingPage/components/HeroSection.js +3 -6
- package/lib/pages/LandingPage/components/HeroSection.js.map +1 -1
- package/lib/pages/LandingPage/index.d.ts.map +1 -1
- package/lib/pages/LandingPage/index.js +1 -6
- package/lib/pages/LandingPage/index.js.map +1 -1
- package/lib/pages/Markdown/MarkdownPageLayout.d.ts +3 -0
- package/lib/pages/Markdown/MarkdownPageLayout.d.ts.map +1 -0
- package/lib/pages/Markdown/MarkdownPageLayout.js +314 -0
- package/lib/pages/Markdown/MarkdownPageLayout.js.map +1 -0
- package/lib/pages/Markdown/MarkdownPageWithParams.d.ts +9 -0
- package/lib/pages/Markdown/MarkdownPageWithParams.d.ts.map +1 -0
- package/lib/pages/Markdown/MarkdownPageWithParams.js +65 -0
- package/lib/pages/Markdown/MarkdownPageWithParams.js.map +1 -0
- package/lib/pages/Markdown/index.d.ts +3 -0
- package/lib/pages/Markdown/index.d.ts.map +1 -0
- package/lib/pages/Markdown/index.js +5 -0
- package/lib/pages/Markdown/index.js.map +1 -0
- package/lib/routes.json +28 -1
- package/lib/{content → templates/content}/account-management/account-setup.md +10 -0
- package/lib/{content → templates/content}/account-management/delete-account.md +10 -0
- package/lib/{content → templates/content}/account-management/preferences.md +10 -0
- package/lib/{content → templates/content}/account-management/privacy-settings.md +10 -0
- package/lib/{content → templates/content}/account-management/profile-settings.md +8 -0
- package/lib/templates/content/ai-employees/ai-employees-overview.md +97 -0
- package/lib/templates/content/ai-employees/getting-started-ai-employees.md +119 -0
- package/lib/templates/content/ai-employees/how-ai-employees-work.md +123 -0
- package/lib/templates/content/ai-employees/supervised-mode.md +141 -0
- package/lib/templates/content/content-manifest.json +5670 -0
- package/lib/{content → templates/content}/data-privacy/data-collection.md +9 -0
- package/lib/{content → templates/content}/data-privacy/privacy-policy.md +10 -0
- package/lib/{content → templates/content}/data-subject-privacy/data-access.md +12 -0
- package/lib/{content → templates/content}/data-subject-privacy/data-portability.md +15 -0
- package/lib/{content → templates/content}/data-subject-privacy/privacy-requests.md +11 -0
- package/lib/{content → templates/content}/file-uploads/file-upload-overview.md +9 -0
- package/lib/{content → templates/content}/getting-started/getting-started-guide.md +9 -0
- package/lib/templates/content/integrations/crm-integrations.md +130 -0
- package/lib/templates/content/integrations/github-integration.md +95 -0
- package/lib/templates/content/integrations/integrations-overview.md +142 -0
- package/lib/templates/content/integrations/monitoring-integrations.md +109 -0
- package/lib/templates/content/integrations/productivity-integrations.md +129 -0
- package/lib/templates/content/integrations/slack-integration.md +79 -0
- package/lib/templates/content/openclaw/openclaw-architecture.md +202 -0
- package/lib/templates/content/openclaw/openclaw-contribution.md +107 -0
- package/lib/templates/content/openclaw/openclaw-overview.md +152 -0
- package/lib/templates/content/platform-features/always-watching.md +63 -0
- package/lib/templates/content/platform-features/instant-context.md +67 -0
- package/lib/templates/content/platform-features/instant-onboarding.md +80 -0
- package/lib/templates/content/platform-features/platform-overview.md +58 -0
- package/lib/templates/content/platform-features/proactive-alerts.md +88 -0
- package/lib/templates/content/platform-features/smart-escalation.md +93 -0
- package/lib/{content → templates/content}/product-features/ai-models.md +1 -1
- package/lib/{content → templates/content}/product-features/collaboration-tools.md +8 -0
- package/lib/{content → templates/content}/product-features/conversation-features.md +6 -0
- package/lib/{content → templates/content}/product-features/export-features.md +8 -0
- package/lib/{content → templates/content}/product-features/follow-up-questions.md +8 -0
- package/lib/{content → templates/content}/product-features/real-time-search.md +8 -0
- package/lib/{content → templates/content}/product-features/saved-searches.md +8 -0
- package/lib/{content → templates/content}/product-features/search-features.md +1 -1
- package/lib/{content → templates/content}/product-features/search-history.md +8 -0
- package/lib/{content → templates/content}/product-features/source-citations.md +8 -0
- package/lib/{content → templates/content}/scope-api/api-overview.md +8 -0
- package/lib/{content → templates/content}/search-modes/deep-research.md +8 -0
- package/lib/{content → templates/content}/search-modes/labs-features.md +10 -0
- package/lib/{content → templates/content}/search-modes/pro-search.md +8 -0
- package/lib/{content → templates/content}/search-modes/regular-search.md +8 -0
- package/lib/templates/content/security-compliance/audit-trail.md +112 -0
- package/lib/templates/content/security-compliance/compliance.md +120 -0
- package/lib/templates/content/security-compliance/data-encryption.md +94 -0
- package/lib/templates/content/security-compliance/security-overview.md +186 -0
- package/lib/templates/content/security-compliance/vm-isolation.md +126 -0
- package/lib/templates/content/solutions-engineering/bug-tracking-context.md +126 -0
- package/lib/templates/content/solutions-engineering/engineering-overview.md +107 -0
- package/lib/templates/content/solutions-engineering/error-monitoring.md +120 -0
- package/lib/templates/content/solutions-engineering/institutional-memory.md +120 -0
- package/lib/templates/content/solutions-marketing/brand-monitoring.md +135 -0
- package/lib/templates/content/solutions-marketing/content-automation.md +111 -0
- package/lib/templates/content/solutions-marketing/marketing-overview.md +108 -0
- package/lib/templates/content/solutions-marketing/social-media-management.md +108 -0
- package/lib/templates/content/solutions-sales/call-preparation.md +106 -0
- package/lib/templates/content/solutions-sales/crm-automation.md +119 -0
- package/lib/templates/content/solutions-sales/lead-management.md +108 -0
- package/lib/templates/content/solutions-sales/sales-overview.md +120 -0
- package/lib/{content → templates/content}/spaces-library/spaces-overview.md +8 -0
- package/lib/{content → templates/content}/student-hub/academic-research.md +8 -0
- package/lib/{content → templates/content}/student-hub/student-discounts.md +10 -0
- package/lib/{content → templates/content}/student-hub/student-overview.md +8 -0
- package/lib/{content → templates/content}/student-hub/study-tools.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/billing-cycle.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/billing-overview.md +6 -0
- package/lib/{content → templates/content}/subscription-billing/billing-support.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/currency-support.md +10 -0
- package/lib/{content → templates/content}/subscription-billing/enterprise-pricing.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/invoice-management.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/payment-methods.md +9 -0
- package/lib/{content → templates/content}/subscription-billing/promotional-offers.md +8 -0
- package/lib/{content → templates/content}/subscription-billing/refund-policy.md +10 -0
- package/lib/{content → templates/content}/subscription-billing/student-discounts.md +10 -0
- package/lib/{content → templates/content}/subscription-billing/tax-information.md +8 -0
- package/lib/{content → templates/content}/technical-questions/ai-models-technical.md +10 -0
- package/lib/{content → templates/content}/technical-questions/api-technical.md +10 -0
- package/lib/{content → templates/content}/technical-questions/data-processing.md +10 -0
- package/lib/{content → templates/content}/technical-questions/database-architecture.md +10 -0
- package/lib/{content → templates/content}/technical-questions/infrastructure.md +10 -0
- package/lib/{content → templates/content}/technical-questions/performance-optimization.md +10 -0
- package/lib/{content → templates/content}/technical-questions/search-algorithms.md +10 -0
- package/lib/{content → templates/content}/technical-questions/technical-overview.md +10 -0
- package/lib/{content → templates/content}/threads/conversation-management.md +8 -0
- package/lib/{content → templates/content}/threads/threads-overview.md +8 -0
- package/lib/{content → templates/content}/troubleshooting/common-issues.md +8 -0
- package/lib/templates/content/use-cases/engineering-use-cases.md +123 -0
- package/lib/templates/content/use-cases/marketing-use-cases.md +128 -0
- package/lib/templates/content/use-cases/sales-use-cases.md +123 -0
- package/lib/templates/content/use-cases/support-use-cases.md +120 -0
- package/lib/templates/content/use-cases/use-cases-overview.md +115 -0
- package/lib/{content → templates/content}/what-is-yantra/getting-started-yantra.md +1 -1
- package/lib/{content → templates/content}/what-is-yantra/how-yantra-works.md +1 -1
- package/lib/{content → templates/content}/what-is-yantra/practical-tips-yantra.md +2 -1
- package/lib/{content → templates/content}/what-is-yantra/what-is-yantra-intro.md +1 -1
- package/lib/{content → templates/content}/what-is-yantra/yantra-discord-community.md +4 -1
- package/lib/{content → templates/content}/yantra-assistant/android-app.md +10 -0
- package/lib/{content → templates/content}/yantra-assistant/ios-app.md +10 -0
- package/lib/{content → templates/content}/yantra-assistant/mobile-app-overview.md +8 -0
- package/lib/{content → templates/content}/yantra-assistant/voice-assistant.md +10 -0
- package/lib/{content → templates/content}/yantra-enterprise/admin-dashboard.md +10 -0
- package/lib/{content → templates/content}/yantra-enterprise/custom-branding.md +10 -0
- package/lib/{content → templates/content}/yantra-enterprise/dedicated-support.md +10 -0
- package/lib/{content → templates/content}/yantra-enterprise/enterprise-overview.md +8 -0
- package/lib/{content → templates/content}/yantra-enterprise/sso-integration.md +10 -0
- package/lib/{content → templates/content}/yantra-enterprise/user-management.md +10 -0
- package/lib/{content → templates/content}/yantra-pro-max/billing-management.md +13 -0
- package/lib/{content → templates/content}/yantra-pro-max/cancellation-refund.md +13 -0
- package/lib/{content → templates/content}/yantra-pro-max/pro-pricing.md +13 -9
- package/lib/{content → templates/content}/yantra-pro-max/subscription-benefits.md +8 -0
- package/lib/{content → templates/content}/yantra-pro-max/upgrade-process.md +13 -0
- package/lib/{content → templates/content}/yantra-pro-max/yantra-max-features.md +8 -8
- package/lib/{content → templates/content}/yantra-pro-max/yantra-pro-overview.md +8 -8
- package/lib/utils/docsNavigation.d.ts +10 -0
- package/lib/utils/docsNavigation.d.ts.map +1 -0
- package/lib/utils/docsNavigation.js +151 -0
- package/lib/utils/docsNavigation.js.map +1 -0
- package/lib/utils/helpCenterUtils.d.ts.map +1 -1
- package/lib/utils/markdownLoader.d.ts +12 -4
- package/lib/utils/markdownLoader.d.ts.map +1 -1
- package/lib/utils/markdownLoader.js +362 -1163
- package/lib/utils/markdownLoader.js.map +1 -1
- package/package.json +23 -6
- package/lib/pages/ArticlePage/index.d.ts +0 -4
- package/lib/pages/ArticlePage/index.d.ts.map +0 -1
- package/lib/pages/ArticlePage/index.js +0 -190
- package/lib/pages/ArticlePage/index.js.map +0 -1
- package/lib/pages/HelpCenter/components/BookStack.js +0 -36
- package/lib/pages/HelpCenter/components/BookStack.js.map +0 -1
- package/lib/pages/LandingPage/components/SearchBar.d.ts +0 -8
- package/lib/pages/LandingPage/components/SearchBar.d.ts.map +0 -1
- package/lib/pages/LandingPage/components/SearchBar.js +0 -58
- package/lib/pages/LandingPage/components/SearchBar.js.map +0 -1
|
@@ -1,16 +1,208 @@
|
|
|
1
|
-
import {marked}from'marked';//
|
|
1
|
+
import {marked}from'marked';// Cache for manifest
|
|
2
|
+
let cachedManifest = null;
|
|
3
|
+
let manifestLoadPromise = null;
|
|
4
|
+
// Function to load content manifest
|
|
5
|
+
async function loadContentManifest() {
|
|
6
|
+
if (cachedManifest) {
|
|
7
|
+
return cachedManifest;
|
|
8
|
+
}
|
|
9
|
+
// If already loading, return the existing promise
|
|
10
|
+
if (manifestLoadPromise) {
|
|
11
|
+
return manifestLoadPromise;
|
|
12
|
+
}
|
|
13
|
+
// Check if we're in a browser environment (window.location is only available in browsers)
|
|
14
|
+
const isBrowser = typeof window !== 'undefined' && typeof window.location !== 'undefined';
|
|
15
|
+
if (!isBrowser) {
|
|
16
|
+
// In Node.js/build-time environment, we can't fetch, so return null
|
|
17
|
+
// The sync functions will work with empty data during build
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
// Create a promise for loading the manifest
|
|
21
|
+
manifestLoadPromise = (async () => {
|
|
22
|
+
try {
|
|
23
|
+
// Try multiple possible paths where the manifest might be served
|
|
24
|
+
const baseUrl = window.location.origin;
|
|
25
|
+
const possiblePaths = [`${baseUrl}/content/content-manifest.json`, '/content/content-manifest.json', './content/content-manifest.json', '../content/content-manifest.json'];
|
|
26
|
+
for (const path of possiblePaths) {
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(path);
|
|
29
|
+
if (response.ok) {
|
|
30
|
+
const manifest = await response.json();
|
|
31
|
+
cachedManifest = manifest;
|
|
32
|
+
console.log('✅ Successfully loaded content manifest from:', path);
|
|
33
|
+
return manifest;
|
|
34
|
+
} else {
|
|
35
|
+
console.log(`⚠️ Manifest not found at ${path} (status: ${response.status})`);
|
|
36
|
+
}
|
|
37
|
+
} catch (fetchError) {
|
|
38
|
+
// Try next path
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
console.error('❌ Could not load content manifest from any path. Tried:', possiblePaths);
|
|
43
|
+
console.error('💡 Make sure content-manifest.json is in the public directory and accessible.');
|
|
44
|
+
return null;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error('❌ Error loading content manifest:', error);
|
|
47
|
+
return null;
|
|
48
|
+
} finally {
|
|
49
|
+
manifestLoadPromise = null;
|
|
50
|
+
}
|
|
51
|
+
})();
|
|
52
|
+
return manifestLoadPromise;
|
|
53
|
+
}
|
|
54
|
+
// Function to get content path map dynamically
|
|
55
|
+
async function getContentPathMap() {
|
|
56
|
+
const manifest = await loadContentManifest();
|
|
57
|
+
if (manifest && manifest.contentPathMap) {
|
|
58
|
+
return manifest.contentPathMap;
|
|
59
|
+
}
|
|
60
|
+
// Fallback to empty map if manifest not available
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
// Function to get category metadata dynamically
|
|
64
|
+
async function getCategoryMetadata() {
|
|
65
|
+
const manifest = await loadContentManifest();
|
|
66
|
+
if (manifest && manifest.categories) {
|
|
67
|
+
return manifest.categories;
|
|
68
|
+
}
|
|
69
|
+
// Fallback to empty categories if manifest not available
|
|
70
|
+
console.warn('Category metadata not available - manifest may not be loaded');
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
// Configure marked options
|
|
2
74
|
marked.setOptions({
|
|
3
75
|
breaks: true,
|
|
4
76
|
gfm: true
|
|
5
77
|
});
|
|
6
78
|
// Custom renderer to add IDs to headings
|
|
7
79
|
const renderer = new marked.Renderer();
|
|
8
|
-
|
|
80
|
+
const normalizeStaticAssetHref = href => {
|
|
81
|
+
// Convert markdown-relative references like "../static/img/x.png" into absolute "/static/img/x.png"
|
|
82
|
+
// so they resolve correctly when the article is served under routes like "/help-center/...".
|
|
83
|
+
if (!href) return href;
|
|
84
|
+
if (href.startsWith('/')) return href;
|
|
85
|
+
// Remove leading ./ and ../ segments
|
|
86
|
+
const cleaned = href.replace(/^(\.\/)+/, '').replace(/^(\.\.\/)+/, '');
|
|
87
|
+
if (cleaned.startsWith('static/')) return `/${cleaned}`;
|
|
88
|
+
if (cleaned.startsWith('content/')) return `/${cleaned}`;
|
|
89
|
+
return href;
|
|
90
|
+
};
|
|
91
|
+
renderer.heading = function ({
|
|
92
|
+
tokens,
|
|
93
|
+
depth
|
|
94
|
+
}) {
|
|
95
|
+
// Extract text from tokens for ID generation
|
|
96
|
+
const extractText = tokenArray => {
|
|
97
|
+
return tokenArray.map(token => {
|
|
98
|
+
if (token.type === 'text') {
|
|
99
|
+
return token.raw || token.text || '';
|
|
100
|
+
}
|
|
101
|
+
if (token.tokens) {
|
|
102
|
+
return extractText(token.tokens);
|
|
103
|
+
}
|
|
104
|
+
return token.raw || '';
|
|
105
|
+
}).join('');
|
|
106
|
+
};
|
|
107
|
+
// Render tokens to HTML
|
|
108
|
+
const renderInline = tokenArray => {
|
|
109
|
+
return tokenArray.map(token => {
|
|
110
|
+
if (token.type === 'text') {
|
|
111
|
+
// Escape HTML for text tokens
|
|
112
|
+
const text = token.raw || token.text || '';
|
|
113
|
+
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
114
|
+
}
|
|
115
|
+
// Handle other inline token types
|
|
116
|
+
if (token.type === 'strong' && token.tokens) {
|
|
117
|
+
return `<strong>${renderInline(token.tokens)}</strong>`;
|
|
118
|
+
}
|
|
119
|
+
if (token.type === 'em' && token.tokens) {
|
|
120
|
+
return `<em>${renderInline(token.tokens)}</em>`;
|
|
121
|
+
}
|
|
122
|
+
if (token.type === 'code') {
|
|
123
|
+
const code = token.raw || token.text || '';
|
|
124
|
+
return `<code>${code.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</code>`;
|
|
125
|
+
}
|
|
126
|
+
if (token.tokens) {
|
|
127
|
+
return renderInline(token.tokens);
|
|
128
|
+
}
|
|
129
|
+
return token.raw || '';
|
|
130
|
+
}).join('');
|
|
131
|
+
};
|
|
132
|
+
const text = extractText(tokens);
|
|
133
|
+
const renderedText = renderInline(tokens);
|
|
9
134
|
const id = text.toLowerCase().replace(/[^\w\s-]/g, '') // Remove special characters
|
|
10
135
|
.replace(/\s+/g, '-') // Replace spaces with hyphens
|
|
11
136
|
.replace(/-+/g, '-') // Replace multiple hyphens with single hyphen
|
|
12
137
|
.trim();
|
|
13
|
-
return `<h${
|
|
138
|
+
return `<h${depth} id="${id}">${renderedText}</h${depth}>`;
|
|
139
|
+
};
|
|
140
|
+
renderer.image = function ({
|
|
141
|
+
href,
|
|
142
|
+
title,
|
|
143
|
+
text
|
|
144
|
+
}) {
|
|
145
|
+
const src = href ? normalizeStaticAssetHref(href) : '';
|
|
146
|
+
const safeAlt = (text || '').replaceAll('"', '"');
|
|
147
|
+
const titleAttr = title ? ` title="${title.replaceAll('"', '"')}"` : '';
|
|
148
|
+
return `<img src="${src}" alt="${safeAlt}"${titleAttr} />`;
|
|
149
|
+
};
|
|
150
|
+
// Code block renderer with copy button
|
|
151
|
+
renderer.code = function ({
|
|
152
|
+
text,
|
|
153
|
+
lang
|
|
154
|
+
}) {
|
|
155
|
+
// Escape HTML in code content
|
|
156
|
+
const escapeHtml = str => {
|
|
157
|
+
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
158
|
+
};
|
|
159
|
+
const escapedCode = escapeHtml(text);
|
|
160
|
+
const language = lang || 'plaintext';
|
|
161
|
+
`copy-btn-${Math.random().toString(36).substring(2, 11)}`;
|
|
162
|
+
const codeBlockId = `code-block-${Math.random().toString(36).substring(2, 11)}`;
|
|
163
|
+
return `
|
|
164
|
+
<div class="code-block-wrapper bg-background text-primary" style="position: relative; margin: 1em 0;">
|
|
165
|
+
<button
|
|
166
|
+
class="copy-code-btn"
|
|
167
|
+
data-code-id="${codeBlockId}"
|
|
168
|
+
style="
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 0.5em;
|
|
171
|
+
right: 0.5em;
|
|
172
|
+
padding: 0.25em 0.75em;
|
|
173
|
+
border: 1px solid #d1d5db;
|
|
174
|
+
border-radius: 8px;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
font-size: 0.875em;
|
|
177
|
+
z-index: 10;
|
|
178
|
+
transition: all 0.2s;
|
|
179
|
+
"
|
|
180
|
+
onmouseover="this.style.background='#e5e7eb'"
|
|
181
|
+
onmouseout="this.style.background='#f3f4f6'"
|
|
182
|
+
onclick="
|
|
183
|
+
const codeEl = document.getElementById('${codeBlockId}');
|
|
184
|
+
if (codeEl) {
|
|
185
|
+
const text = codeEl.textContent || codeEl.innerText || '';
|
|
186
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
187
|
+
const btn = event.target;
|
|
188
|
+
const originalText = btn.textContent;
|
|
189
|
+
btn.textContent = 'Copied!';
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
btn.textContent = originalText;
|
|
192
|
+
}, 2000);
|
|
193
|
+
}).catch(() => {
|
|
194
|
+
alert('Failed to copy code');
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
"
|
|
198
|
+
>
|
|
199
|
+
Copy
|
|
200
|
+
</button>
|
|
201
|
+
<pre class="bg-background text-primary border border-border rounded-lg overflow-x-auto" style="margin: 0; padding: 1em; overflow-x: auto;">
|
|
202
|
+
<code id="${codeBlockId}" class="language-${language}" style="display: block; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; font-size: 0.875em; line-height: 1.5;">${escapedCode}</code>
|
|
203
|
+
</pre>
|
|
204
|
+
</div>
|
|
205
|
+
`;
|
|
14
206
|
};
|
|
15
207
|
marked.setOptions({
|
|
16
208
|
renderer: renderer
|
|
@@ -38,84 +230,8 @@ const extractHeadings = markdownContent => {
|
|
|
38
230
|
// Function to load markdown content dynamically
|
|
39
231
|
const loadMarkdownContent = async contentId => {
|
|
40
232
|
try {
|
|
41
|
-
//
|
|
42
|
-
const contentPathMap =
|
|
43
|
-
'what-is-yantra-intro': '/content/what-is-yantra/what-is-yantra-intro.md',
|
|
44
|
-
'how-yantra-works': '/content/what-is-yantra/how-yantra-works.md',
|
|
45
|
-
'practical-tips-yantra': '/content/what-is-yantra/practical-tips-yantra.md',
|
|
46
|
-
'yantra-discord-community': '/content/what-is-yantra/yantra-discord-community.md',
|
|
47
|
-
'getting-started-yantra': '/content/what-is-yantra/getting-started-yantra.md',
|
|
48
|
-
'yantra-pro-overview': '/content/yantra-pro-max/yantra-pro-overview.md',
|
|
49
|
-
'yantra-max-features': '/content/yantra-pro-max/yantra-max-features.md',
|
|
50
|
-
'pro-pricing': '/content/yantra-pro-max/pro-pricing.md',
|
|
51
|
-
'subscription-benefits': '/content/yantra-pro-max/subscription-benefits.md',
|
|
52
|
-
'upgrade-process': '/content/yantra-pro-max/upgrade-process.md',
|
|
53
|
-
'billing-management': '/content/yantra-pro-max/billing-management.md',
|
|
54
|
-
'cancellation-refund': '/content/yantra-pro-max/cancellation-refund.md',
|
|
55
|
-
'search-features': '/content/product-features/search-features.md',
|
|
56
|
-
'ai-models': '/content/product-features/ai-models.md',
|
|
57
|
-
'conversation-features': '/content/product-features/conversation-features.md',
|
|
58
|
-
'source-citations': '/content/product-features/source-citations.md',
|
|
59
|
-
'real-time-search': '/content/product-features/real-time-search.md',
|
|
60
|
-
'follow-up-questions': '/content/product-features/follow-up-questions.md',
|
|
61
|
-
'search-history': '/content/product-features/search-history.md',
|
|
62
|
-
'saved-searches': '/content/product-features/saved-searches.md',
|
|
63
|
-
'export-features': '/content/product-features/export-features.md',
|
|
64
|
-
'collaboration-tools': '/content/product-features/collaboration-tools.md',
|
|
65
|
-
'billing-overview': '/content/subscription-billing/billing-overview.md',
|
|
66
|
-
'payment-methods': '/content/subscription-billing/payment-methods.md',
|
|
67
|
-
'billing-cycle': '/content/subscription-billing/billing-cycle.md',
|
|
68
|
-
'promotional-offers': '/content/subscription-billing/promotional-offers.md',
|
|
69
|
-
'student-discounts': '/content/subscription-billing/student-discounts.md',
|
|
70
|
-
'enterprise-pricing': '/content/subscription-billing/enterprise-pricing.md',
|
|
71
|
-
'invoice-management': '/content/subscription-billing/invoice-management.md',
|
|
72
|
-
'tax-information': '/content/subscription-billing/tax-information.md',
|
|
73
|
-
'billing-support': '/content/subscription-billing/billing-support.md',
|
|
74
|
-
'refund-policy': '/content/subscription-billing/refund-policy.md',
|
|
75
|
-
'currency-support': '/content/subscription-billing/currency-support.md',
|
|
76
|
-
'regular-search': '/content/search-modes/regular-search.md',
|
|
77
|
-
'pro-search': '/content/search-modes/pro-search.md',
|
|
78
|
-
'deep-research': '/content/search-modes/deep-research.md',
|
|
79
|
-
'labs-features': '/content/search-modes/labs-features.md',
|
|
80
|
-
'profile-settings': '/content/account-management/profile-settings.md',
|
|
81
|
-
'account-setup': '/content/account-management/account-setup.md',
|
|
82
|
-
preferences: '/content/account-management/preferences.md',
|
|
83
|
-
'privacy-settings': '/content/account-management/privacy-settings.md',
|
|
84
|
-
'delete-account': '/content/account-management/delete-account.md',
|
|
85
|
-
'mobile-app-overview': '/content/yantra-assistant/mobile-app-overview.md',
|
|
86
|
-
'ios-app': '/content/yantra-assistant/ios-app.md',
|
|
87
|
-
'android-app': '/content/yantra-assistant/android-app.md',
|
|
88
|
-
'voice-assistant': '/content/yantra-assistant/voice-assistant.md',
|
|
89
|
-
'privacy-policy': '/content/data-privacy/privacy-policy.md',
|
|
90
|
-
'data-collection': '/content/data-privacy/data-collection.md',
|
|
91
|
-
'spaces-overview': '/content/spaces-library/spaces-overview.md',
|
|
92
|
-
'threads-overview': '/content/threads/threads-overview.md',
|
|
93
|
-
'conversation-management': '/content/threads/conversation-management.md',
|
|
94
|
-
'api-overview': '/content/scope-api/api-overview.md',
|
|
95
|
-
'file-upload-overview': '/content/file-uploads/file-upload-overview.md',
|
|
96
|
-
'getting-started-guide': '/content/getting-started/getting-started-guide.md',
|
|
97
|
-
'student-overview': '/content/student-hub/student-overview.md',
|
|
98
|
-
'student-discounts-hub': '/content/student-hub/student-discounts.md',
|
|
99
|
-
'academic-research': '/content/student-hub/academic-research.md',
|
|
100
|
-
'study-tools': '/content/student-hub/study-tools.md',
|
|
101
|
-
'privacy-requests': '/content/data-subject-privacy/privacy-requests.md',
|
|
102
|
-
'data-access': '/content/data-subject-privacy/data-access.md',
|
|
103
|
-
'data-portability': '/content/data-subject-privacy/data-portability.md',
|
|
104
|
-
'technical-overview': '/content/technical-questions/technical-overview.md',
|
|
105
|
-
'ai-models-technical': '/content/technical-questions/ai-models-technical.md',
|
|
106
|
-
'search-algorithms': '/content/technical-questions/search-algorithms.md',
|
|
107
|
-
'data-processing': '/content/technical-questions/data-processing.md',
|
|
108
|
-
infrastructure: '/content/technical-questions/infrastructure.md',
|
|
109
|
-
'performance-optimization': '/content/technical-questions/performance-optimization.md',
|
|
110
|
-
'api-technical': '/content/technical-questions/api-technical.md',
|
|
111
|
-
'database-architecture': '/content/technical-questions/database-architecture.md',
|
|
112
|
-
'enterprise-overview': '/content/yantra-enterprise/enterprise-overview.md',
|
|
113
|
-
'admin-dashboard': '/content/yantra-enterprise/admin-dashboard.md',
|
|
114
|
-
'user-management': '/content/yantra-enterprise/user-management.md',
|
|
115
|
-
'sso-integration': '/content/yantra-enterprise/sso-integration.md',
|
|
116
|
-
'custom-branding': '/content/yantra-enterprise/custom-branding.md',
|
|
117
|
-
'dedicated-support': '/content/yantra-enterprise/dedicated-support.md'
|
|
118
|
-
};
|
|
233
|
+
// Get content path map dynamically from manifest
|
|
234
|
+
const contentPathMap = await getContentPathMap();
|
|
119
235
|
const filePath = contentPathMap[contentId];
|
|
120
236
|
if (!filePath) {
|
|
121
237
|
console.warn(`No markdown file found for content ID: ${contentId}`);
|
|
@@ -140,12 +256,11 @@ const loadMarkdownContent = async contentId => {
|
|
|
140
256
|
// Function to load actual markdown files
|
|
141
257
|
const loadActualMarkdownFile = async filePath => {
|
|
142
258
|
try {
|
|
143
|
-
//
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return null;
|
|
259
|
+
// Fetch from the app server. The help server should serve the repo's `src/content`
|
|
260
|
+
// directory at `/content`, so these paths resolve in the browser.
|
|
261
|
+
const response = await fetch(filePath);
|
|
262
|
+
if (!response.ok) return null;
|
|
263
|
+
return await response.text();
|
|
149
264
|
} catch (error) {
|
|
150
265
|
console.error(`Error loading markdown file ${filePath}:`, error);
|
|
151
266
|
return null;
|
|
@@ -153,321 +268,7 @@ const loadActualMarkdownFile = async filePath => {
|
|
|
153
268
|
};
|
|
154
269
|
// Sample content function for development
|
|
155
270
|
const getSampleContent = contentId => {
|
|
156
|
-
|
|
157
|
-
'what-is-yantra-intro': `# What is Yantra?
|
|
158
|
-
|
|
159
|
-
Yantra is an **AI-powered search engine** that searches the web and delivers conversational answers backed by verifiable sources. Unlike traditional search engines that return lists of links, Yantra provides direct answers with citations and links to original sources.
|
|
160
|
-
|
|
161
|
-
## What sets Yantra apart
|
|
162
|
-
|
|
163
|
-
Yantra integrates cutting-edge AI models, including OpenAI's GPT models and Anthropic's Claude, to provide comprehensive and accurate answers to your questions.
|
|
164
|
-
|
|
165
|
-
### Key Features
|
|
166
|
-
|
|
167
|
-
- **Conversational Answers**: Get direct answers instead of just links
|
|
168
|
-
- **Source Citations**: Every answer includes verifiable sources
|
|
169
|
-
- **AI-Powered**: Uses the latest AI models for accurate responses
|
|
170
|
-
- **Real-time Search**: Searches the web in real-time for current information
|
|
171
|
-
|
|
172
|
-
## How to Use Yantra
|
|
173
|
-
|
|
174
|
-
1. **Ask Questions**: Simply type your question in natural language
|
|
175
|
-
2. **Get Answers**: Receive comprehensive answers with sources
|
|
176
|
-
3. **Explore Sources**: Click on citations to explore original sources
|
|
177
|
-
4. **Follow-up**: Ask follow-up questions for deeper understanding
|
|
178
|
-
|
|
179
|
-
## Getting Started
|
|
180
|
-
|
|
181
|
-
To get started with Yantra:
|
|
182
|
-
|
|
183
|
-
1. Visit our website
|
|
184
|
-
2. Sign up for an account
|
|
185
|
-
3. Start asking questions
|
|
186
|
-
4. Explore the different search modes available
|
|
187
|
-
|
|
188
|
-
For more advanced features, consider upgrading to Yantra Pro or Max.`,
|
|
189
|
-
'how-yantra-works': `# How does Yantra work?
|
|
190
|
-
|
|
191
|
-
Yantra combines advanced AI technology with real-time web search to provide accurate, up-to-date answers to your questions.
|
|
192
|
-
|
|
193
|
-
## The Technology Behind Yantra
|
|
194
|
-
|
|
195
|
-
### AI Models Integration
|
|
196
|
-
|
|
197
|
-
Yantra uses multiple AI models to ensure the best possible answers:
|
|
198
|
-
|
|
199
|
-
- **GPT Models**: For comprehensive text generation
|
|
200
|
-
- **Claude**: For advanced reasoning and analysis
|
|
201
|
-
- **Custom Models**: Fine-tuned for specific use cases
|
|
202
|
-
|
|
203
|
-
### Search Process
|
|
204
|
-
|
|
205
|
-
1. **Query Processing**: Your question is analyzed and optimized
|
|
206
|
-
2. **Web Search**: Relevant sources are searched in real-time
|
|
207
|
-
3. **Content Analysis**: AI models analyze and synthesize information
|
|
208
|
-
4. **Answer Generation**: A comprehensive answer is generated with citations
|
|
209
|
-
|
|
210
|
-
## Search Modes
|
|
211
|
-
|
|
212
|
-
Yantra offers different search modes for various needs:
|
|
213
|
-
|
|
214
|
-
- **Regular Search**: Standard web search with AI-powered answers
|
|
215
|
-
- **Pro Search**: Enhanced search with additional features
|
|
216
|
-
- **Deep Research**: Comprehensive research mode for complex topics
|
|
217
|
-
- **Labs**: Experimental features and capabilities
|
|
218
|
-
|
|
219
|
-
## Accuracy and Reliability
|
|
220
|
-
|
|
221
|
-
Yantra prioritizes accuracy through:
|
|
222
|
-
|
|
223
|
-
- **Source Verification**: All sources are verified and current
|
|
224
|
-
- **AI Model Selection**: Best model chosen for each query type
|
|
225
|
-
- **Quality Control**: Multiple quality checks before delivery
|
|
226
|
-
- **User Feedback**: Continuous improvement based on user feedback
|
|
227
|
-
|
|
228
|
-
## Privacy and Security
|
|
229
|
-
|
|
230
|
-
Your privacy is protected with:
|
|
231
|
-
|
|
232
|
-
- **Data Encryption**: All data encrypted in transit and at rest
|
|
233
|
-
- **Privacy Controls**: Granular privacy settings
|
|
234
|
-
- **No Personal Data Storage**: Personal data not stored permanently
|
|
235
|
-
- **GDPR Compliance**: Full compliance with privacy regulations`,
|
|
236
|
-
'practical-tips-yantra': `# Practical Tips for Using Yantra
|
|
237
|
-
|
|
238
|
-
Maximize your productivity with these practical tips for using Yantra effectively.
|
|
239
|
-
|
|
240
|
-
## Search Optimization
|
|
241
|
-
|
|
242
|
-
### Effective Query Techniques
|
|
243
|
-
|
|
244
|
-
- **Be Specific**: Use specific terms for better results
|
|
245
|
-
- **Ask Complete Questions**: Frame complete questions rather than keywords
|
|
246
|
-
- **Use Context**: Provide context when asking follow-up questions
|
|
247
|
-
- **Try Different Phrasings**: Rephrase questions if initial results aren't satisfactory
|
|
248
|
-
|
|
249
|
-
### Advanced Search Tips
|
|
250
|
-
|
|
251
|
-
- **Use Quotes**: Quote specific phrases for exact matches
|
|
252
|
-
- **Combine Concepts**: Ask about relationships between different concepts
|
|
253
|
-
- **Request Examples**: Ask for examples to better understand topics
|
|
254
|
-
- **Ask for Comparisons**: Compare different options or approaches
|
|
255
|
-
|
|
256
|
-
## Research Strategies
|
|
257
|
-
|
|
258
|
-
### Comprehensive Research
|
|
259
|
-
|
|
260
|
-
1. **Start Broad**: Begin with general questions
|
|
261
|
-
2. **Narrow Down**: Ask more specific follow-up questions
|
|
262
|
-
3. **Explore Sources**: Click through to original sources
|
|
263
|
-
4. **Verify Information**: Cross-reference information from multiple sources
|
|
264
|
-
|
|
265
|
-
### Academic Research
|
|
266
|
-
|
|
267
|
-
- **Cite Sources**: Use Yantra's citations for academic work
|
|
268
|
-
- **Check Recency**: Verify information is current
|
|
269
|
-
- **Multiple Perspectives**: Seek different viewpoints on topics
|
|
270
|
-
- **Fact-checking**: Verify claims with original sources
|
|
271
|
-
|
|
272
|
-
## Productivity Features
|
|
273
|
-
|
|
274
|
-
### Time-Saving Techniques
|
|
275
|
-
|
|
276
|
-
- **Saved Searches**: Save frequently used searches
|
|
277
|
-
- **Collections**: Organize research into collections
|
|
278
|
-
- **Export Options**: Export answers for offline use
|
|
279
|
-
- **Follow-up Questions**: Use follow-up questions for deeper exploration
|
|
280
|
-
|
|
281
|
-
### Workflow Integration
|
|
282
|
-
|
|
283
|
-
- **Browser Integration**: Use browser extensions for quick access
|
|
284
|
-
- **API Integration**: Integrate with other tools via API
|
|
285
|
-
- **Mobile Access**: Access Yantra on mobile devices
|
|
286
|
-
- **Team Collaboration**: Share research with team members
|
|
287
|
-
|
|
288
|
-
## Best Practices
|
|
289
|
-
|
|
290
|
-
### Information Quality
|
|
291
|
-
|
|
292
|
-
- **Verify Sources**: Always check original sources
|
|
293
|
-
- **Consider Bias**: Be aware of potential bias in sources
|
|
294
|
-
- **Multiple Sources**: Consult multiple sources for important topics
|
|
295
|
-
- **Update Information**: Check for updates on evolving topics
|
|
296
|
-
|
|
297
|
-
### Ethical Usage
|
|
298
|
-
|
|
299
|
-
- **Respect Copyright**: Respect intellectual property rights
|
|
300
|
-
- **Proper Attribution**: Give proper credit to sources
|
|
301
|
-
- **Academic Integrity**: Use responsibly in academic contexts
|
|
302
|
-
- **Fact-checking**: Verify information before sharing`,
|
|
303
|
-
'yantra-discord-community': `# Yantra Discord Community
|
|
304
|
-
|
|
305
|
-
Join our vibrant Discord community to connect with other Yantra users, get help, and share insights.
|
|
306
|
-
|
|
307
|
-
## Community Benefits
|
|
308
|
-
|
|
309
|
-
### Learning and Support
|
|
310
|
-
|
|
311
|
-
- **Peer Support**: Get help from other users
|
|
312
|
-
- **Expert Advice**: Access to Yantra team members
|
|
313
|
-
- **Best Practices**: Learn from experienced users
|
|
314
|
-
- **Troubleshooting**: Get help with technical issues
|
|
315
|
-
|
|
316
|
-
### Networking Opportunities
|
|
317
|
-
|
|
318
|
-
- **Professional Connections**: Connect with professionals in your field
|
|
319
|
-
- **Knowledge Sharing**: Share your expertise with others
|
|
320
|
-
- **Collaboration**: Find collaboration opportunities
|
|
321
|
-
- **Mentorship**: Both give and receive mentorship
|
|
322
|
-
|
|
323
|
-
## Community Guidelines
|
|
324
|
-
|
|
325
|
-
### Respectful Interaction
|
|
326
|
-
|
|
327
|
-
- **Be Respectful**: Treat all members with respect
|
|
328
|
-
- **Constructive Feedback**: Provide helpful, constructive feedback
|
|
329
|
-
- **No Spam**: Avoid repetitive or irrelevant messages
|
|
330
|
-
- **Stay On Topic**: Keep discussions relevant to the channel
|
|
331
|
-
|
|
332
|
-
### Content Guidelines
|
|
333
|
-
|
|
334
|
-
- **Appropriate Content**: Share only appropriate content
|
|
335
|
-
- **No Self-Promotion**: Avoid excessive self-promotion
|
|
336
|
-
- **Helpful Sharing**: Share content that benefits the community
|
|
337
|
-
- **Respect Privacy**: Respect others' privacy
|
|
338
|
-
|
|
339
|
-
## Getting Started
|
|
340
|
-
|
|
341
|
-
### Joining the Community
|
|
342
|
-
|
|
343
|
-
1. **Discord Invite**: Use the official invite link
|
|
344
|
-
2. **Complete Profile**: Set up your Discord profile
|
|
345
|
-
3. **Read Guidelines**: Familiarize yourself with community rules
|
|
346
|
-
4. **Introduce Yourself**: Introduce yourself in the welcome channel
|
|
347
|
-
|
|
348
|
-
### Finding Your Way
|
|
349
|
-
|
|
350
|
-
- **Channel Guide**: Review the channel descriptions
|
|
351
|
-
- **Role Assignment**: Get appropriate roles assigned
|
|
352
|
-
- **Notification Settings**: Configure notification preferences
|
|
353
|
-
- **Search Function**: Use Discord's search to find past discussions
|
|
354
|
-
|
|
355
|
-
## Community Channels
|
|
356
|
-
|
|
357
|
-
### Main Channels
|
|
358
|
-
|
|
359
|
-
- **General Discussion**: General Yantra-related discussions
|
|
360
|
-
- **Help and Support**: Get help with Yantra
|
|
361
|
-
- **Feature Requests**: Suggest new features
|
|
362
|
-
- **Announcements**: Official Yantra announcements
|
|
363
|
-
|
|
364
|
-
### Specialized Channels
|
|
365
|
-
|
|
366
|
-
- **Academic Research**: Academic and research discussions
|
|
367
|
-
- **Business Use**: Business and professional use cases
|
|
368
|
-
- **Technical Discussion**: Technical implementation discussions
|
|
369
|
-
- **Community Projects**: Community-driven projects
|
|
370
|
-
|
|
371
|
-
## Community Events
|
|
372
|
-
|
|
373
|
-
### Regular Events
|
|
374
|
-
|
|
375
|
-
- **Weekly Q&A**: Weekly question and answer sessions
|
|
376
|
-
- **Feature Demos**: Demonstrations of new features
|
|
377
|
-
- **Community Challenges**: Fun challenges and competitions
|
|
378
|
-
- **Guest Speakers**: Industry expert presentations
|
|
379
|
-
|
|
380
|
-
### Special Events
|
|
381
|
-
|
|
382
|
-
- **Product Launches**: Special events for new product launches
|
|
383
|
-
- **Community Meetups**: Virtual and in-person meetups
|
|
384
|
-
- **Hackathons**: Community hackathons and competitions
|
|
385
|
-
- **Awards**: Recognition for community contributions`,
|
|
386
|
-
'getting-started-yantra': `# Getting Started with Yantra
|
|
387
|
-
|
|
388
|
-
A comprehensive guide to help you get started with Yantra and make the most of its features.
|
|
389
|
-
|
|
390
|
-
## Account Setup
|
|
391
|
-
|
|
392
|
-
### Creating Your Account
|
|
393
|
-
|
|
394
|
-
1. **Visit Yantra**: Go to the Yantra website
|
|
395
|
-
2. **Sign Up**: Create your account with email or social login
|
|
396
|
-
3. **Verify Email**: Verify your email address
|
|
397
|
-
4. **Complete Profile**: Fill out your profile information
|
|
398
|
-
|
|
399
|
-
### Initial Configuration
|
|
400
|
-
|
|
401
|
-
- **Preferences**: Set your search preferences
|
|
402
|
-
- **Notifications**: Configure notification settings
|
|
403
|
-
- **Privacy Settings**: Review and adjust privacy settings
|
|
404
|
-
- **Profile Customization**: Customize your profile
|
|
405
|
-
|
|
406
|
-
## First Steps
|
|
407
|
-
|
|
408
|
-
### Basic Usage
|
|
409
|
-
|
|
410
|
-
1. **Ask Your First Question**: Try asking a simple question
|
|
411
|
-
2. **Explore Results**: Review the answer and sources
|
|
412
|
-
3. **Try Follow-ups**: Ask follow-up questions
|
|
413
|
-
4. **Save Searches**: Save useful searches for later
|
|
414
|
-
|
|
415
|
-
### Understanding Features
|
|
416
|
-
|
|
417
|
-
- **Search Modes**: Learn about different search modes
|
|
418
|
-
- **Source Citations**: Understand how citations work
|
|
419
|
-
- **Collections**: Learn to organize your research
|
|
420
|
-
- **Export Options**: Explore export capabilities
|
|
421
|
-
|
|
422
|
-
## Essential Features
|
|
423
|
-
|
|
424
|
-
### Core Functionality
|
|
425
|
-
|
|
426
|
-
- **Natural Language Queries**: Ask questions in natural language
|
|
427
|
-
- **Real-time Search**: Get current information from the web
|
|
428
|
-
- **Source Verification**: Verify information with original sources
|
|
429
|
-
- **Follow-up Questions**: Continue conversations with follow-ups
|
|
430
|
-
|
|
431
|
-
### Advanced Features
|
|
432
|
-
|
|
433
|
-
- **Collections**: Organize research into collections
|
|
434
|
-
- **Saved Searches**: Save frequently used searches
|
|
435
|
-
- **Export Options**: Export answers in various formats
|
|
436
|
-
- **API Access**: Use Yantra via API for integration
|
|
437
|
-
|
|
438
|
-
## Tips for Success
|
|
439
|
-
|
|
440
|
-
### Effective Searching
|
|
441
|
-
|
|
442
|
-
- **Be Specific**: Ask specific questions for better results
|
|
443
|
-
- **Provide Context**: Give context for complex questions
|
|
444
|
-
- **Use Follow-ups**: Use follow-up questions for deeper understanding
|
|
445
|
-
- **Verify Sources**: Always check original sources
|
|
446
|
-
|
|
447
|
-
### Productivity Tips
|
|
448
|
-
|
|
449
|
-
- **Organize Research**: Use collections to organize your research
|
|
450
|
-
- **Save Useful Searches**: Save searches you use frequently
|
|
451
|
-
- **Export Important Information**: Export key findings
|
|
452
|
-
- **Share with Team**: Share research with colleagues
|
|
453
|
-
|
|
454
|
-
## Getting Help
|
|
455
|
-
|
|
456
|
-
### Support Resources
|
|
457
|
-
|
|
458
|
-
- **Help Center**: Comprehensive help documentation
|
|
459
|
-
- **Community Forum**: Connect with other users
|
|
460
|
-
- **Contact Support**: Reach out to our support team
|
|
461
|
-
- **Video Tutorials**: Watch tutorial videos
|
|
462
|
-
|
|
463
|
-
### Learning Resources
|
|
464
|
-
|
|
465
|
-
- **Documentation**: Detailed feature documentation
|
|
466
|
-
- **Best Practices**: Learn best practices from experienced users
|
|
467
|
-
- **Use Cases**: Explore different use cases and examples
|
|
468
|
-
- **Advanced Guides**: Advanced usage guides and tips`
|
|
469
|
-
};
|
|
470
|
-
return sampleContent[contentId] || `# ${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}
|
|
271
|
+
return `# ${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}
|
|
471
272
|
|
|
472
273
|
This is sample content for ${contentId}. The actual markdown file content would be loaded here in a production environment.
|
|
473
274
|
|
|
@@ -501,787 +302,185 @@ For advanced users, here are some additional tips and techniques:
|
|
|
501
302
|
|
|
502
303
|
If you need help with this topic, please refer to our support resources or contact our team.`;
|
|
503
304
|
};
|
|
504
|
-
// Category metadata -
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
articles: [{
|
|
512
|
-
id: 'what-is-yantra-intro',
|
|
513
|
-
title: 'What is Yantra?',
|
|
514
|
-
description: 'Learn more about Yantra and what sets us apart from traditional search engines.',
|
|
515
|
-
slug: 'what-is-yantra-intro',
|
|
516
|
-
author: 'Beena',
|
|
517
|
-
updatedAt: '4 months ago',
|
|
518
|
-
categoryId: 'what-is-yantra'
|
|
519
|
-
}, {
|
|
520
|
-
id: 'how-yantra-works',
|
|
521
|
-
title: 'How does Yantra work?',
|
|
522
|
-
description: 'Learn how Yantra uses AI to search the web and provide conversational answers.',
|
|
523
|
-
slug: 'how-yantra-works',
|
|
524
|
-
author: 'Beena',
|
|
525
|
-
updatedAt: '4 months ago',
|
|
526
|
-
categoryId: 'what-is-yantra'
|
|
527
|
-
}, {
|
|
528
|
-
id: 'practical-tips-yantra',
|
|
529
|
-
title: 'Practical Tips for Using Yantra',
|
|
530
|
-
description: 'Maximize your productivity with these practical tips for using Yantra effectively.',
|
|
531
|
-
slug: 'practical-tips-yantra',
|
|
532
|
-
author: 'Beena',
|
|
533
|
-
updatedAt: '4 months ago',
|
|
534
|
-
categoryId: 'what-is-yantra'
|
|
535
|
-
}, {
|
|
536
|
-
id: 'yantra-discord-community',
|
|
537
|
-
title: 'Yantra Discord Community',
|
|
538
|
-
description: 'Join our vibrant Discord community to connect with other Yantra users, get help, and share insights.',
|
|
539
|
-
slug: 'yantra-discord-community',
|
|
540
|
-
author: 'Beena',
|
|
541
|
-
updatedAt: '4 months ago',
|
|
542
|
-
categoryId: 'what-is-yantra'
|
|
543
|
-
}, {
|
|
544
|
-
id: 'getting-started-yantra',
|
|
545
|
-
title: 'Getting Started with Yantra',
|
|
546
|
-
description: 'A comprehensive guide to help you get started with Yantra and make the most of its features.',
|
|
547
|
-
slug: 'getting-started-yantra',
|
|
548
|
-
author: 'Beena',
|
|
549
|
-
updatedAt: '4 months ago',
|
|
550
|
-
categoryId: 'what-is-yantra'
|
|
551
|
-
}]
|
|
552
|
-
},
|
|
553
|
-
'yantra-pro-max': {
|
|
554
|
-
id: 'yantra-pro-max',
|
|
555
|
-
title: 'Yantra Pro and Max',
|
|
556
|
-
description: 'Pro | Max | Pricing | Billing',
|
|
557
|
-
iconType: 'Pro',
|
|
558
|
-
articles: [{
|
|
559
|
-
id: 'yantra-pro-overview',
|
|
560
|
-
title: 'Yantra Pro Overview',
|
|
561
|
-
description: 'Learn about Yantra Pro features and benefits.',
|
|
562
|
-
slug: 'yantra-pro-overview',
|
|
563
|
-
author: 'Beena',
|
|
564
|
-
updatedAt: '4 months ago',
|
|
565
|
-
categoryId: 'yantra-pro-max'
|
|
566
|
-
}, {
|
|
567
|
-
id: 'yantra-max-features',
|
|
568
|
-
title: 'Yantra Max Features',
|
|
569
|
-
description: 'Discover the advanced features available in Yantra Max.',
|
|
570
|
-
slug: 'yantra-max-features',
|
|
571
|
-
author: 'Beena',
|
|
572
|
-
updatedAt: '4 months ago',
|
|
573
|
-
categoryId: 'yantra-pro-max'
|
|
574
|
-
}, {
|
|
575
|
-
id: 'pro-pricing',
|
|
576
|
-
title: 'Pro Pricing',
|
|
577
|
-
description: 'Understand Yantra Pro pricing and what you get with your subscription.',
|
|
578
|
-
slug: 'pro-pricing',
|
|
579
|
-
author: 'Beena',
|
|
580
|
-
updatedAt: '4 months ago',
|
|
581
|
-
categoryId: 'yantra-pro-max'
|
|
582
|
-
}, {
|
|
583
|
-
id: 'subscription-benefits',
|
|
584
|
-
title: 'Subscription Benefits',
|
|
585
|
-
description: 'Explore the benefits of subscribing to Yantra Pro or Max.',
|
|
586
|
-
slug: 'subscription-benefits',
|
|
587
|
-
author: 'Beena',
|
|
588
|
-
updatedAt: '4 months ago',
|
|
589
|
-
categoryId: 'yantra-pro-max'
|
|
590
|
-
}, {
|
|
591
|
-
id: 'upgrade-process',
|
|
592
|
-
title: 'Upgrade Process',
|
|
593
|
-
description: 'Learn how to upgrade your Yantra account to Pro or Max.',
|
|
594
|
-
slug: 'upgrade-process',
|
|
595
|
-
author: 'Beena',
|
|
596
|
-
updatedAt: '4 months ago',
|
|
597
|
-
categoryId: 'yantra-pro-max'
|
|
598
|
-
}, {
|
|
599
|
-
id: 'billing-management',
|
|
600
|
-
title: 'Billing Management',
|
|
601
|
-
description: 'Manage your Yantra subscription billing and payment methods.',
|
|
602
|
-
slug: 'billing-management',
|
|
603
|
-
author: 'Beena',
|
|
604
|
-
updatedAt: '4 months ago',
|
|
605
|
-
categoryId: 'yantra-pro-max'
|
|
606
|
-
}, {
|
|
607
|
-
id: 'cancellation-refund',
|
|
608
|
-
title: 'Cancellation & Refund',
|
|
609
|
-
description: 'Information about canceling your subscription and refund policies.',
|
|
610
|
-
slug: 'cancellation-refund',
|
|
611
|
-
author: 'Beena',
|
|
612
|
-
updatedAt: '4 months ago',
|
|
613
|
-
categoryId: 'yantra-pro-max'
|
|
614
|
-
}]
|
|
615
|
-
},
|
|
616
|
-
'product-features': {
|
|
617
|
-
id: 'product-features',
|
|
618
|
-
title: 'Product Features',
|
|
619
|
-
description: 'Search | AI | Citations | Export',
|
|
620
|
-
iconType: 'Features',
|
|
621
|
-
articles: [{
|
|
622
|
-
id: 'search-features',
|
|
623
|
-
title: 'Search Features',
|
|
624
|
-
description: "Explore Yantra's powerful search capabilities and features.",
|
|
625
|
-
slug: 'search-features',
|
|
626
|
-
author: 'Beena',
|
|
627
|
-
updatedAt: '4 months ago',
|
|
628
|
-
categoryId: 'product-features'
|
|
629
|
-
}, {
|
|
630
|
-
id: 'ai-models',
|
|
631
|
-
title: 'AI Models',
|
|
632
|
-
description: "Learn about the AI models powering Yantra's search and answers.",
|
|
633
|
-
slug: 'ai-models',
|
|
634
|
-
author: 'Beena',
|
|
635
|
-
updatedAt: '4 months ago',
|
|
636
|
-
categoryId: 'product-features'
|
|
637
|
-
}, {
|
|
638
|
-
id: 'conversation-features',
|
|
639
|
-
title: 'Conversation Features',
|
|
640
|
-
description: "Discover Yantra's conversational AI capabilities.",
|
|
641
|
-
slug: 'conversation-features',
|
|
642
|
-
author: 'Beena',
|
|
643
|
-
updatedAt: '4 months ago',
|
|
644
|
-
categoryId: 'product-features'
|
|
645
|
-
}, {
|
|
646
|
-
id: 'source-citations',
|
|
647
|
-
title: 'Source Citations',
|
|
648
|
-
description: 'Understand how Yantra provides verifiable source citations.',
|
|
649
|
-
slug: 'source-citations',
|
|
650
|
-
author: 'Beena',
|
|
651
|
-
updatedAt: '4 months ago',
|
|
652
|
-
categoryId: 'product-features'
|
|
653
|
-
}, {
|
|
654
|
-
id: 'real-time-search',
|
|
655
|
-
title: 'Real-time Search',
|
|
656
|
-
description: "Learn about Yantra's real-time web search capabilities.",
|
|
657
|
-
slug: 'real-time-search',
|
|
658
|
-
author: 'Beena',
|
|
659
|
-
updatedAt: '4 months ago',
|
|
660
|
-
categoryId: 'product-features'
|
|
661
|
-
}, {
|
|
662
|
-
id: 'follow-up-questions',
|
|
663
|
-
title: 'Follow-up Questions',
|
|
664
|
-
description: 'Master the art of asking effective follow-up questions.',
|
|
665
|
-
slug: 'follow-up-questions',
|
|
666
|
-
author: 'Beena',
|
|
667
|
-
updatedAt: '4 months ago',
|
|
668
|
-
categoryId: 'product-features'
|
|
669
|
-
}, {
|
|
670
|
-
id: 'search-history',
|
|
671
|
-
title: 'Search History',
|
|
672
|
-
description: 'Access and manage your Yantra search history.',
|
|
673
|
-
slug: 'search-history',
|
|
674
|
-
author: 'Beena',
|
|
675
|
-
updatedAt: '4 months ago',
|
|
676
|
-
categoryId: 'product-features'
|
|
677
|
-
}, {
|
|
678
|
-
id: 'saved-searches',
|
|
679
|
-
title: 'Saved Searches',
|
|
680
|
-
description: 'Save and organize your frequently used searches.',
|
|
681
|
-
slug: 'saved-searches',
|
|
682
|
-
author: 'Beena',
|
|
683
|
-
updatedAt: '4 months ago',
|
|
684
|
-
categoryId: 'product-features'
|
|
685
|
-
}, {
|
|
686
|
-
id: 'export-features',
|
|
687
|
-
title: 'Export Features',
|
|
688
|
-
description: 'Export your Yantra research and answers in various formats.',
|
|
689
|
-
slug: 'export-features',
|
|
690
|
-
author: 'Beena',
|
|
691
|
-
updatedAt: '4 months ago',
|
|
692
|
-
categoryId: 'product-features'
|
|
693
|
-
}, {
|
|
694
|
-
id: 'collaboration-tools',
|
|
695
|
-
title: 'Collaboration Tools',
|
|
696
|
-
description: "Collaborate with others using Yantra's sharing and team features.",
|
|
697
|
-
slug: 'collaboration-tools',
|
|
698
|
-
author: 'Beena',
|
|
699
|
-
updatedAt: '4 months ago',
|
|
700
|
-
categoryId: 'product-features'
|
|
701
|
-
}]
|
|
702
|
-
},
|
|
703
|
-
'subscription-billing': {
|
|
704
|
-
id: 'subscription-billing',
|
|
705
|
-
title: 'Subscription, Billing & Promotions',
|
|
706
|
-
description: 'Billing | Payment | Promotions | Refunds',
|
|
707
|
-
iconType: 'Subscription',
|
|
708
|
-
articles: [{
|
|
709
|
-
id: 'billing-overview',
|
|
710
|
-
title: 'Billing Overview',
|
|
711
|
-
description: "Understand Yantra's billing system and subscription options.",
|
|
712
|
-
slug: 'billing-overview',
|
|
713
|
-
author: 'Beena',
|
|
714
|
-
updatedAt: '4 months ago',
|
|
715
|
-
categoryId: 'subscription-billing'
|
|
716
|
-
}, {
|
|
717
|
-
id: 'payment-methods',
|
|
718
|
-
title: 'Payment Methods',
|
|
719
|
-
description: 'Learn about accepted payment methods and how to update them.',
|
|
720
|
-
slug: 'payment-methods',
|
|
721
|
-
author: 'Beena',
|
|
722
|
-
updatedAt: '4 months ago',
|
|
723
|
-
categoryId: 'subscription-billing'
|
|
724
|
-
}, {
|
|
725
|
-
id: 'billing-cycle',
|
|
726
|
-
title: 'Billing Cycle',
|
|
727
|
-
description: 'Understand your billing cycle and when charges occur.',
|
|
728
|
-
slug: 'billing-cycle',
|
|
729
|
-
author: 'Beena',
|
|
730
|
-
updatedAt: '4 months ago',
|
|
731
|
-
categoryId: 'subscription-billing'
|
|
732
|
-
}, {
|
|
733
|
-
id: 'promotional-offers',
|
|
734
|
-
title: 'Promotional Offers',
|
|
735
|
-
description: 'Learn about current promotional offers and discounts.',
|
|
736
|
-
slug: 'promotional-offers',
|
|
737
|
-
author: 'Beena',
|
|
738
|
-
updatedAt: '4 months ago',
|
|
739
|
-
categoryId: 'subscription-billing'
|
|
740
|
-
}, {
|
|
741
|
-
id: 'student-discounts',
|
|
742
|
-
title: 'Student Discounts',
|
|
743
|
-
description: 'Information about student discounts and verification.',
|
|
744
|
-
slug: 'student-discounts',
|
|
745
|
-
author: 'Beena',
|
|
746
|
-
updatedAt: '4 months ago',
|
|
747
|
-
categoryId: 'subscription-billing'
|
|
748
|
-
}, {
|
|
749
|
-
id: 'enterprise-pricing',
|
|
750
|
-
title: 'Enterprise Pricing',
|
|
751
|
-
description: 'Learn about enterprise pricing and custom solutions.',
|
|
752
|
-
slug: 'enterprise-pricing',
|
|
753
|
-
author: 'Beena',
|
|
754
|
-
updatedAt: '4 months ago',
|
|
755
|
-
categoryId: 'subscription-billing'
|
|
756
|
-
}, {
|
|
757
|
-
id: 'invoice-management',
|
|
758
|
-
title: 'Invoice Management',
|
|
759
|
-
description: 'Access and manage your Yantra invoices and billing history.',
|
|
760
|
-
slug: 'invoice-management',
|
|
761
|
-
author: 'Beena',
|
|
762
|
-
updatedAt: '4 months ago',
|
|
763
|
-
categoryId: 'subscription-billing'
|
|
764
|
-
}, {
|
|
765
|
-
id: 'tax-information',
|
|
766
|
-
title: 'Tax Information',
|
|
767
|
-
description: 'Information about taxes and tax reporting for Yantra subscriptions.',
|
|
768
|
-
slug: 'tax-information',
|
|
769
|
-
author: 'Beena',
|
|
770
|
-
updatedAt: '4 months ago',
|
|
771
|
-
categoryId: 'subscription-billing'
|
|
772
|
-
}, {
|
|
773
|
-
id: 'billing-support',
|
|
774
|
-
title: 'Billing Support',
|
|
775
|
-
description: 'Get help with billing questions and issues.',
|
|
776
|
-
slug: 'billing-support',
|
|
777
|
-
author: 'Beena',
|
|
778
|
-
updatedAt: '4 months ago',
|
|
779
|
-
categoryId: 'subscription-billing'
|
|
780
|
-
}, {
|
|
781
|
-
id: 'refund-policy',
|
|
782
|
-
title: 'Refund Policy',
|
|
783
|
-
description: "Understand Yantra's refund policy and how to request refunds.",
|
|
784
|
-
slug: 'refund-policy',
|
|
785
|
-
author: 'Beena',
|
|
786
|
-
updatedAt: '4 months ago',
|
|
787
|
-
categoryId: 'subscription-billing'
|
|
788
|
-
}, {
|
|
789
|
-
id: 'currency-support',
|
|
790
|
-
title: 'Currency Support',
|
|
791
|
-
description: 'Learn about supported currencies and international billing.',
|
|
792
|
-
slug: 'currency-support',
|
|
793
|
-
author: 'Beena',
|
|
794
|
-
updatedAt: '4 months ago',
|
|
795
|
-
categoryId: 'subscription-billing'
|
|
796
|
-
}]
|
|
797
|
-
},
|
|
798
|
-
'search-modes': {
|
|
799
|
-
id: 'search-modes',
|
|
800
|
-
title: 'Search Modes',
|
|
801
|
-
description: 'Regular | Pro | Deep Research | Labs',
|
|
802
|
-
iconType: 'SearchModes',
|
|
803
|
-
articles: [{
|
|
804
|
-
id: 'regular-search',
|
|
805
|
-
title: 'Regular Search',
|
|
806
|
-
description: "Learn about Yantra's regular search mode and its capabilities.",
|
|
807
|
-
slug: 'regular-search',
|
|
808
|
-
author: 'Beena',
|
|
809
|
-
updatedAt: '4 months ago',
|
|
810
|
-
categoryId: 'search-modes'
|
|
811
|
-
}, {
|
|
812
|
-
id: 'pro-search',
|
|
813
|
-
title: 'Pro Search',
|
|
814
|
-
description: 'Discover the enhanced features available in Pro search mode.',
|
|
815
|
-
slug: 'pro-search',
|
|
816
|
-
author: 'Beena',
|
|
817
|
-
updatedAt: '4 months ago',
|
|
818
|
-
categoryId: 'search-modes'
|
|
819
|
-
}, {
|
|
820
|
-
id: 'deep-research',
|
|
821
|
-
title: 'Deep Research',
|
|
822
|
-
description: "Master Yantra's deep research mode for comprehensive analysis.",
|
|
823
|
-
slug: 'deep-research',
|
|
824
|
-
author: 'Beena',
|
|
825
|
-
updatedAt: '4 months ago',
|
|
826
|
-
categoryId: 'search-modes'
|
|
827
|
-
}, {
|
|
828
|
-
id: 'labs-features',
|
|
829
|
-
title: 'Labs Features',
|
|
830
|
-
description: 'Explore experimental features and capabilities in Yantra Labs.',
|
|
831
|
-
slug: 'labs-features',
|
|
832
|
-
author: 'Beena',
|
|
833
|
-
updatedAt: '4 months ago',
|
|
834
|
-
categoryId: 'search-modes'
|
|
835
|
-
}]
|
|
836
|
-
},
|
|
837
|
-
'yantra-enterprise': {
|
|
838
|
-
id: 'yantra-enterprise',
|
|
839
|
-
title: 'Yantra Enterprise',
|
|
840
|
-
description: 'Enterprise | Admin | SSO | Branding',
|
|
841
|
-
iconType: 'Enterprise',
|
|
842
|
-
articles: [{
|
|
843
|
-
id: 'enterprise-overview',
|
|
844
|
-
title: 'Enterprise Overview',
|
|
845
|
-
description: 'Introduction to Yantra Enterprise features and benefits.',
|
|
846
|
-
slug: 'enterprise-overview',
|
|
847
|
-
author: 'Beena',
|
|
848
|
-
updatedAt: '4 months ago',
|
|
849
|
-
categoryId: 'yantra-enterprise'
|
|
850
|
-
}, {
|
|
851
|
-
id: 'admin-dashboard',
|
|
852
|
-
title: 'Admin Dashboard',
|
|
853
|
-
description: "Managing your organization's Yantra deployment.",
|
|
854
|
-
slug: 'admin-dashboard',
|
|
855
|
-
author: 'Beena',
|
|
856
|
-
updatedAt: '4 months ago',
|
|
857
|
-
categoryId: 'yantra-enterprise'
|
|
858
|
-
}, {
|
|
859
|
-
id: 'user-management',
|
|
860
|
-
title: 'User Management',
|
|
861
|
-
description: 'Adding, removing, and managing enterprise users.',
|
|
862
|
-
slug: 'user-management',
|
|
863
|
-
author: 'Beena',
|
|
864
|
-
updatedAt: '4 months ago',
|
|
865
|
-
categoryId: 'yantra-enterprise'
|
|
866
|
-
}, {
|
|
867
|
-
id: 'sso-integration',
|
|
868
|
-
title: 'SSO Integration',
|
|
869
|
-
description: 'Single Sign-On integration for enterprise customers.',
|
|
870
|
-
slug: 'sso-integration',
|
|
871
|
-
author: 'Beena',
|
|
872
|
-
updatedAt: '4 months ago',
|
|
873
|
-
categoryId: 'yantra-enterprise'
|
|
874
|
-
}, {
|
|
875
|
-
id: 'custom-branding',
|
|
876
|
-
title: 'Custom Branding',
|
|
877
|
-
description: 'White-label solutions and custom branding options.',
|
|
878
|
-
slug: 'custom-branding',
|
|
879
|
-
author: 'Beena',
|
|
880
|
-
updatedAt: '4 months ago',
|
|
881
|
-
categoryId: 'yantra-enterprise'
|
|
882
|
-
}, {
|
|
883
|
-
id: 'dedicated-support',
|
|
884
|
-
title: 'Dedicated Support',
|
|
885
|
-
description: 'Priority support and dedicated account management.',
|
|
886
|
-
slug: 'dedicated-support',
|
|
887
|
-
author: 'Beena',
|
|
888
|
-
updatedAt: '4 months ago',
|
|
889
|
-
categoryId: 'yantra-enterprise'
|
|
890
|
-
}]
|
|
891
|
-
},
|
|
892
|
-
'account-management': {
|
|
893
|
-
id: 'account-management',
|
|
894
|
-
title: 'Account Management & Settings',
|
|
895
|
-
description: 'Profile | Settings | Privacy | Account',
|
|
896
|
-
iconType: 'Account',
|
|
897
|
-
articles: [{
|
|
898
|
-
id: 'profile-settings',
|
|
899
|
-
title: 'Profile Settings',
|
|
900
|
-
description: 'Manage your Yantra profile and personal information.',
|
|
901
|
-
slug: 'profile-settings',
|
|
902
|
-
author: 'Beena',
|
|
903
|
-
updatedAt: '4 months ago',
|
|
904
|
-
categoryId: 'account-management'
|
|
905
|
-
}, {
|
|
906
|
-
id: 'account-setup',
|
|
907
|
-
title: 'Account Setup',
|
|
908
|
-
description: 'Complete guide to setting up your Yantra account.',
|
|
909
|
-
slug: 'account-setup',
|
|
910
|
-
author: 'Beena',
|
|
911
|
-
updatedAt: '4 months ago',
|
|
912
|
-
categoryId: 'account-management'
|
|
913
|
-
}, {
|
|
914
|
-
id: 'preferences',
|
|
915
|
-
title: 'Preferences',
|
|
916
|
-
description: 'Customize your Yantra experience with personal preferences.',
|
|
917
|
-
slug: 'preferences',
|
|
918
|
-
author: 'Beena',
|
|
919
|
-
updatedAt: '4 months ago',
|
|
920
|
-
categoryId: 'account-management'
|
|
921
|
-
}, {
|
|
922
|
-
id: 'privacy-settings',
|
|
923
|
-
title: 'Privacy Settings',
|
|
924
|
-
description: 'Control your privacy and data sharing preferences.',
|
|
925
|
-
slug: 'privacy-settings',
|
|
926
|
-
author: 'Beena',
|
|
927
|
-
updatedAt: '4 months ago',
|
|
928
|
-
categoryId: 'account-management'
|
|
929
|
-
}, {
|
|
930
|
-
id: 'delete-account',
|
|
931
|
-
title: 'Delete Account',
|
|
932
|
-
description: 'Learn how to delete your Yantra account and what happens to your data.',
|
|
933
|
-
slug: 'delete-account',
|
|
934
|
-
author: 'Beena',
|
|
935
|
-
updatedAt: '4 months ago',
|
|
936
|
-
categoryId: 'account-management'
|
|
937
|
-
}]
|
|
938
|
-
},
|
|
939
|
-
'yantra-assistant': {
|
|
940
|
-
id: 'yantra-assistant',
|
|
941
|
-
title: 'Yantra Assistant',
|
|
942
|
-
description: 'Mobile | iOS | Android | Voice',
|
|
943
|
-
iconType: 'Assistant',
|
|
944
|
-
articles: [{
|
|
945
|
-
id: 'mobile-app-overview',
|
|
946
|
-
title: 'Mobile App Overview',
|
|
947
|
-
description: "Overview of Yantra's mobile applications and features.",
|
|
948
|
-
slug: 'mobile-app-overview',
|
|
949
|
-
author: 'Beena',
|
|
950
|
-
updatedAt: '4 months ago',
|
|
951
|
-
categoryId: 'yantra-assistant'
|
|
952
|
-
}, {
|
|
953
|
-
id: 'ios-app',
|
|
954
|
-
title: 'iOS App',
|
|
955
|
-
description: "Learn about Yantra's iOS app features and capabilities.",
|
|
956
|
-
slug: 'ios-app',
|
|
957
|
-
author: 'Beena',
|
|
958
|
-
updatedAt: '4 months ago',
|
|
959
|
-
categoryId: 'yantra-assistant'
|
|
960
|
-
}, {
|
|
961
|
-
id: 'android-app',
|
|
962
|
-
title: 'Android App',
|
|
963
|
-
description: "Discover Yantra's Android app features and functionality.",
|
|
964
|
-
slug: 'android-app',
|
|
965
|
-
author: 'Beena',
|
|
966
|
-
updatedAt: '4 months ago',
|
|
967
|
-
categoryId: 'yantra-assistant'
|
|
968
|
-
}, {
|
|
969
|
-
id: 'voice-assistant',
|
|
970
|
-
title: 'Voice Assistant',
|
|
971
|
-
description: "Use Yantra's voice assistant for hands-free searching.",
|
|
972
|
-
slug: 'voice-assistant',
|
|
973
|
-
author: 'Beena',
|
|
974
|
-
updatedAt: '4 months ago',
|
|
975
|
-
categoryId: 'yantra-assistant'
|
|
976
|
-
}]
|
|
977
|
-
},
|
|
978
|
-
'data-privacy': {
|
|
979
|
-
id: 'data-privacy',
|
|
980
|
-
title: 'Data Privacy & Security',
|
|
981
|
-
description: 'Privacy | Security | Data | Compliance',
|
|
982
|
-
iconType: 'Privacy',
|
|
983
|
-
articles: [{
|
|
984
|
-
id: 'privacy-policy',
|
|
985
|
-
title: 'Privacy Policy',
|
|
986
|
-
description: 'Understand how Yantra protects your privacy and handles your data.',
|
|
987
|
-
slug: 'privacy-policy',
|
|
988
|
-
author: 'Beena',
|
|
989
|
-
updatedAt: '4 months ago',
|
|
990
|
-
categoryId: 'data-privacy'
|
|
991
|
-
}, {
|
|
992
|
-
id: 'data-collection',
|
|
993
|
-
title: 'Data Collection',
|
|
994
|
-
description: "Learn about what data Yantra collects and how it's used.",
|
|
995
|
-
slug: 'data-collection',
|
|
996
|
-
author: 'Beena',
|
|
997
|
-
updatedAt: '4 months ago',
|
|
998
|
-
categoryId: 'data-privacy'
|
|
999
|
-
}]
|
|
1000
|
-
},
|
|
1001
|
-
'spaces-library': {
|
|
1002
|
-
id: 'spaces-library',
|
|
1003
|
-
title: 'Spaces & Library',
|
|
1004
|
-
description: 'Spaces | Library | Collections | Organization',
|
|
1005
|
-
iconType: 'Spaces',
|
|
1006
|
-
articles: [{
|
|
1007
|
-
id: 'spaces-overview',
|
|
1008
|
-
title: 'Spaces Overview',
|
|
1009
|
-
description: 'Learn about Yantra Spaces and how to organize your research.',
|
|
1010
|
-
slug: 'spaces-overview',
|
|
1011
|
-
author: 'Beena',
|
|
1012
|
-
updatedAt: '4 months ago',
|
|
1013
|
-
categoryId: 'spaces-library'
|
|
1014
|
-
}]
|
|
1015
|
-
},
|
|
1016
|
-
threads: {
|
|
1017
|
-
id: 'threads',
|
|
1018
|
-
title: 'Threads',
|
|
1019
|
-
description: 'Threads | Conversations | History | Management',
|
|
1020
|
-
iconType: 'Threads',
|
|
1021
|
-
articles: [{
|
|
1022
|
-
id: 'threads-overview',
|
|
1023
|
-
title: 'Threads Overview',
|
|
1024
|
-
description: 'Understand Yantra threads and conversation management.',
|
|
1025
|
-
slug: 'threads-overview',
|
|
1026
|
-
author: 'Beena',
|
|
1027
|
-
updatedAt: '4 months ago',
|
|
1028
|
-
categoryId: 'threads'
|
|
1029
|
-
}, {
|
|
1030
|
-
id: 'conversation-management',
|
|
1031
|
-
title: 'Conversation Management',
|
|
1032
|
-
description: 'Learn how to manage your Yantra conversations and threads.',
|
|
1033
|
-
slug: 'conversation-management',
|
|
1034
|
-
author: 'Beena',
|
|
1035
|
-
updatedAt: '4 months ago',
|
|
1036
|
-
categoryId: 'threads'
|
|
1037
|
-
}]
|
|
1038
|
-
},
|
|
1039
|
-
troubleshooting: {
|
|
1040
|
-
id: 'troubleshooting',
|
|
1041
|
-
title: 'Troubleshooting & Support',
|
|
1042
|
-
description: 'Troubleshooting | Support | FAQ | Help',
|
|
1043
|
-
iconType: 'Troubleshooting',
|
|
1044
|
-
articles: [{
|
|
1045
|
-
id: 'general-support',
|
|
1046
|
-
title: 'General Support',
|
|
1047
|
-
description: 'Get help with common issues and find support resources.',
|
|
1048
|
-
slug: 'general-support',
|
|
1049
|
-
author: 'Beena',
|
|
1050
|
-
updatedAt: '4 months ago',
|
|
1051
|
-
categoryId: 'troubleshooting'
|
|
1052
|
-
}]
|
|
1053
|
-
},
|
|
1054
|
-
'scope-api': {
|
|
1055
|
-
id: 'scope-api',
|
|
1056
|
-
title: 'Scope & Open Source API',
|
|
1057
|
-
description: 'API | Open Source | Integration | Development',
|
|
1058
|
-
iconType: 'Api',
|
|
1059
|
-
articles: [{
|
|
1060
|
-
id: 'api-overview',
|
|
1061
|
-
title: 'API Overview',
|
|
1062
|
-
description: "Learn about Yantra's API and integration capabilities.",
|
|
1063
|
-
slug: 'api-overview',
|
|
1064
|
-
author: 'Beena',
|
|
1065
|
-
updatedAt: '4 months ago',
|
|
1066
|
-
categoryId: 'scope-api'
|
|
1067
|
-
}]
|
|
1068
|
-
},
|
|
1069
|
-
'file-uploads': {
|
|
1070
|
-
id: 'file-uploads',
|
|
1071
|
-
title: 'File Uploads & File API',
|
|
1072
|
-
description: 'File Upload | File API | Documents | Processing',
|
|
1073
|
-
iconType: 'FileUploads',
|
|
1074
|
-
articles: [{
|
|
1075
|
-
id: 'file-upload-overview',
|
|
1076
|
-
title: 'File Upload Overview',
|
|
1077
|
-
description: 'Learn how to upload and process files with Yantra.',
|
|
1078
|
-
slug: 'file-upload-overview',
|
|
1079
|
-
author: 'Beena',
|
|
1080
|
-
updatedAt: '4 months ago',
|
|
1081
|
-
categoryId: 'file-uploads'
|
|
1082
|
-
}]
|
|
1083
|
-
},
|
|
1084
|
-
'getting-started': {
|
|
1085
|
-
id: 'getting-started',
|
|
1086
|
-
title: 'Getting Started',
|
|
1087
|
-
description: 'Getting Started | Setup | First Steps | Guide',
|
|
1088
|
-
iconType: 'GettingStarted',
|
|
1089
|
-
articles: [{
|
|
1090
|
-
id: 'getting-started-guide',
|
|
1091
|
-
title: 'Getting Started Guide',
|
|
1092
|
-
description: 'Complete guide to getting started with Yantra.',
|
|
1093
|
-
slug: 'getting-started-guide',
|
|
1094
|
-
author: 'Beena',
|
|
1095
|
-
updatedAt: '4 months ago',
|
|
1096
|
-
categoryId: 'getting-started'
|
|
1097
|
-
}]
|
|
1098
|
-
},
|
|
1099
|
-
'student-hub': {
|
|
1100
|
-
id: 'student-hub',
|
|
1101
|
-
title: 'Student Hub',
|
|
1102
|
-
description: 'Students | Academic | Research | Discounts',
|
|
1103
|
-
iconType: 'StudentHub',
|
|
1104
|
-
articles: [{
|
|
1105
|
-
id: 'student-overview',
|
|
1106
|
-
title: 'Student Overview',
|
|
1107
|
-
description: 'Everything students need to know about using Yantra.',
|
|
1108
|
-
slug: 'student-overview',
|
|
1109
|
-
author: 'Beena',
|
|
1110
|
-
updatedAt: '4 months ago',
|
|
1111
|
-
categoryId: 'student-hub'
|
|
1112
|
-
}, {
|
|
1113
|
-
id: 'student-discounts-hub',
|
|
1114
|
-
title: 'Student Discounts',
|
|
1115
|
-
description: 'Learn about special pricing and discounts for students.',
|
|
1116
|
-
slug: 'student-discounts-hub',
|
|
1117
|
-
author: 'Beena',
|
|
1118
|
-
updatedAt: '4 months ago',
|
|
1119
|
-
categoryId: 'student-hub'
|
|
1120
|
-
}, {
|
|
1121
|
-
id: 'academic-research',
|
|
1122
|
-
title: 'Academic Research',
|
|
1123
|
-
description: 'Use Yantra for academic research and scholarly work.',
|
|
1124
|
-
slug: 'academic-research',
|
|
1125
|
-
author: 'Beena',
|
|
1126
|
-
updatedAt: '4 months ago',
|
|
1127
|
-
categoryId: 'student-hub'
|
|
1128
|
-
}, {
|
|
1129
|
-
id: 'study-tools',
|
|
1130
|
-
title: 'Study Tools',
|
|
1131
|
-
description: 'Discover study tools and features designed for students.',
|
|
1132
|
-
slug: 'study-tools',
|
|
1133
|
-
author: 'Beena',
|
|
1134
|
-
updatedAt: '4 months ago',
|
|
1135
|
-
categoryId: 'student-hub'
|
|
1136
|
-
}]
|
|
1137
|
-
},
|
|
1138
|
-
'data-subject-privacy': {
|
|
1139
|
-
id: 'data-subject-privacy',
|
|
1140
|
-
title: 'Data Subject Privacy Requests',
|
|
1141
|
-
description: 'Privacy Requests | Data Access | Data Portability | Rights',
|
|
1142
|
-
iconType: 'DataPrivacy',
|
|
1143
|
-
articles: [{
|
|
1144
|
-
id: 'privacy-requests',
|
|
1145
|
-
title: 'Privacy Requests',
|
|
1146
|
-
description: 'How to submit privacy-related requests.',
|
|
1147
|
-
slug: 'privacy-requests',
|
|
1148
|
-
author: 'Beena',
|
|
1149
|
-
updatedAt: '4 months ago',
|
|
1150
|
-
categoryId: 'data-subject-privacy'
|
|
1151
|
-
}, {
|
|
1152
|
-
id: 'data-access',
|
|
1153
|
-
title: 'Data Access',
|
|
1154
|
-
description: 'Requesting access to your personal data.',
|
|
1155
|
-
slug: 'data-access',
|
|
1156
|
-
author: 'Beena',
|
|
1157
|
-
updatedAt: '4 months ago',
|
|
1158
|
-
categoryId: 'data-subject-privacy'
|
|
1159
|
-
}, {
|
|
1160
|
-
id: 'data-portability',
|
|
1161
|
-
title: 'Data Portability',
|
|
1162
|
-
description: 'Exporting your data for portability.',
|
|
1163
|
-
slug: 'data-portability',
|
|
1164
|
-
author: 'Beena',
|
|
1165
|
-
updatedAt: '4 months ago',
|
|
1166
|
-
categoryId: 'data-subject-privacy'
|
|
1167
|
-
}]
|
|
1168
|
-
},
|
|
1169
|
-
'technical-questions': {
|
|
1170
|
-
id: 'technical-questions',
|
|
1171
|
-
title: 'Technical Questions',
|
|
1172
|
-
description: 'Technical | Architecture | Implementation | Development',
|
|
1173
|
-
iconType: 'TechnicalQuestions',
|
|
1174
|
-
articles: [{
|
|
1175
|
-
id: 'technical-overview',
|
|
1176
|
-
title: 'Technical Overview',
|
|
1177
|
-
description: 'Technical architecture and implementation details.',
|
|
1178
|
-
slug: 'technical-overview',
|
|
1179
|
-
author: 'Beena',
|
|
1180
|
-
updatedAt: '4 months ago',
|
|
1181
|
-
categoryId: 'technical-questions'
|
|
1182
|
-
}, {
|
|
1183
|
-
id: 'ai-models-technical',
|
|
1184
|
-
title: 'AI Models Technical',
|
|
1185
|
-
description: 'Technical details about AI model integration.',
|
|
1186
|
-
slug: 'ai-models-technical',
|
|
1187
|
-
author: 'Beena',
|
|
1188
|
-
updatedAt: '4 months ago',
|
|
1189
|
-
categoryId: 'technical-questions'
|
|
1190
|
-
}, {
|
|
1191
|
-
id: 'search-algorithms',
|
|
1192
|
-
title: 'Search Algorithms',
|
|
1193
|
-
description: "Technical details about Yantra's search algorithms.",
|
|
1194
|
-
slug: 'search-algorithms',
|
|
1195
|
-
author: 'Beena',
|
|
1196
|
-
updatedAt: '4 months ago',
|
|
1197
|
-
categoryId: 'technical-questions'
|
|
1198
|
-
}, {
|
|
1199
|
-
id: 'data-processing',
|
|
1200
|
-
title: 'Data Processing',
|
|
1201
|
-
description: 'How Yantra processes and analyzes data.',
|
|
1202
|
-
slug: 'data-processing',
|
|
1203
|
-
author: 'Beena',
|
|
1204
|
-
updatedAt: '4 months ago',
|
|
1205
|
-
categoryId: 'technical-questions'
|
|
1206
|
-
}, {
|
|
1207
|
-
id: 'infrastructure',
|
|
1208
|
-
title: 'Infrastructure',
|
|
1209
|
-
description: "Yantra's technical infrastructure and scalability.",
|
|
1210
|
-
slug: 'infrastructure',
|
|
1211
|
-
author: 'Beena',
|
|
1212
|
-
updatedAt: '4 months ago',
|
|
1213
|
-
categoryId: 'technical-questions'
|
|
1214
|
-
}, {
|
|
1215
|
-
id: 'performance-optimization',
|
|
1216
|
-
title: 'Performance Optimization',
|
|
1217
|
-
description: 'Technical optimizations for speed and efficiency.',
|
|
1218
|
-
slug: 'performance-optimization',
|
|
1219
|
-
author: 'Beena',
|
|
1220
|
-
updatedAt: '4 months ago',
|
|
1221
|
-
categoryId: 'technical-questions'
|
|
1222
|
-
}, {
|
|
1223
|
-
id: 'api-technical',
|
|
1224
|
-
title: 'API Technical',
|
|
1225
|
-
description: 'Technical details about API implementation.',
|
|
1226
|
-
slug: 'api-technical',
|
|
1227
|
-
author: 'Beena',
|
|
1228
|
-
updatedAt: '4 months ago',
|
|
1229
|
-
categoryId: 'technical-questions'
|
|
1230
|
-
}, {
|
|
1231
|
-
id: 'database-architecture',
|
|
1232
|
-
title: 'Database Architecture',
|
|
1233
|
-
description: 'Technical details about data storage and retrieval.',
|
|
1234
|
-
slug: 'database-architecture',
|
|
1235
|
-
author: 'Beena',
|
|
1236
|
-
updatedAt: '4 months ago',
|
|
1237
|
-
categoryId: 'technical-questions'
|
|
1238
|
-
}]
|
|
305
|
+
// Category metadata - dynamically loaded from manifest
|
|
306
|
+
// This will be populated from the manifest at runtime
|
|
307
|
+
let categoryMetadata = {};
|
|
308
|
+
// Initialize category metadata from manifest
|
|
309
|
+
async function initializeCategoryMetadata() {
|
|
310
|
+
if (Object.keys(categoryMetadata).length > 0) {
|
|
311
|
+
return; // Already initialized
|
|
1239
312
|
}
|
|
1240
|
-
|
|
313
|
+
const metadata = await getCategoryMetadata();
|
|
314
|
+
categoryMetadata = metadata;
|
|
315
|
+
}
|
|
316
|
+
// Legacy hardcoded categoryMetadata removed - now loaded dynamically from manifest
|
|
1241
317
|
// Process categories to include full article content and HTML
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
318
|
+
// This is now async and loads from manifest dynamically
|
|
319
|
+
let processedCategories = [];
|
|
320
|
+
async function initializeProcessedCategories() {
|
|
321
|
+
await initializeCategoryMetadata();
|
|
322
|
+
processedCategories = await Promise.all(Object.values(categoryMetadata).map(async category => ({
|
|
323
|
+
...category,
|
|
324
|
+
articles: await Promise.all(category.articles.map(async articleMeta => {
|
|
325
|
+
// Load the actual markdown content
|
|
326
|
+
const contentId = articleMeta.id;
|
|
327
|
+
const rawContent = await loadMarkdownContent(contentId);
|
|
328
|
+
const {
|
|
329
|
+
frontmatter,
|
|
330
|
+
body
|
|
331
|
+
} = parseFrontmatter(rawContent);
|
|
332
|
+
const markdownBody = body || rawContent;
|
|
333
|
+
const htmlContent = await marked.parse(markdownBody);
|
|
334
|
+
const headings = extractHeadings(markdownBody);
|
|
335
|
+
return {
|
|
336
|
+
...articleMeta,
|
|
337
|
+
// If metadata disagrees, prefer the markdown frontmatter (but never render it in the body)
|
|
338
|
+
title: frontmatter.title || articleMeta.title,
|
|
339
|
+
description: frontmatter.description || articleMeta.description,
|
|
340
|
+
author: frontmatter.author || frontmatter.authors || articleMeta.author,
|
|
341
|
+
updatedAt: frontmatter.updatedAt || frontmatter.date || articleMeta.updatedAt,
|
|
342
|
+
content: rawContent,
|
|
343
|
+
htmlContent: htmlContent,
|
|
344
|
+
headings: headings
|
|
345
|
+
};
|
|
346
|
+
}))
|
|
347
|
+
})));
|
|
348
|
+
}
|
|
349
|
+
// Initialize on module load (only in browser, skip during build)
|
|
350
|
+
// During build time, the sync functions will return empty arrays
|
|
351
|
+
// At runtime, the manifest will be loaded and categories will be populated
|
|
352
|
+
if (typeof window !== 'undefined') {
|
|
353
|
+
// Wait a bit for the page to fully load before initializing
|
|
354
|
+
if (document.readyState === 'loading') {
|
|
355
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
356
|
+
initializeProcessedCategories().catch(error => {
|
|
357
|
+
console.error('Error initializing processed categories:', error);
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
} else {
|
|
361
|
+
// DOM already loaded, initialize immediately
|
|
362
|
+
initializeProcessedCategories().catch(error => {
|
|
363
|
+
console.error('Error initializing processed categories:', error);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
1258
367
|
// Helper functions
|
|
1259
|
-
const getAllCategoriesMetadata = () => {
|
|
368
|
+
const getAllCategoriesMetadata = async () => {
|
|
369
|
+
if (processedCategories.length === 0) {
|
|
370
|
+
await initializeProcessedCategories();
|
|
371
|
+
}
|
|
372
|
+
return processedCategories;
|
|
373
|
+
};
|
|
374
|
+
// Synchronous version for backward compatibility (returns empty array if not initialized)
|
|
375
|
+
const getAllCategoriesMetadataSync = () => {
|
|
1260
376
|
return processedCategories;
|
|
1261
377
|
};
|
|
1262
|
-
const
|
|
378
|
+
const getCategoryByIdSync = categoryId => {
|
|
1263
379
|
return processedCategories.find(cat => cat.id === categoryId) || null;
|
|
1264
380
|
};
|
|
1265
|
-
const getArticleBySlug = articleSlug => {
|
|
1266
|
-
|
|
381
|
+
const getArticleBySlug = async articleSlug => {
|
|
382
|
+
const categories = await getAllCategoriesMetadata();
|
|
383
|
+
for (const category of categories) {
|
|
1267
384
|
const article = category.articles.find(art => art.slug === articleSlug);
|
|
1268
385
|
if (article) return article;
|
|
1269
386
|
}
|
|
1270
387
|
return null;
|
|
1271
388
|
};
|
|
1272
|
-
// Function to
|
|
389
|
+
// Function to parse frontmatter from markdown content
|
|
390
|
+
function parseFrontmatter(content) {
|
|
391
|
+
const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/;
|
|
392
|
+
const match = content.match(frontmatterRegex);
|
|
393
|
+
if (!match) {
|
|
394
|
+
return {
|
|
395
|
+
frontmatter: {},
|
|
396
|
+
body: content
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
const frontmatterText = match[1];
|
|
400
|
+
const body = match[2];
|
|
401
|
+
const frontmatter = {};
|
|
402
|
+
frontmatterText.split('\n').forEach(line => {
|
|
403
|
+
const colonIndex = line.indexOf(':');
|
|
404
|
+
if (colonIndex > 0) {
|
|
405
|
+
const key = line.substring(0, colonIndex).trim();
|
|
406
|
+
let value = line.substring(colonIndex + 1).trim();
|
|
407
|
+
// Remove quotes if present
|
|
408
|
+
if (typeof value === 'string' && (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'"))) {
|
|
409
|
+
value = value.slice(1, -1);
|
|
410
|
+
}
|
|
411
|
+
// Parse array values
|
|
412
|
+
if (typeof value === 'string' && value.startsWith('[') && value.endsWith(']')) {
|
|
413
|
+
value = value.slice(1, -1).split(',').map(item => item.trim().replace(/^["']|["']$/g, ''));
|
|
414
|
+
}
|
|
415
|
+
frontmatter[key] = value;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
frontmatter,
|
|
420
|
+
body
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
// Function to load article content dynamically (for help center articles)
|
|
1273
424
|
const loadArticleContent = async articleSlug => {
|
|
1274
|
-
const article = getArticleBySlug(articleSlug);
|
|
425
|
+
const article = await getArticleBySlug(articleSlug);
|
|
1275
426
|
if (!article) return null;
|
|
1276
427
|
// Load the actual markdown content
|
|
1277
428
|
const contentId = article.id;
|
|
1278
429
|
const rawContent = await loadMarkdownContent(contentId);
|
|
1279
|
-
const
|
|
1280
|
-
|
|
430
|
+
const {
|
|
431
|
+
frontmatter,
|
|
432
|
+
body
|
|
433
|
+
} = parseFrontmatter(rawContent);
|
|
434
|
+
const markdownBody = body || rawContent;
|
|
435
|
+
const htmlContent = await marked.parse(markdownBody);
|
|
436
|
+
const headings = extractHeadings(markdownBody);
|
|
1281
437
|
return {
|
|
1282
438
|
...article,
|
|
439
|
+
// If metadata disagrees, prefer the markdown frontmatter (but never render it in the body)
|
|
440
|
+
title: frontmatter.title || article.title,
|
|
441
|
+
description: frontmatter.description || article.description,
|
|
442
|
+
author: frontmatter.author || frontmatter.authors || article.author,
|
|
443
|
+
updatedAt: frontmatter.updatedAt || frontmatter.date || article.updatedAt,
|
|
1283
444
|
content: rawContent,
|
|
1284
445
|
htmlContent: htmlContent,
|
|
1285
446
|
headings: headings
|
|
1286
447
|
};
|
|
1287
|
-
};
|
|
448
|
+
};
|
|
449
|
+
// Search function to find articles matching a query
|
|
450
|
+
const searchArticles = async query => {
|
|
451
|
+
if (!query || query.trim().length === 0) {
|
|
452
|
+
return [];
|
|
453
|
+
}
|
|
454
|
+
const searchTerm = query.toLowerCase().trim();
|
|
455
|
+
const results = [];
|
|
456
|
+
const categories = await getAllCategoriesMetadata();
|
|
457
|
+
// Search through all categories and their articles
|
|
458
|
+
for (const category of categories) {
|
|
459
|
+
for (const article of category.articles) {
|
|
460
|
+
// Search in title
|
|
461
|
+
const titleMatch = article.title.toLowerCase().includes(searchTerm);
|
|
462
|
+
// Search in description
|
|
463
|
+
const descriptionMatch = article.description.toLowerCase().includes(searchTerm);
|
|
464
|
+
// Search in content (if available)
|
|
465
|
+
const contentMatch = article.content?.toLowerCase().includes(searchTerm) || false;
|
|
466
|
+
// Search in slug
|
|
467
|
+
const slugMatch = article.slug.toLowerCase().includes(searchTerm);
|
|
468
|
+
if (titleMatch || descriptionMatch || contentMatch || slugMatch) {
|
|
469
|
+
results.push(article);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
// Sort results by relevance (title matches first, then description, then content)
|
|
474
|
+
results.sort((a, b) => {
|
|
475
|
+
const aTitleMatch = a.title.toLowerCase().includes(searchTerm);
|
|
476
|
+
const bTitleMatch = b.title.toLowerCase().includes(searchTerm);
|
|
477
|
+
if (aTitleMatch && !bTitleMatch) return -1;
|
|
478
|
+
if (!aTitleMatch && bTitleMatch) return 1;
|
|
479
|
+
const aDescMatch = a.description.toLowerCase().includes(searchTerm);
|
|
480
|
+
const bDescMatch = b.description.toLowerCase().includes(searchTerm);
|
|
481
|
+
if (aDescMatch && !bDescMatch) return -1;
|
|
482
|
+
if (!aDescMatch && bDescMatch) return 1;
|
|
483
|
+
return 0;
|
|
484
|
+
});
|
|
485
|
+
return results;
|
|
486
|
+
};export{getAllCategoriesMetadata,getAllCategoriesMetadataSync,getArticleBySlug,getCategoryByIdSync,loadArticleContent,searchArticles};//# sourceMappingURL=markdownLoader.js.map
|