Skip to content

Commit 52ba3e5

Browse files
authored
docs: copy page button (#2365)
1 parent 518f99e commit 52ba3e5

File tree

36 files changed

+1363
-63
lines changed

36 files changed

+1363
-63
lines changed

.gitignore

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ web_modules/
8484
# Output of 'npm pack'
8585
*.tgz
8686

87-
# Yarn Integrity file
88-
.yarn-integrity
8987

9088
# dotenv environment variable files
9189
.env
@@ -98,13 +96,6 @@ web_modules/
9896
# Stores VSCode versions used for testing VSCode extensions
9997
.vscode-test
10098

101-
# yarn v2
102-
.yarn/cache
103-
.yarn/unplugged
104-
.yarn/build-state.yml
105-
.yarn/install-state.gz
106-
.pnp.*
107-
generated-assets
10899

109100
# JetBrains IDEs
110101
.idea/
@@ -115,7 +106,8 @@ docs/static/themes.css
115106
docs/static/schema/registry.json
116107
docs/static/schema/registry-item.json
117108
docs/src/__registry__
118-
119-
109+
docs/static/docs
110+
docs/static/llms.txt
111+
docs/static/docs.md
120112

121113
registry-template/static/r

docs/content/components/sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ Here's an example of a `Sidebar.MenuAction` that renders a `DropdownMenu`.
785785
<Sidebar.MenuItem>
786786
<Sidebar.MenuButton>
787787
{#snippet child({ props })}
788-
<a href="#" {...props}>
788+
<a href="##" {...props}>
789789
<House />
790790
<span>Home</span>
791791
</a>

docs/content/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Re-usable components built with Bits UI and Tailwind CSS.
88
import Callout from '$lib/components/callout.svelte';
99
</script>
1010

11-
An unofficial, community-led [Svelte](https://svelte.dev) port of [shadcn/ui](https://ui.shadcn.com). We are not affiliated with [shadcn](https://twitter.com/shadcn), but we did get his blessing before creating a Svelte version of his work. This project was born out of the need for a similar project for the Svelte ecosystem.
11+
An unofficial, community-led [Svelte](https://svelte.dev) port of [shadcn/ui](https://ui.shadcn.com). We are not affiliated with [shadcn](https://x.com/shadcn), but we did get his blessing before creating a Svelte version of his work. This project was born out of the need for a similar project for the Svelte ecosystem.
1212

1313
**This is not a component library. It is how you build your component library.**
1414

docs/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
"dev": "pnpm --reporter append-only --color \"/dev:/\"",
88
"dev:content": "velite dev --watch",
99
"dev:svelte": "vite dev",
10-
"build": "pnpm build:content && pnpm build:svelte",
10+
"build": "pnpm build:content && pnpm build:llm-placeholders && pnpm build:svelte && pnpm build:llms",
1111
"build:content": "velite && tsx scripts/velite/velite-update-json.ts",
1212
"build:svelte": "vite build",
1313
"build:registry": "tsx scripts/build-registry.ts build-registry",
1414
"build:screenshots": "tsx scripts/capture-registry.ts",
15+
"build:llms": "tsx scripts/build-llms.ts",
16+
"build:llm-placeholders": "tsx scripts/build-llm-placeholders.ts",
1517
"replace:velite": "tsx scripts/velite/velite-watch-output.ts",
1618
"sync": "pnpm build:registry && pnpm build:content && svelte-kit sync",
1719
"preview": "vite preview",
@@ -40,31 +42,38 @@
4042
"@types/d3-scale": "^4.0.8",
4143
"@types/d3-shape": "^3.1.7",
4244
"@types/hast": "^3.0.4",
45+
"@types/jsdom": "^27.0.0",
4346
"@types/lodash.template": "^4.5.3",
4447
"@types/mdast": "^4.0.4",
4548
"acorn": "^8.15.0",
4649
"bits-ui": "^2.11.0",
4750
"chrono-node": "^2.8.4",
4851
"clsx": "^2.1.1",
52+
"consola": "^3.4.2",
4953
"d3-scale": "^4.0.2",
5054
"d3-shape": "^3.2.0",
5155
"embla-carousel-autoplay": "^8.6.0",
5256
"embla-carousel-svelte": "^8.6.0",
5357
"estree-walker": "^3.0.3",
5458
"formsnap": "^2.0.1",
59+
"globby": "^15.0.0",
5560
"hast-util-to-html": "^9.0.1",
61+
"jsdom": "^27.0.0",
5662
"layerchart": "2.0.0-next.27",
5763
"little-date": "^1.0.0",
5864
"lodash.template": "^4.5.0",
5965
"magic-string": "^0.30.12",
6066
"mdsx": "^0.0.7",
6167
"mode-watcher": "^1.1.0",
62-
"package-manager-detector": "^1.3.0",
68+
"package-manager-detector": "^1.5.0",
6369
"paneforge": "^1.0.2",
70+
"rehype-parse": "^9.0.1",
6471
"rehype-pretty-code": "^0.14.1",
72+
"rehype-remark": "^10.0.1",
6573
"rehype-slug": "^6.0.0",
6674
"remark-code-import": "^1.2.0",
6775
"remark-gfm": "^4.0.0",
76+
"remark-stringify": "^11.0.0",
6877
"rimraf": "^6.0.1",
6978
"rollup-plugin-visualizer": "^6.0.3",
7079
"runed": "^0.34.0",
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Creates empty markdown files so that they are loaded into the manifest for
3+
* the cloudflare build and we can manually update them after we build so we don't
4+
* need to build twice or try to manipulate the manifest post build.
5+
*/
6+
7+
import { globby } from "globby";
8+
import { mkdir, writeFile } from "node:fs/promises";
9+
import { dirname, join } from "node:path";
10+
import { fileURLToPath } from "node:url";
11+
12+
const __dirname = dirname(fileURLToPath(import.meta.url));
13+
14+
async function main() {
15+
try {
16+
const files = (await globby(["content/**/*.md"])).map((filePath) => {
17+
const newPath = filePath.replace("content/", "docs/");
18+
if (newPath.endsWith("/index.md")) return newPath.replace("/index.md", ".md");
19+
return newPath;
20+
});
21+
22+
for (const file of files) {
23+
const outputPath = join(__dirname, "../static", file);
24+
const outputDir = dirname(outputPath);
25+
await mkdir(outputDir, { recursive: true });
26+
await writeFile(outputPath, "\n", "utf-8");
27+
}
28+
29+
await writeFile(join(__dirname, "../static/llms.txt"), "\n", "utf-8");
30+
} catch (error) {
31+
console.error("Error building LLM placeholder files:", error);
32+
}
33+
}
34+
35+
main();

0 commit comments

Comments
 (0)