@openlaboratory/open-doc 0.1.0
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/README.md +91 -0
- package/app/.astro/collections/docs.schema.json +24 -0
- package/app/.astro/content-assets.mjs +1 -0
- package/app/.astro/content-modules.mjs +4 -0
- package/app/.astro/content.d.ts +218 -0
- package/app/.astro/data-store.json +1 -0
- package/app/.astro/settings.json +5 -0
- package/app/.astro/types.d.ts +2 -0
- package/app/astro.config.mjs +43 -0
- package/app/node_modules/.astro/data-store.json +1 -0
- package/app/node_modules/.vite/deps/@astrojs_react_client__js.js +163 -0
- package/app/node_modules/.vite/deps/@astrojs_react_client__js.js.map +7 -0
- package/app/node_modules/.vite/deps/_metadata.json +67 -0
- package/app/node_modules/.vite/deps/astro___aria-query.js +6776 -0
- package/app/node_modules/.vite/deps/astro___aria-query.js.map +7 -0
- package/app/node_modules/.vite/deps/astro___axobject-query.js +3754 -0
- package/app/node_modules/.vite/deps/astro___axobject-query.js.map +7 -0
- package/app/node_modules/.vite/deps/astro___cssesc.js +99 -0
- package/app/node_modules/.vite/deps/astro___cssesc.js.map +7 -0
- package/app/node_modules/.vite/deps/chunk-55ZOATU5.js +305 -0
- package/app/node_modules/.vite/deps/chunk-55ZOATU5.js.map +7 -0
- package/app/node_modules/.vite/deps/chunk-5WRI5ZAA.js +30 -0
- package/app/node_modules/.vite/deps/chunk-5WRI5ZAA.js.map +7 -0
- package/app/node_modules/.vite/deps/chunk-FEZZJEG2.js +6935 -0
- package/app/node_modules/.vite/deps/chunk-FEZZJEG2.js.map +7 -0
- package/app/node_modules/.vite/deps/package.json +3 -0
- package/app/node_modules/.vite/deps/react-dom.js +6 -0
- package/app/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/app/node_modules/.vite/deps/react.js +5 -0
- package/app/node_modules/.vite/deps/react.js.map +7 -0
- package/app/node_modules/.vite/deps/react_jsx-dev-runtime.js +39 -0
- package/app/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/app/node_modules/.vite/deps/react_jsx-runtime.js +57 -0
- package/app/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/app/src/components/DocsMobileNav.tsx +124 -0
- package/app/src/components/DocsSearch.tsx +315 -0
- package/app/src/components/DocsSidebar.astro +46 -0
- package/app/src/components/DocsTableOfContents.tsx +92 -0
- package/app/src/components/Navbar.astro +39 -0
- package/app/src/components/SocialIcon.astro +54 -0
- package/app/src/components/ThemeToggle.tsx +62 -0
- package/app/src/content.config.ts +17 -0
- package/app/src/env.d.ts +7 -0
- package/app/src/integrations/open-doc-config.mjs +65 -0
- package/app/src/layouts/DocsLayout.astro +369 -0
- package/app/src/lib/config.ts +36 -0
- package/app/src/lib/navigation.ts +68 -0
- package/app/src/lib/withBase.ts +11 -0
- package/app/src/pages/404.astro +24 -0
- package/app/src/pages/[...slug].astro +34 -0
- package/app/src/pages/index.astro +107 -0
- package/app/src/styles/global.css +324 -0
- package/app/tailwind.config.mjs +53 -0
- package/app/tsconfig.json +11 -0
- package/bin/open-doc.js +2 -0
- package/dist/chunk-BRUM67K7.js +30 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +268 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +8 -0
- package/package.json +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** Theme mode. `'auto'` follows the operating-system preference. */
|
|
2
|
+
type ThemeMode = 'dark' | 'light' | 'auto';
|
|
3
|
+
/** A link rendered in the top-right of the header. */
|
|
4
|
+
interface SocialLink {
|
|
5
|
+
/**
|
|
6
|
+
* A built-in icon name (`github`, `x`, `twitter`, `discord`, `slack`,
|
|
7
|
+
* `linkedin`, `youtube`, `mastodon`, `bluesky`). Omit for a generic link icon.
|
|
8
|
+
*/
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Accessible label. Defaults to the icon name. */
|
|
11
|
+
label?: string;
|
|
12
|
+
href: string;
|
|
13
|
+
}
|
|
14
|
+
/** One section of the sidebar. */
|
|
15
|
+
interface NavSection {
|
|
16
|
+
/** Section heading shown in the sidebar. */
|
|
17
|
+
label: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional folder under your content directory that `pages` are relative to.
|
|
20
|
+
* e.g. `dir: 'getting-started'` + `pages: ['quick-start']` →
|
|
21
|
+
* `getting-started/quick-start`.
|
|
22
|
+
*/
|
|
23
|
+
dir?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Ordered list of page slugs (file paths without extension), relative to `dir`
|
|
26
|
+
* if provided, otherwise to the content root. Page titles & descriptions are
|
|
27
|
+
* read from each file's frontmatter automatically.
|
|
28
|
+
*/
|
|
29
|
+
pages: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Override theme colors. Each value is an HSL triplet *without* the `hsl()`
|
|
33
|
+
* wrapper, e.g. `{ link: '212 96% 68%', background: '0 0% 4%' }`.
|
|
34
|
+
*
|
|
35
|
+
* Recognised tokens: `background`, `foreground`, `surface`, `surface-sidebar`,
|
|
36
|
+
* `surface-content`, `surface-raised`, `border`, `muted`, `link`, `link-hover`,
|
|
37
|
+
* `code-bg`, `code-border`, `primary`, `success`, `warning`.
|
|
38
|
+
*/
|
|
39
|
+
type ThemeColors = Record<string, string>;
|
|
40
|
+
interface ThemeConfig {
|
|
41
|
+
light?: ThemeColors;
|
|
42
|
+
dark?: ThemeColors;
|
|
43
|
+
}
|
|
44
|
+
interface LogoConfig {
|
|
45
|
+
/** Logo text. Defaults to the site `title`. */
|
|
46
|
+
text?: string;
|
|
47
|
+
/** Path to a logo image in your public directory, e.g. `/logo.svg`. */
|
|
48
|
+
src?: string;
|
|
49
|
+
/** Where clicking the logo links to. Default: `'/'`. */
|
|
50
|
+
href?: string;
|
|
51
|
+
}
|
|
52
|
+
interface OpenDocConfig {
|
|
53
|
+
/** Site title — used in the `<title>` tag and as the default logo text. */
|
|
54
|
+
title: string;
|
|
55
|
+
/** Short tagline shown on the home page hero. */
|
|
56
|
+
description?: string;
|
|
57
|
+
/** Directory containing your `.md` / `.mdx` files. Default: `'./content'`. */
|
|
58
|
+
contentDir?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Directory of static assets served at the site root. Default: `'./public'`
|
|
61
|
+
* when it exists.
|
|
62
|
+
*/
|
|
63
|
+
publicDir?: string;
|
|
64
|
+
/** Base path for sub-path hosting, e.g. `'/docs'`. Default: `'/'`. */
|
|
65
|
+
base?: string;
|
|
66
|
+
/** Canonical site URL. Enables `<link rel="canonical">`, OpenGraph URLs, and a sitemap. */
|
|
67
|
+
site?: string;
|
|
68
|
+
/** `lang` attribute on `<html>`, used by screen readers and SEO. Default: `'en'`. */
|
|
69
|
+
lang?: string;
|
|
70
|
+
/** Path to a favicon in your public dir, e.g. `/favicon.svg`. Defaults to a bundled icon. */
|
|
71
|
+
favicon?: string;
|
|
72
|
+
/** Header logo. */
|
|
73
|
+
logo?: LogoConfig;
|
|
74
|
+
/** Links shown on the right of the header. */
|
|
75
|
+
social?: SocialLink[];
|
|
76
|
+
/** Initial theme before the user toggles it. Default: `'dark'`. */
|
|
77
|
+
defaultTheme?: ThemeMode;
|
|
78
|
+
/** Show the light/dark toggle in the header. Default: `true`. */
|
|
79
|
+
themeToggle?: boolean;
|
|
80
|
+
/** Optional per-mode color overrides. */
|
|
81
|
+
theme?: ThemeConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Base URL for an "Edit this page" link, pointing at the directory that holds
|
|
84
|
+
* your content, e.g. `'https://github.com/me/repo/edit/main/content'`.
|
|
85
|
+
*/
|
|
86
|
+
editLinkBase?: string;
|
|
87
|
+
/** Sidebar navigation. */
|
|
88
|
+
nav: NavSection[];
|
|
89
|
+
}
|
|
90
|
+
/** Config with all defaults applied — the shape the Astro app receives. */
|
|
91
|
+
interface ResolvedConfig {
|
|
92
|
+
title: string;
|
|
93
|
+
description: string;
|
|
94
|
+
base: string;
|
|
95
|
+
site?: string;
|
|
96
|
+
lang: string;
|
|
97
|
+
favicon?: string;
|
|
98
|
+
logo: Required<Omit<LogoConfig, 'src'>> & {
|
|
99
|
+
src?: string;
|
|
100
|
+
};
|
|
101
|
+
social: SocialLink[];
|
|
102
|
+
defaultTheme: ThemeMode;
|
|
103
|
+
themeToggle: boolean;
|
|
104
|
+
theme: ThemeConfig;
|
|
105
|
+
editLinkBase?: string;
|
|
106
|
+
nav: NavSection[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Identity helper that gives your `open-doc.config.ts` full type-checking and
|
|
110
|
+
* editor autocomplete.
|
|
111
|
+
*/
|
|
112
|
+
declare function defineConfig(config: OpenDocConfig): OpenDocConfig;
|
|
113
|
+
/** Apply defaults. Used by the CLI before handing the config to the Astro app. */
|
|
114
|
+
declare function normalizeConfig(config: OpenDocConfig): ResolvedConfig;
|
|
115
|
+
|
|
116
|
+
export { type LogoConfig, type NavSection, type OpenDocConfig, type ResolvedConfig, type SocialLink, type ThemeColors, type ThemeConfig, type ThemeMode, defineConfig, normalizeConfig };
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openlaboratory/open-doc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A polished, GitBook-style documentation-site framework. Write Markdown, run one command, get a beautiful static site.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"documentation",
|
|
7
|
+
"docs",
|
|
8
|
+
"astro",
|
|
9
|
+
"static-site",
|
|
10
|
+
"markdown",
|
|
11
|
+
"mdx",
|
|
12
|
+
"framework"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Patrick Triest",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/openlaboratory-org/open-doc.git",
|
|
19
|
+
"directory": "packages/open-doc"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/openlaboratory-org/open-doc#readme",
|
|
22
|
+
"bugs": "https://github.com/openlaboratory-org/open-doc/issues",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"bin": {
|
|
28
|
+
"open-doc": "./bin/open-doc.js"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"bin",
|
|
40
|
+
"dist",
|
|
41
|
+
"app",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"dev": "tsup --watch"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@astrojs/mdx": "^4.3.1",
|
|
50
|
+
"@astrojs/react": "^4.3.0",
|
|
51
|
+
"@astrojs/sitemap": "^3.2.1",
|
|
52
|
+
"@astrojs/tailwind": "^6.0.2",
|
|
53
|
+
"@tailwindcss/typography": "^0.5.15",
|
|
54
|
+
"astro": "^5.13.0",
|
|
55
|
+
"astro-pagefind": "^1.8.3",
|
|
56
|
+
"autoprefixer": "^10.4.20",
|
|
57
|
+
"cac": "^6.7.14",
|
|
58
|
+
"fuse.js": "^7.1.0",
|
|
59
|
+
"jiti": "^2.4.2",
|
|
60
|
+
"picocolors": "^1.1.1",
|
|
61
|
+
"postcss": "^8.4.49",
|
|
62
|
+
"react": "^18.3.1",
|
|
63
|
+
"react-dom": "^18.3.1",
|
|
64
|
+
"tailwindcss": "^3.4.17"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@astrojs/check": "^0.9.4",
|
|
68
|
+
"@types/node": "^22.10.0",
|
|
69
|
+
"@types/react": "^18.3.12",
|
|
70
|
+
"@types/react-dom": "^18.3.1",
|
|
71
|
+
"tsup": "^8.3.5",
|
|
72
|
+
"typescript": "^5.7.3"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=18.17.0"
|
|
76
|
+
}
|
|
77
|
+
}
|