Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
- run: npm run fmt:check
- run: npm run lint
- run: npm test
- run: git diff --exit-code -- src/app/generated public/sitemap.xml
- run: git diff --exit-code -- projects/docs/src/app/generated projects/docs/public/sitemap.xml
- run: npm run build
- run: git diff --exit-code -- src/app/generated public/sitemap.xml
- run: git diff --exit-code -- projects/docs/src/app/generated projects/docs/public/sitemap.xml
16 changes: 8 additions & 8 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ node_modules
coverage
package-lock.json
_stencil
public
src/stripe/docs
src/stripe/assets
src/stripe/config
src/stripe-identity/docs
src/stripe-identity/config
src/app/generated
src/**/docs
projects/docs/public
projects/docs/src/stripe/docs
projects/docs/src/stripe/assets
projects/docs/src/stripe/config
projects/docs/src/stripe-identity/docs
projects/docs/src/stripe-identity/config
projects/docs/src/app/generated
projects/docs/src/**/docs
*.png
*.ico
*.svg
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"trailingComma": "all",
"useTabs": false,
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindStylesheet": "./src/styles.css",
"tailwindStylesheet": "./projects/docs/src/styles.css",
"overrides": [
{
"files": "*.html",
Expand Down
40 changes: 20 additions & 20 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# rdlabo-docs

`rdlabo-docs` is the bilingual documentation portal for rdlabo OSS. It generates static Angular pages from source packages (pinned in `package-lock.json`) and Markdown under `src/{project}/docs/`.
`rdlabo-docs` is the bilingual documentation portal for rdlabo OSS. It generates static Angular pages from source packages (pinned in `package-lock.json`) and Markdown under `projects/docs/src/{project}/docs/`.

## Quick reference

| Task | Where |
| -------------------------------------------------- | --------------------------------------------------------------------------- |
| Add/remove a project, change page list or metadata | `scripts/project-manifest.ts` |
| Write/edit Japanese documentation | `src/{project}/docs/ja/` |
| Write/edit English for portal-hosted projects | `src/{project}/docs/` (read via GitHub raw, not local checkout) |
| Write/edit English for package-hosted projects | The OSS package repository |
| Bump a package version | `package.json` pin → `npm install` → `npm run docs:generate` |
| Regenerate all pages | `npm run docs:generate` (output: `src/app/generated/` — never edit by hand) |
| Task | Where |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Add/remove a project, change page list or metadata | `scripts/project-manifest.ts` |
| Write/edit Japanese documentation | `projects/docs/src/{project}/docs/ja/` |
| Write/edit English for portal-hosted projects | `projects/docs/src/{project}/docs/` (read via GitHub raw, not local checkout) |
| Write/edit English for package-hosted projects | The OSS package repository |
| Bump a package version | `package.json` pin → `npm install` → `npm run docs:generate` |
| Regenerate all pages | `npm run docs:generate` (output: `projects/docs/src/app/generated/` — never edit by hand) |

## Page roles

Expand All @@ -25,13 +25,13 @@

## Content ownership

| Content | Source of truth | Edit in |
| --------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| English guides and landing pages | GitHub raw (package repo first, then portal repo) | Package repo when docs are published there; otherwise `src/{project}/docs/` in this repo on GitHub |
| Japanese guides and landing pages | `src/{project}/docs/ja/*.md` only | This portal |
| `!::Identifier::` API signatures | Installed npm package `dist/docs.json` | Package repo; release and bump the pin here |
| Docgen API page (`<docgen-index>` + `<docgen-api>`) | Package or portal `readme.md` on GitHub | Same repository as the English landing page |
| Code example files (`code:` refs) | `src/{project}/docs/` (not translated) | This portal |
| Content | Source of truth | Edit in |
| --------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| English guides and landing pages | GitHub raw (package repo first, then portal repo) | Package repo when docs are published there; otherwise `projects/docs/src/{project}/docs/` in this repo on GitHub |
| Japanese guides and landing pages | `projects/docs/src/{project}/docs/ja/*.md` only | This portal |
| `!::Identifier::` API signatures | Installed npm package `dist/docs.json` | Package repo; release and bump the pin here |
| Docgen API page (`<docgen-index>` + `<docgen-api>`) | Package or portal `readme.md` on GitHub | Same repository as the English landing page |
| Code example files (`code:` refs) | `projects/docs/src/{project}/docs/` (not translated) | This portal |

## Generation pipeline

Expand All @@ -40,9 +40,9 @@
`docs:generate` **always** loads English from GitHub raw — never from the local filesystem. Resolution order:

1. Package repository: `docs/{file}`, `{sourceDirectory}/docs/{file}`, then `README.md` for landings.
2. Portal repository (`rdlabo-dev/website`): `src/{sourceDirectory}/docs/{file}`.
2. Portal repository (`rdlabo-dev/website`): `projects/docs/src/{sourceDirectory}/docs/{file}`.

For `@capacitor-community/admob` and rdlabo Capacitor plugins, English lives in the **package repository only** — do not copy those English files into `src/{project}/docs/`.
For `@capacitor-community/admob` and rdlabo Capacitor plugins, English lives in the **package repository only** — do not copy those English files into `projects/docs/src/{project}/docs/`.

Optional `englishDocsRef` overrides the Git ref for English guides fetched from the package repository (default: `main`). API signatures always follow the installed npm version, not the Git ref.

Expand Down Expand Up @@ -83,8 +83,8 @@ Use a kind tag so `formatApiEntries` wraps each entry in an `api-entry` card. Su

### File structure

- Every page in `project-manifest.ts` must have an English source on GitHub and a Japanese counterpart at `src/{project}/docs/ja/{file}`.
- Package-hosted English (AdMob, rdlabo Capacitor plugins) must **not** be duplicated under `src/{project}/docs/`.
- Every page in `project-manifest.ts` must have an English source on GitHub and a Japanese counterpart at `projects/docs/src/{project}/docs/ja/{file}`.
- Package-hosted English (AdMob, rdlabo Capacitor plugins) must **not** be duplicated under `projects/docs/src/{project}/docs/`.
- Code example files (`code:` refs) are not translated.

### Translation rules
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ Production is `docs.rdlabo.dev` on Cloudflare Workers Static Assets. The reposit
| --- | --- |
| Ionic Framework Japanese Documentation | `ionic-jp/ionic-docs` |
| Capacitor Japanese Documentation | `ionic-jp/capacitor-docs` |
| Capacitor Community Stripe | `src/stripe/docs` |
| Capacitor Community Stripe Identity | `src/stripe-identity/docs` |
| Capacitor Community Stripe Terminal | `src/stripe-terminal/docs` |
| Capacitor Community AdMob | `src/admob/docs` |
| Capacitor Community Facebook Login | `src/facebook-login/docs` |
| rdlabo Capacitor Code Scanner | `src/capacitor-codescanner/docs` |
| rdlabo Capacitor Screenshot Event | `src/capacitor-screenshot-event/docs` |
| rdlabo Capacitor Printer | `src/capacitor-printer/docs` |
| rdlabo Capacitor Brother Print | `src/capacitor-brotherprint/docs` |
| rdlabo Ionic Angular Kit | `src/ionic-angular-kit/docs` |
| rdlabo Ionic Angular Photo Editor | `src/ionic-angular-photo-editor/docs` |
| rdlabo Ionic Angular Scroll Header | `src/ionic-angular-scroll-header/docs` |
| rdlabo Angular CDK Scroll Strategies | `src/ngx-cdk-scroll-strategies/docs` |
| rdlabo Ionic Theme iOS26 | `src/ionic-theme-ios26/docs` |
| rdlabo Ionic Theme Material Design 3 | `src/ionic-theme-md3/docs` |
| rdlabo Ionic Angular Collect Icons | `src/ionic-angular-collect-icons/docs` |
| rdlabo Workers Hono Kit | `src/workers-hono-kit/docs` |
| rdlabo ESLint Plugin Rules | `src/eslint-plugin-rules/docs` |
| rdlabo Capacitor Docgen | `src/capacitor-docgen/docs` |
| Capacitor Community Stripe | `projects/docs/src/stripe/docs` |
| Capacitor Community Stripe Identity | `projects/docs/src/stripe-identity/docs` |
| Capacitor Community Stripe Terminal | `projects/docs/src/stripe-terminal/docs` |
| Capacitor Community AdMob | `projects/docs/src/admob/docs` |
| Capacitor Community Facebook Login | `projects/docs/src/facebook-login/docs` |
| rdlabo Capacitor Code Scanner | `projects/docs/src/capacitor-codescanner/docs` |
| rdlabo Capacitor Screenshot Event | `projects/docs/src/capacitor-screenshot-event/docs` |
| rdlabo Capacitor Printer | `projects/docs/src/capacitor-printer/docs` |
| rdlabo Capacitor Brother Print | `projects/docs/src/capacitor-brotherprint/docs` |
| rdlabo Ionic Angular Kit | `projects/docs/src/ionic-angular-kit/docs` |
| rdlabo Ionic Angular Photo Editor | `projects/docs/src/ionic-angular-photo-editor/docs` |
| rdlabo Ionic Angular Scroll Header | `projects/docs/src/ionic-angular-scroll-header/docs` |
| rdlabo Angular CDK Scroll Strategies | `projects/docs/src/ngx-cdk-scroll-strategies/docs` |
| rdlabo Ionic Theme iOS26 | `projects/docs/src/ionic-theme-ios26/docs` |
| rdlabo Ionic Theme Material Design 3 | `projects/docs/src/ionic-theme-md3/docs` |
| rdlabo Ionic Angular Collect Icons | `projects/docs/src/ionic-angular-collect-icons/docs` |
| rdlabo Workers Hono Kit | `projects/docs/src/workers-hono-kit/docs` |
| rdlabo ESLint Plugin Rules | `projects/docs/src/eslint-plugin-rules/docs` |
| rdlabo Capacitor Docgen | `projects/docs/src/capacitor-docgen/docs` |

Project metadata, navigation, localized landing copy, and API input are declared in `scripts/project-manifest.ts`. The generator creates a small catalog plus one lazy module per project and locale.

Expand Down Expand Up @@ -84,7 +84,7 @@ Every project exposes a dedicated API page. Hand-authored API Markdown uses sema
such as `` #### `component` PhotoEditorPage `` or `` #### `function` generate ``; the generator
normalizes those entries and Capacitor docgen output into the same API-card presentation.

Generated project modules live under `src/app/generated/projects` and must not be edited by hand.
Generated project modules live under `projects/docs/src/app/generated/projects` and must not be edited by hand.

API input is restricted to packages declared in `scripts/project-manifest.ts` and installed at exact
versions in `package-lock.json`. Generated HTML is reviewed as part of the repository diff; adding a
Expand Down
40 changes: 22 additions & 18 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"newProjectRoot": "projects",
"projects": {
"capacitor-plugins-docs": {
"docs": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"root": "projects/docs",
"sourceRoot": "projects/docs/src",
"prefix": "app",
"i18n": {
"sourceLocale": {
Expand All @@ -21,7 +21,7 @@
},
"locales": {
"ja": {
"translation": "src/locale/messages.ja.xlf",
"translation": "projects/docs/src/locale/messages.ja.xlf",
"subPath": "ja"
}
}
Expand All @@ -30,27 +30,27 @@
"build": {
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"browser": "projects/docs/src/main.ts",
"tsConfig": "projects/docs/tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
"input": "projects/docs/public"
},
{
"glob": "**/*",
"input": "src/stripe/assets",
"input": "projects/docs/src/stripe/assets",
"output": "assets/stripe"
}
],
"styles": ["src/styles.css"],
"server": "src/main.server.ts",
"styles": ["projects/docs/src/styles.css"],
"server": "projects/docs/src/main.server.ts",
"outputMode": "static",
"security": {
"allowedHosts": []
},
"ssr": {
"entry": "src/server.ts"
"entry": "projects/docs/src/server.ts"
},
"polyfills": ["@angular/localize/init"],
"localize": true,
Expand Down Expand Up @@ -93,28 +93,28 @@
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "capacitor-plugins-docs:build:production"
"buildTarget": "docs:build:production"
},
"development": {
"buildTarget": "capacitor-plugins-docs:build:development"
"buildTarget": "docs:build:development"
},
"ja": {
"buildTarget": "capacitor-plugins-docs:build:development,ja"
"buildTarget": "docs:build:development,ja"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular/build:extract-i18n",
"options": {
"buildTarget": "capacitor-plugins-docs:build:development"
"buildTarget": "docs:build:development"
}
},
"test": {
"builder": "@angular/build:unit-test",
"options": {
"tsConfig": "tsconfig.spec.json",
"buildTarget": "capacitor-plugins-docs:build",
"tsConfig": "projects/docs/tsconfig.spec.json",
"buildTarget": "docs:build",
"runner": "vitest"
},
"configurations": {
Expand All @@ -126,7 +126,11 @@
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html", "scripts/**/*.ts"]
"lintFilePatterns": [
"projects/docs/src/**/*.ts",
"projects/docs/src/**/*.html",
"scripts/**/*.ts"
]
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ module.exports = defineConfig([
'dist/**',
'coverage/**',
'.angular/**',
'src/app/generated/**',
'src/stripe/**',
'src/stripe-identity/**',
'src/stripe-terminal/**',
'projects/docs/src/app/generated/**',
'projects/docs/src/stripe/**',
'projects/docs/src/stripe-identity/**',
'projects/docs/src/stripe-terminal/**',
],
},
{
plugins: { '@rdlabo/rules': rdlabo },
},
...rdlabo.configs.recommended,
{
files: ['src/**/*.ts'],
files: ['projects/docs/src/**/*.ts'],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"start:ja": "ng serve --configuration ja",
"prebuild": "npm run docs:generate",
"static:prepare": "tsx scripts/static-prepare.ts",
"build": "ng build && npm run static:prepare && pagefind --site dist/capacitor-plugins-docs/browser --output-subdir pagefind && tsx --test scripts/build-output.test.ts",
"build": "ng build && npm run static:prepare && pagefind --site dist/docs/browser --output-subdir pagefind && tsx --test scripts/build-output.test.ts",
"watch": "ng build --watch --configuration development",
"pretest": "npm run docs:generate",
"test": "tsx --test scripts/docgen-readme.test.ts scripts/html-policy.test.ts scripts/markdown-headings.test.ts scripts/package-markdown.test.ts scripts/package-repository.test.ts scripts/github-sponsors.test.ts scripts/bilingual-update-blocker.test.ts scripts/site-contract.test.ts && ng test --watch=false",
"fmt": "prettier --write .",
"fmt:check": "prettier --check .",
"deploy": "npm run build && wrangler deploy",
"deploy:dry-run": "npm run build && wrangler deploy --dry-run",
"serve:ssr:capacitor-plugins-docs": "node dist/capacitor-plugins-docs/server/server.mjs",
"serve:ssr:docs": "node dist/docs/server/server.mjs",
"lint": "ng lint"
},
"dependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading