Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
98df507
flexsearch
cycle4passion Dec 31, 2025
a44f77a
Merge branch 'docs-v2' into flexsearch
cycle4passion Jan 2, 2026
d1536de
Merge branch 'docs-v2' into pr/cycle4passion/745
techniq Feb 7, 2026
59b6513
update pnpm-lock.yaml
techniq Feb 7, 2026
4f47a86
Fix catalog example paths
techniq Feb 7, 2026
650630b
Remove outdated examples (markdown) content collection
techniq Feb 7, 2026
a5de647
Build search index using content collections and examples catalog, an…
techniq Feb 7, 2026
0ba9018
Cleanup search
techniq Feb 7, 2026
2d2b071
Improve display of search results
techniq Feb 7, 2026
a1f904a
improve display of search results
techniq Feb 7, 2026
a5d8771
fix sticky search input
techniq Feb 7, 2026
4d6a336
refine results
techniq Feb 7, 2026
11a31d8
move stripMarkdown to lib/markdown/utils
techniq Feb 7, 2026
e98ef53
refine results
techniq Feb 7, 2026
397a7b7
refine search styling
techniq Feb 7, 2026
a80a5c5
Fix reactivity when loading examples
techniq Feb 7, 2026
ce70577
support searching from home page
techniq Feb 7, 2026
6fcabc8
Use `@layerstack/svelte-state` instead of '@layerstack/svelte-stores'…
techniq Feb 7, 2026
e66610b
Refactor search functionality: replace remote search with local index…
techniq Feb 8, 2026
d7ab7fd
improve search
techniq Feb 8, 2026
82b1379
Dynamically import search module to avoid SSR bundling issues (fix Cl…
techniq Feb 8, 2026
f980377
Add quick links when no search is set
techniq Feb 8, 2026
5b581f5
Add support for headings in search entries
techniq Feb 8, 2026
f02a46c
Add top-level navigation to search
techniq Feb 8, 2026
f9427de
Use preprender remote function instead of API server endpoint and fetch
techniq Feb 8, 2026
e36e502
Revert "Use preprender remote function instead of API server endpoint…
techniq Feb 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 1 addition & 47 deletions docs/content-collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,52 +86,6 @@ const components = defineCollection({
}
});

const examples = defineCollection({
name: 'examples',
directory: 'src/content/examples',
include: '**/*.md',
schema: z.object({
name: z.string().optional(),
description: z.string().optional(),
category: z.string().optional(),
layers: z.array(z.string()).default([]),
related: z.array(z.string()).default([]),
resize: z.boolean().default(true),
tableOfContents: z.boolean().default(true),
order: z.number().optional(),
content: z.string()
}),
transform: async (doc) => {
const { filePath, fileName, directory, path } = doc._meta;

// Read the source file from the layerchart package
// const sourcePath = join(
// process.cwd(),
// `../packages/layerchart/src/lib/components/${doc.section === 'charts' ? 'charts/' : ''}${path}.svelte`
// );

// let source = '';
// let sourceUrl = '';
// try {
// source = readFileSync(sourcePath, 'utf-8');
// sourceUrl = `https://github.com/techniq/layerchart/blob/next/packages/layerchart/src/lib/components/${path}.svelte`;
// } catch (error) {
// // console.warn(
// // `Could not read source file for ${filePath}: ${error instanceof Error ? error.message : String(error)}`
// // );
// }

return {
...doc,
name: doc.name ?? toPascalCase(fileName.replace('.md', '')),
slug: path
// source,
// sourceUrl
// html: await compileMarkdown(context, doc)
};
}
});

const utils = defineCollection({
name: 'utils',
directory: 'src/content/utils',
Expand Down Expand Up @@ -230,5 +184,5 @@ const releases = defineCollection({
});

export default defineConfig({
collections: [components, examples, utils, guides, releases]
collections: [components, utils, guides, releases]
});
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"@uiw/codemirror-theme-github": "^4.25.4",
"@webcontainer/api": "^1.6.1",
"ansi_up": "^6.0.6",
"codemirror": "^6.0.2"
"codemirror": "^6.0.2",
"flexsearch": "^0.8.212"
}
}
5 changes: 3 additions & 2 deletions docs/scripts/generate-example-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ function getComponentExamples(componentName: string, allComponents: string[]): E

examples.push({
name: exampleName,
path: `/example/${componentName}/${exampleName}`,
title: exampleName.replaceAll('-', ' '),
path: `/docs/components/${componentName}/${exampleName}`,
components: componentsInExample
});
}
Expand Down Expand Up @@ -161,7 +162,7 @@ function findComponentUsage(componentName: string): UsageInfo[] {
usage.push({
example: exampleName,
component: entry.name,
path: `/example/${entry.name}/${exampleName}`,
path: `/docs/components/${entry.name}/${exampleName}`,
lineNumber: index + 1,
line: line.trim()
});
Expand Down
43 changes: 25 additions & 18 deletions docs/src/examples/catalog/AnnotationLine.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"examples": [
{
"name": "bar-chart",
"path": "/example/AnnotationLine/bar-chart",
"title": "bar chart",
"path": "/docs/components/AnnotationLine/bar-chart",
"components": [
{
"component": "BarChart",
Expand All @@ -19,7 +20,8 @@
},
{
"name": "horizontal",
"path": "/example/AnnotationLine/horizontal",
"title": "horizontal",
"path": "/docs/components/AnnotationLine/horizontal",
"components": [
{
"component": "LineChart",
Expand All @@ -35,7 +37,8 @@
},
{
"name": "horizontal-placement",
"path": "/example/AnnotationLine/horizontal-placement",
"title": "horizontal placement",
"path": "/docs/components/AnnotationLine/horizontal-placement",
"components": [
{
"component": "LineChart",
Expand All @@ -51,7 +54,8 @@
},
{
"name": "horizontal-with-range",
"path": "/example/AnnotationLine/horizontal-with-range",
"title": "horizontal with range",
"path": "/docs/components/AnnotationLine/horizontal-with-range",
"components": [
{
"component": "LineChart",
Expand All @@ -72,7 +76,8 @@
},
{
"name": "vertical",
"path": "/example/AnnotationLine/vertical",
"title": "vertical",
"path": "/docs/components/AnnotationLine/vertical",
"components": [
{
"component": "LineChart",
Expand All @@ -88,7 +93,8 @@
},
{
"name": "vertical-placement",
"path": "/example/AnnotationLine/vertical-placement",
"title": "vertical placement",
"path": "/docs/components/AnnotationLine/vertical-placement",
"components": [
{
"component": "LineChart",
Expand All @@ -104,7 +110,8 @@
},
{
"name": "vertical-with-rotation",
"path": "/example/AnnotationLine/vertical-with-rotation",
"title": "vertical with rotation",
"path": "/docs/components/AnnotationLine/vertical-with-rotation",
"components": [
{
"component": "LineChart",
Expand All @@ -123,73 +130,73 @@
{
"example": "bar-chart",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/bar-chart",
"path": "/docs/components/AnnotationLine/bar-chart",
"lineNumber": 18,
"line": "<AnnotationLine"
},
{
"example": "horizontal",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/horizontal",
"path": "/docs/components/AnnotationLine/horizontal",
"lineNumber": 16,
"line": "<AnnotationLine"
},
{
"example": "horizontal-placement",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/horizontal-placement",
"path": "/docs/components/AnnotationLine/horizontal-placement",
"lineNumber": 19,
"line": "<AnnotationLine"
},
{
"example": "horizontal-with-range",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/horizontal-with-range",
"path": "/docs/components/AnnotationLine/horizontal-with-range",
"lineNumber": 23,
"line": "<AnnotationLine"
},
{
"example": "vertical",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/vertical",
"path": "/docs/components/AnnotationLine/vertical",
"lineNumber": 12,
"line": "<AnnotationLine"
},
{
"example": "vertical-placement",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/vertical-placement",
"path": "/docs/components/AnnotationLine/vertical-placement",
"lineNumber": 19,
"line": "<AnnotationLine"
},
{
"example": "vertical-with-rotation",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/vertical-with-rotation",
"path": "/docs/components/AnnotationLine/vertical-with-rotation",
"lineNumber": 12,
"line": "<AnnotationLine"
},
{
"example": "vertical-with-rotation",
"component": "AnnotationLine",
"path": "/example/AnnotationLine/vertical-with-rotation",
"path": "/docs/components/AnnotationLine/vertical-with-rotation",
"lineNumber": 29,
"line": "<AnnotationLine"
},
{
"example": "line-to-point",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/line-to-point",
"path": "/docs/components/AnnotationPoint/line-to-point",
"lineNumber": 60,
"line": "<AnnotationLine"
},
{
"example": "on-series-with-line-and-tooltip",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/on-series-with-line-and-tooltip",
"path": "/docs/components/AnnotationPoint/on-series-with-line-and-tooltip",
"lineNumber": 29,
"line": "<AnnotationLine"
}
],
"updatedAt": "2026-01-06T13:02:20.587Z"
"updatedAt": "2026-02-07T20:21:31.167Z"
}
42 changes: 25 additions & 17 deletions docs/src/examples/catalog/AnnotationPoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"examples": [
{
"name": "band-scale-on-axis",
"path": "/example/AnnotationPoint/band-scale-on-axis",
"title": "band scale on axis",
"path": "/docs/components/AnnotationPoint/band-scale-on-axis",
"components": [
{
"component": "BarChart",
Expand All @@ -24,7 +25,8 @@
},
{
"name": "band-scale-on-value",
"path": "/example/AnnotationPoint/band-scale-on-value",
"title": "band scale on value",
"path": "/docs/components/AnnotationPoint/band-scale-on-value",
"components": [
{
"component": "BarChart",
Expand All @@ -45,7 +47,8 @@
},
{
"name": "label-placement",
"path": "/example/AnnotationPoint/label-placement",
"title": "label placement",
"path": "/docs/components/AnnotationPoint/label-placement",
"components": [
{
"component": "LineChart",
Expand All @@ -61,7 +64,8 @@
},
{
"name": "line-to-point",
"path": "/example/AnnotationPoint/line-to-point",
"title": "line to point",
"path": "/docs/components/AnnotationPoint/line-to-point",
"components": [
{
"component": "LineChart",
Expand Down Expand Up @@ -92,7 +96,8 @@
},
{
"name": "on-axis-with-tooltip",
"path": "/example/AnnotationPoint/on-axis-with-tooltip",
"title": "on axis with tooltip",
"path": "/docs/components/AnnotationPoint/on-axis-with-tooltip",
"components": [
{
"component": "LineChart",
Expand All @@ -118,7 +123,8 @@
},
{
"name": "on-series-with-line-and-tooltip",
"path": "/example/AnnotationPoint/on-series-with-line-and-tooltip",
"title": "on series with line and tooltip",
"path": "/docs/components/AnnotationPoint/on-series-with-line-and-tooltip",
"components": [
{
"component": "LineChart",
Expand Down Expand Up @@ -149,7 +155,8 @@
},
{
"name": "on-series-with-tooltip",
"path": "/example/AnnotationPoint/on-series-with-tooltip",
"title": "on series with tooltip",
"path": "/docs/components/AnnotationPoint/on-series-with-tooltip",
"components": [
{
"component": "LineChart",
Expand All @@ -175,7 +182,8 @@
},
{
"name": "series-annotation",
"path": "/example/AnnotationPoint/series-annotation",
"title": "series annotation",
"path": "/docs/components/AnnotationPoint/series-annotation",
"components": [
{
"component": "LineChart",
Expand All @@ -194,59 +202,59 @@
{
"example": "band-scale-on-axis",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/band-scale-on-axis",
"path": "/docs/components/AnnotationPoint/band-scale-on-axis",
"lineNumber": 19,
"line": "<AnnotationPoint"
},
{
"example": "band-scale-on-value",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/band-scale-on-value",
"path": "/docs/components/AnnotationPoint/band-scale-on-value",
"lineNumber": 19,
"line": "<AnnotationPoint"
},
{
"example": "label-placement",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/label-placement",
"path": "/docs/components/AnnotationPoint/label-placement",
"lineNumber": 33,
"line": "<AnnotationPoint"
},
{
"example": "line-to-point",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/line-to-point",
"path": "/docs/components/AnnotationPoint/line-to-point",
"lineNumber": 66,
"line": "<AnnotationPoint"
},
{
"example": "on-axis-with-tooltip",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/on-axis-with-tooltip",
"path": "/docs/components/AnnotationPoint/on-axis-with-tooltip",
"lineNumber": 30,
"line": "<AnnotationPoint"
},
{
"example": "on-series-with-line-and-tooltip",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/on-series-with-line-and-tooltip",
"path": "/docs/components/AnnotationPoint/on-series-with-line-and-tooltip",
"lineNumber": 38,
"line": "<AnnotationPoint"
},
{
"example": "on-series-with-tooltip",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/on-series-with-tooltip",
"path": "/docs/components/AnnotationPoint/on-series-with-tooltip",
"lineNumber": 29,
"line": "<AnnotationPoint"
},
{
"example": "series-annotation",
"component": "AnnotationPoint",
"path": "/example/AnnotationPoint/series-annotation",
"path": "/docs/components/AnnotationPoint/series-annotation",
"lineNumber": 19,
"line": "<AnnotationPoint"
}
],
"updatedAt": "2026-01-06T13:02:20.606Z"
"updatedAt": "2026-02-07T20:21:31.186Z"
}
Loading
Loading