-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from evilmartians/25-add-support-for-multiple-…
…entrypoints Edit navigation format
- Loading branch information
Showing
16 changed files
with
221 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ coverage/ | |
|
||
test/website-*/src/pages/docs/**/* | ||
test/website-*/src/nav.json | ||
tsconfig.generic.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
This site is generated from `nanostores` codebase types. | ||
|
||
## `nanstores` repo is needed | ||
|
||
To make it work please make sure you have cloned following repos locally: | ||
|
||
- [`nanostores`](https://github.com/nanostores/nanostores) | ||
- [`@nanostores/router`](https://github.com/nanostores/router) | ||
|
||
and follow folder structure: | ||
|
||
``` | ||
. | ||
├── astro-typedoc | ||
├── router | ||
└── nanostores | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { defineConfig } from 'astro/config' | ||
import { dirname, resolve } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
import initAstroTypedoc from '../../index.js' | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)) | ||
|
||
const astroTypedoc = await initAstroTypedoc({ | ||
baseUrl: '/docs/', | ||
entryPoints: [ | ||
resolve(__dirname, '../../../nanostores/index.d.ts'), | ||
resolve(__dirname, '../../../router/index.d.ts') | ||
] | ||
}) | ||
|
||
const project = await astroTypedoc.getReflections() | ||
|
||
await astroTypedoc.generateDocs({ | ||
frontmatter: { | ||
layout: resolve(__dirname, './src/layouts/DocLayout.astro') | ||
}, | ||
outputFolder: 'src/pages/docs', | ||
project | ||
}) | ||
await astroTypedoc.generateNavigationJSON(project, resolve(__dirname, './src/')) | ||
|
||
// https://astro.build/config | ||
export default defineConfig({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "website-nanostores", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^2.10.14" | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
test/website-nanostores-multiple-ep/src/components/Sidebar.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import nav from '../nav.json' | ||
--- | ||
|
||
{ | ||
nav?.modules.length && ( | ||
<nav class="navigation"> | ||
{nav.modules.map(mod => ( | ||
<div> | ||
Module: {mod.name} <br /> | ||
{mod.items.map(modItem => ( | ||
<div> | ||
<a href={modItem.url}>{modItem.title} </a> | ||
</div> | ||
))} | ||
</div> | ||
))} | ||
</nav> | ||
) | ||
} | ||
<style> | ||
.navigation { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
32 changes: 32 additions & 0 deletions
32
test/website-nanostores-multiple-ep/src/layouts/DocLayout.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
import Sidebar from '../components/Sidebar.astro' | ||
const { frontmatter } = Astro.props | ||
const { title } = frontmatter | ||
--- | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>{title}</title> | ||
</head> | ||
<body> | ||
<div class="layout"> | ||
<Sidebar /> | ||
<main> | ||
<h1>{title}</h1> | ||
<article> | ||
<slot /> | ||
</article> | ||
</main> | ||
</div> | ||
</body> | ||
</html> | ||
|
||
<style> | ||
.layout { | ||
display: grid; | ||
grid-template-columns: 25% 75%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import Sidebar from '../components/Sidebar.astro' | ||
--- | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>Astro</title> | ||
</head> | ||
<body> | ||
<h1>Nanostores</h1> | ||
<Sidebar /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "astro/tsconfigs/base" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters