Skip to content

Commit f93edd1

Browse files
committed
starting soba docs
1 parent 72cef4a commit f93edd1

File tree

19 files changed

+1281
-6703
lines changed

19 files changed

+1281
-6703
lines changed

apps/astro-docs/astro.config.mjs

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
import analogjsangular from '@analogjs/astro-angular';
22
import starlight from '@astrojs/starlight';
33
import tailwind from '@astrojs/tailwind';
4-
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers';
54
import { defineConfig } from 'astro/config';
5+
import { readFileSync } from 'fs';
6+
7+
function includeContentPlugin() {
8+
const map = new Map();
9+
10+
return [
11+
{
12+
name: 'pre-include-content',
13+
enforce: 'pre',
14+
transform(code, id) {
15+
if (!id.includes('?includeContent')) return;
16+
const [filePath] = id.split('?');
17+
const fileContent = readFileSync(filePath, 'utf-8');
18+
19+
if (map.has(filePath)) return;
20+
map.set(filePath, fileContent.replace(/\t/g, ' '));
21+
},
22+
},
23+
{
24+
name: 'post-include-content',
25+
enforce: 'post',
26+
transform(code, id) {
27+
if (!id.includes('?includeContent')) return;
28+
const [filePath] = id.split('?');
29+
const fileContent = map.get(filePath);
30+
31+
return {
32+
code: `
33+
${code}
34+
export const content = ${JSON.stringify(fileContent)};
35+
`,
36+
};
37+
},
38+
},
39+
];
40+
}
641

742
// https://astro.build/config
843
export default defineConfig({
@@ -15,11 +50,13 @@ export default defineConfig({
1550
'@angular/core',
1651
'@angular/core/rxjs-interop',
1752
'ngxtension/**',
53+
'@pmndrs/vanilla',
1854
],
1955
},
2056
esbuild: {
2157
jsxDev: true,
2258
},
59+
plugins: [includeContentPlugin()],
2360
},
2461
integrations: [
2562
analogjsangular({
@@ -31,7 +68,6 @@ export default defineConfig({
3168
}),
3269
starlight({
3370
title: 'Angular Three',
34-
site: 'https://angularthree.netlify.app/',
3571
favicon: './src/assets/angular-three-dark.svg',
3672
tableOfContents: {
3773
minHeadingLevel: 2,
@@ -91,11 +127,21 @@ export default defineConfig({
91127
},
92128
],
93129
},
130+
{
131+
label: 'Soba',
132+
items: [
133+
{ label: 'Introduction', slug: 'soba/introduction' },
134+
{
135+
label: 'Abstractions',
136+
items: [
137+
{ label: 'Introduction', slug: 'soba/abstractions/introduction' },
138+
{ label: 'NgtsGradientTexture', slug: 'soba/abstractions/gradient-texture' },
139+
{ label: 'NgtsGrid', slug: 'soba/abstractions/grid' },
140+
],
141+
},
142+
],
143+
},
94144
],
95-
expressiveCode: {
96-
themes: ['dark-plus', 'light-plus'],
97-
plugins: [pluginLineNumbers()],
98-
},
99145
}),
100146
tailwind({ applyBaseStyles: false }),
101147
],

apps/astro-docs/ec.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers';
2+
3+
export default {
4+
themes: ['dark-plus', 'light-plus'],
5+
plugins: [pluginLineNumbers()],
6+
};

apps/astro-docs/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,22 @@
2525
"@astrojs/mdx": "^3.1.3",
2626
"@astrojs/starlight": "^0.25.1",
2727
"@astrojs/tailwind": "^5.1.0",
28-
"angular-three": "^2.0.0-beta.268",
29-
"angular-three-cannon": "^2.0.0-beta.268",
30-
"angular-three-postprocessing": "^2.0.0-beta.268",
31-
"angular-three-soba": "^2.0.0-beta.268",
28+
"angular-three": "^2.0.0-beta.270",
29+
"angular-three-cannon": "^2.0.0-beta.270",
30+
"angular-three-postprocessing": "^2.0.0-beta.270",
31+
"angular-three-soba": "^2.0.0-beta.270",
3232
"astro": "^4.10.2",
33-
"ngxtension": "^4.0.0",
3433
"rxjs": "^7.8.1",
3534
"sharp": "^0.32.5",
3635
"tailwindcss": "^3.4.6",
37-
"three": "^0.166.1",
3836
"tslib": "^2.6.3",
3937
"typescript": "^5.5.3",
4038
"zone.js": "^0.14.8"
4139
},
4240
"nx": {},
4341
"devDependencies": {
4442
"@astrojs/starlight-tailwind": "^2.0.3",
45-
"@expressive-code/plugin-line-numbers": "^0.35.3",
46-
"@types/three": "^0.166.0"
43+
"@expressive-code/plugin-line-numbers": "^0.35.3"
4744
},
4845
"web-types": [
4946
"../../node_modules/angular-three/web-types.json",

0 commit comments

Comments
 (0)