@tidyfactor/doc 1.3.0 → 1.9.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/.tidyfactor +3 -3
- package/CHANGELOG.md +103 -4
- package/README.ar.md +34 -8
- package/README.de.md +1 -1
- package/README.es.md +1 -1
- package/README.fa.md +1 -1
- package/README.fr.md +1 -1
- package/README.md +34 -8
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/SKILL.md +28 -5
- package/bin/add-skill.js +44 -6
- package/brand.json +1 -1
- package/brand.yaml +10 -0
- package/manifest.json +216 -0
- package/package.json +4 -2
- package/references/commands/adr.md +25 -0
- package/references/commands/audit.md +15 -0
- package/references/commands/brief.md +16 -0
- package/references/commands/generate.md +7 -6
- package/references/commands/site.md +25 -23
- package/references/commands/vitepress.md +20 -0
- package/references/memory/20-brain-baas-integration.md +83 -0
- package/references/memory/adr-template.md +84 -0
- package/references/memory/changelog-rules.md +58 -0
- package/references/memory/collection-sources.md +48 -47
- package/references/memory/decision-points.md +72 -0
- package/references/memory/doc-templates.md +102 -73
- package/references/memory/doc-tree.md +38 -37
- package/references/memory/docsify-config.md +274 -273
- package/references/memory/git-doc-sync-hook.md +54 -0
- package/references/memory/mkdocs-config.md +171 -170
- package/references/memory/naming-conventions.md +40 -0
- package/references/memory/project-mindmap.md +66 -0
- package/references/memory/site-engines.md +32 -34
- package/references/memory/stacks/js-ts.md +47 -45
- package/references/memory/stacks/php.md +35 -33
- package/references/memory/stacks/react-vue-next.md +52 -50
- package/references/memory/tone-of-voice.md +31 -0
- package/references/memory/vitepress-config.md +174 -0
- package/references/workflows/audit.md +42 -0
- package/references/workflows/brief.md +105 -0
- package/references/workflows/collect.md +60 -25
- package/references/workflows/generate-adr.md +41 -0
- package/references/workflows/generate-changelog.md +52 -0
- package/references/workflows/init-docs.md +44 -18
- package/references/workflows/vitepress.md +57 -0
- package/scripts/audit_docs.py +190 -0
- package/scripts/clean_orphaned_assets.py +185 -0
- package/tools/build-skill.js +3 -0
- package/assets/og-default.png +0 -0
|
@@ -1,170 +1,171 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
mkdocs-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- navigation.
|
|
62
|
-
- navigation.tabs
|
|
63
|
-
- navigation.
|
|
64
|
-
- navigation.
|
|
65
|
-
- navigation.
|
|
66
|
-
- navigation.
|
|
67
|
-
- navigation.
|
|
68
|
-
- navigation.
|
|
69
|
-
-
|
|
70
|
-
- search.
|
|
71
|
-
- search.
|
|
72
|
-
-
|
|
73
|
-
- content.code.
|
|
74
|
-
- content.
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- pymdownx.
|
|
119
|
-
- pymdownx.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
- pymdownx.
|
|
128
|
-
- pymdownx.
|
|
129
|
-
- pymdownx.
|
|
130
|
-
- pymdownx.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
1
|
+
<!-- last-verified: 2026-09-02 -->
|
|
2
|
+
# Memory: MkDocs Material Configuration Spec
|
|
3
|
+
|
|
4
|
+
Complete architectural specification for scaffolding and compiling production-grade documentation portals with MkDocs Material.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Package Requirements (`requirements.txt`)
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
mkdocs-material>=9.5
|
|
12
|
+
mkdocs-static-i18n>=1.2
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Master Configuration Schema (`mkdocs.yml`)
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
site_name: Project Documentation
|
|
21
|
+
site_url: https://example.com/docs/
|
|
22
|
+
site_description: "Production Documentation Portal"
|
|
23
|
+
site_author: Engineering Team
|
|
24
|
+
|
|
25
|
+
docs_dir: docs
|
|
26
|
+
site_dir: site
|
|
27
|
+
|
|
28
|
+
theme:
|
|
29
|
+
name: material
|
|
30
|
+
language: en
|
|
31
|
+
direction: ltr
|
|
32
|
+
custom_dir: overrides
|
|
33
|
+
|
|
34
|
+
logo: assets/logo.png
|
|
35
|
+
favicon: assets/favicon.png
|
|
36
|
+
|
|
37
|
+
font:
|
|
38
|
+
text: Plus Jakarta Sans
|
|
39
|
+
code: Fira Code
|
|
40
|
+
|
|
41
|
+
palette:
|
|
42
|
+
# Light Mode
|
|
43
|
+
- media: "(prefers-color-scheme: light)"
|
|
44
|
+
scheme: tidyfactor-light
|
|
45
|
+
primary: custom
|
|
46
|
+
accent: custom
|
|
47
|
+
toggle:
|
|
48
|
+
icon: material/brightness-7
|
|
49
|
+
name: Switch to Dark Mode
|
|
50
|
+
|
|
51
|
+
# Dark Mode
|
|
52
|
+
- media: "(prefers-color-scheme: dark)"
|
|
53
|
+
scheme: tidyfactor-dark
|
|
54
|
+
primary: custom
|
|
55
|
+
accent: custom
|
|
56
|
+
toggle:
|
|
57
|
+
icon: material/brightness-4
|
|
58
|
+
name: Switch to Light Mode
|
|
59
|
+
|
|
60
|
+
features:
|
|
61
|
+
- navigation.tracking
|
|
62
|
+
- navigation.tabs
|
|
63
|
+
- navigation.tabs.sticky
|
|
64
|
+
- navigation.sections
|
|
65
|
+
- navigation.expand
|
|
66
|
+
- navigation.path
|
|
67
|
+
- navigation.top
|
|
68
|
+
- navigation.indexes
|
|
69
|
+
- navigation.footer
|
|
70
|
+
- search.suggest
|
|
71
|
+
- search.highlight
|
|
72
|
+
- search.share
|
|
73
|
+
- content.code.copy
|
|
74
|
+
- content.code.annotate
|
|
75
|
+
- content.tabs.link
|
|
76
|
+
- header.autohide
|
|
77
|
+
- toc.follow
|
|
78
|
+
|
|
79
|
+
plugins:
|
|
80
|
+
- search:
|
|
81
|
+
separator: '[\s\-\.]+'
|
|
82
|
+
lang:
|
|
83
|
+
- en
|
|
84
|
+
- ar
|
|
85
|
+
|
|
86
|
+
- i18n:
|
|
87
|
+
docs_structure: suffix
|
|
88
|
+
languages:
|
|
89
|
+
- locale: en
|
|
90
|
+
name: English
|
|
91
|
+
default: true
|
|
92
|
+
build: true
|
|
93
|
+
- locale: ar
|
|
94
|
+
name: العربية
|
|
95
|
+
build: true
|
|
96
|
+
theme:
|
|
97
|
+
language: ar
|
|
98
|
+
direction: rtl
|
|
99
|
+
font:
|
|
100
|
+
text: Tajawal
|
|
101
|
+
code: Fira Code
|
|
102
|
+
|
|
103
|
+
markdown_extensions:
|
|
104
|
+
- abbr
|
|
105
|
+
- admonition
|
|
106
|
+
- attr_list
|
|
107
|
+
- def_list
|
|
108
|
+
- footnotes
|
|
109
|
+
- md_in_html
|
|
110
|
+
- tables
|
|
111
|
+
- toc:
|
|
112
|
+
permalink: true
|
|
113
|
+
toc_depth: 3
|
|
114
|
+
- pymdownx.arithmatex:
|
|
115
|
+
generic: true
|
|
116
|
+
- pymdownx.betterem:
|
|
117
|
+
smart_enable: all
|
|
118
|
+
- pymdownx.caret
|
|
119
|
+
- pymdownx.details
|
|
120
|
+
- pymdownx.emoji:
|
|
121
|
+
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
|
122
|
+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
|
123
|
+
- pymdownx.highlight:
|
|
124
|
+
anchor_linenums: true
|
|
125
|
+
line_spans: __span
|
|
126
|
+
pygments_lang_class: true
|
|
127
|
+
- pymdownx.inlinehilite
|
|
128
|
+
- pymdownx.keys
|
|
129
|
+
- pymdownx.mark
|
|
130
|
+
- pymdownx.smartsymbols
|
|
131
|
+
- pymdownx.superfences:
|
|
132
|
+
custom_fences:
|
|
133
|
+
- name: mermaid
|
|
134
|
+
class: mermaid
|
|
135
|
+
format: !!python/name:pymdownx.superfences.fence_code_format
|
|
136
|
+
- pymdownx.tabbed:
|
|
137
|
+
alternate_style: true
|
|
138
|
+
- pymdownx.tasklist:
|
|
139
|
+
custom_checkbox: true
|
|
140
|
+
- pymdownx.tilde
|
|
141
|
+
|
|
142
|
+
extra_css:
|
|
143
|
+
- stylesheets/extra.css
|
|
144
|
+
|
|
145
|
+
extra_javascript:
|
|
146
|
+
- javascripts/extra.js
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 3. Bilingual Suffix Rule (i18n)
|
|
152
|
+
|
|
153
|
+
- English source files: `docs/guides/architecture.md`, `docs/index.md`
|
|
154
|
+
- Arabic source files: `docs/guides/architecture.ar.md`, `docs/index.ar.md`
|
|
155
|
+
- Rule: Never link directly to `.ar.md` from `.md` files; the `i18n` plugin handles language linking automatically via the header switcher.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 4. Local Apache Subfolder Routing (`.htaccess`)
|
|
160
|
+
|
|
161
|
+
When hosting the documentation inside a subfolder during local Apache/WAMP development:
|
|
162
|
+
|
|
163
|
+
```apache
|
|
164
|
+
<IfModule mod_rewrite.c>
|
|
165
|
+
RewriteEngine On
|
|
166
|
+
RewriteRule ^site(/.*)?$ - [L]
|
|
167
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
168
|
+
RewriteRule ^(.*)$ site/$1 [L]
|
|
169
|
+
</IfModule>
|
|
170
|
+
```
|
|
171
|
+
In production: upload the contents of `site/` directly into `public_html/docs/`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!-- last-verified: 2026-09-09 -->
|
|
2
|
+
# Memory: naming-conventions
|
|
3
|
+
|
|
4
|
+
Authoritative naming conventions across supported code stacks and documentation files.
|
|
5
|
+
|
|
6
|
+
## 1. Documentation File System Conventions
|
|
7
|
+
|
|
8
|
+
| Element | Format | Example | Anti-Pattern |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| Guide Slugs | `kebab-case.md` | `setup-guide.md` | `Setup_Guide.MD` |
|
|
11
|
+
| ADR Records | `NNNN-kebab-case.md` | `0001-database-choice.md` | `1_db.md` |
|
|
12
|
+
| Localized Guides | `[slug].[locale].md` | `architecture.ar.md` | `architecture_arabic.md` |
|
|
13
|
+
| API References | `[component-or-class].md` | `user-service.md` | `UserServiceAPI.md` |
|
|
14
|
+
| Internal Findings | `docs/.collected/[target].md` | `docs/.collected/auth.md` | `docs/.collected/Auth-Module.md` |
|
|
15
|
+
|
|
16
|
+
## 2. Multi-Language Code Symbol Conventions
|
|
17
|
+
|
|
18
|
+
### PHP (PSR-1 / PSR-12)
|
|
19
|
+
- **Namespaces**: `PascalCase` (`App\Core\Registry`, `App\Modules\Blog`)
|
|
20
|
+
- **Classes / Interfaces / Traits**: `PascalCase` (`AuthService`, `ModuleInterface`)
|
|
21
|
+
- **Methods**: `camelCase` (`validateSession()`, `getUserById()`)
|
|
22
|
+
- **Constants**: `UPPER_SNAKE_CASE` (`DEFAULT_TIMEOUT`, `MAX_RETRIES`)
|
|
23
|
+
- **Variables / Properties**: `camelCase` (`$userId`, `$databaseConnection`)
|
|
24
|
+
|
|
25
|
+
### TypeScript & JavaScript (ESM)
|
|
26
|
+
- **Files & Modules**: `kebab-case.ts` (`auth-service.ts`) or `PascalCase.tsx` for React components (`UserProfile.tsx`)
|
|
27
|
+
- **Types / Interfaces / Enums**: `PascalCase` (`UserSession`, `ApiResponse<T>`, `LogLevel`)
|
|
28
|
+
- **Functions / Methods**: `camelCase` (`parseManifest()`, `fetchUserData()`)
|
|
29
|
+
- **Constants**: `UPPER_SNAKE_CASE` (`API_BASE_URL`, `TOKEN_EXPIRATION`)
|
|
30
|
+
|
|
31
|
+
### Python (PEP 8)
|
|
32
|
+
- **Modules / Packages**: `snake_case` (`audit_docs.py`, `clean_orphaned_assets.py`)
|
|
33
|
+
- **Classes**: `PascalCase` (`DocumentationAuditor`, `MarkdownLinkScanner`)
|
|
34
|
+
- **Functions / Methods**: `snake_case` (`scan_file()`, `check_relative_links()`)
|
|
35
|
+
- **Constants**: `UPPER_SNAKE_CASE` (`SENSITIVE_PATTERNS`, `DEFAULT_SCORE`)
|
|
36
|
+
|
|
37
|
+
## 3. REST API & Route Conventions
|
|
38
|
+
|
|
39
|
+
- **Resource URIs**: Lowercase `kebab-case` plural nouns (`/api/v1/user-profiles`, `/api/v1/projects`).
|
|
40
|
+
- **Query Parameters**: `snake_case` or `camelCase` (must be uniform per project, e.g. `page_size` or `pageSize`).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!-- last-verified: 2026-09-09 -->
|
|
2
|
+
# Memory: project-mindmap
|
|
3
|
+
|
|
4
|
+
Codified guidelines and Mermaid AST templates for generating clear, interactive architectural mind maps and component topology diagrams in documentation.
|
|
5
|
+
|
|
6
|
+
## 1. Top-Level Architectural Layering (Mermaid C4 / Graph)
|
|
7
|
+
|
|
8
|
+
```mermaid
|
|
9
|
+
graph TD
|
|
10
|
+
Client["Client Layer (Browser / Agents)"]
|
|
11
|
+
Gateway["API & Router Layer"]
|
|
12
|
+
Core["Core Domain & Business Logic"]
|
|
13
|
+
Storage["Data Layer (SQLite / MySQL / Files)"]
|
|
14
|
+
|
|
15
|
+
Client -->|HTTP / JSON-RPC| Gateway
|
|
16
|
+
Gateway --> Core
|
|
17
|
+
Core --> Storage
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 2. Component Topology & Responsibility Mind Map
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
mindmap
|
|
24
|
+
root((System Architecture))
|
|
25
|
+
Presentation Layer
|
|
26
|
+
VitePress SSG
|
|
27
|
+
Docsify SPA
|
|
28
|
+
MkDocs Material
|
|
29
|
+
Core Logic
|
|
30
|
+
Command Dispatcher
|
|
31
|
+
Workflow Engine
|
|
32
|
+
Operational Memory
|
|
33
|
+
Execution Tooling
|
|
34
|
+
Link Integrity Auditor
|
|
35
|
+
AST Docblock Parser
|
|
36
|
+
Asset Hygiene Cleaner
|
|
37
|
+
Data & Context
|
|
38
|
+
Single Source of Truth
|
|
39
|
+
Brain Context Layer
|
|
40
|
+
Local File Snapshots
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 3. Data Flow & Execution Sequence Diagram
|
|
44
|
+
|
|
45
|
+
```mermaid
|
|
46
|
+
sequenceDiagram
|
|
47
|
+
autonumber
|
|
48
|
+
actor Dev as Developer / Agent
|
|
49
|
+
participant Dispatcher as SKILL.md Dispatcher
|
|
50
|
+
participant Workflow as Workflow Engine
|
|
51
|
+
participant Collector as Codebase Collector
|
|
52
|
+
participant Target as /docs Surface
|
|
53
|
+
|
|
54
|
+
Dev->>Dispatcher: Issue Command (brief / collect / generate)
|
|
55
|
+
Dispatcher->>Workflow: Load Matching Workflow & Memory
|
|
56
|
+
Workflow->>Collector: Scrape Signatures & Env Context
|
|
57
|
+
Collector-->>Workflow: Return 5-Dimension Findings
|
|
58
|
+
Workflow->>Target: Write Clean Markdown Artifacts
|
|
59
|
+
Workflow->>Dev: Emit Success Checklist & Audit Score
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 4. Usage Guidelines
|
|
63
|
+
|
|
64
|
+
1. Place overarching mind maps in `docs/README.md` or `docs/guides/architecture.md`.
|
|
65
|
+
2. Do not use raw image screenshots when Mermaid diagrams can represent topology directly in text.
|
|
66
|
+
3. Keep node labels concise (≤ 4 words) to maintain high readability across mobile and desktop viewports.
|
|
@@ -1,54 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- last-verified: 2026-09-09 -->
|
|
2
|
+
# Memory: Site Engines (VitePress vs. MkDocs Material vs. Docsify)
|
|
2
3
|
|
|
3
4
|
Technical evaluation matrix for documentation publishing engines supported by `tidyfactor-doc`.
|
|
4
5
|
|
|
5
6
|
## Engine Comparison Matrix
|
|
6
7
|
|
|
7
|
-
| Capability / Factor | ⚡ MkDocs Material (Static
|
|
8
|
-
|
|
9
|
-
| **Architecture** | Static Site Generator (Python Markdown) | Client-Side SPA (`marked.js`
|
|
10
|
-
| **Output Type** | Pre-rendered static HTML (`site/`) | Single `index.html` fetching `.md`
|
|
11
|
-
| **Build Dependency** | Python 3.10+, `pip install mkdocs-material` | Zero build step, zero compiler
|
|
12
|
-
| **SEO & Crawlers** | 100/100 Perfect static HTML indexing | Limited (requires JS execution
|
|
13
|
-
| **Performance & CWV** | Instant
|
|
14
|
-
| **i18n & Localization** | Native
|
|
15
|
-
| **Search Engine** | Lunr.js pre-indexed offline search
|
|
16
|
-
| **Styling & Theming** | Material
|
|
17
|
-
| **Code Highlighting** |
|
|
18
|
-
| **Target Deployment** |
|
|
8
|
+
| Capability / Factor | ⚡ VitePress (Vue 3 / Vite SSG) | 📦 MkDocs Material (Python Static) | 📄 Docsify (Client SPA) |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| **Architecture** | Static Site Generator (Vite + Vue 3 SSR) | Static Site Generator (Python Markdown) | Client-Side SPA (`marked.js`) |
|
|
11
|
+
| **Output Type** | Pre-rendered static HTML (`dist/`) + Vue hydration | Pre-rendered static HTML (`site/`) | Single `index.html` fetching `.md` |
|
|
12
|
+
| **Build Dependency** | Node.js >= 18, `npm i -D vitepress` | Python 3.10+, `pip install mkdocs-material` | Zero build step, zero compiler |
|
|
13
|
+
| **SEO & Crawlers** | 100/100 Perfect static HTML indexing | 100/100 Perfect static HTML indexing | Limited (requires bot JS execution) |
|
|
14
|
+
| **Performance & CWV** | Instant Vite dev server, sub-second HMR | High compilation speed, pre-cached assets | Client-side fetch delay on slow mobile |
|
|
15
|
+
| **i18n & Localization** | Native subdirectory routing (`/`, `/en/`, `/es/`) | Parallel builds via `mkdocs-static-i18n` | Single language or manual SPAs |
|
|
16
|
+
| **Search Engine** | Minisearch pre-indexed local search | Lunr.js pre-indexed offline search | In-browser client-side fuzzy search |
|
|
17
|
+
| **Styling & Theming** | Custom CSS tokens, Vue components, Luxury RTL | Material theme + Neo-Brutalist tokens | Custom CSS over Docsify default |
|
|
18
|
+
| **Code Highlighting** | Shiki build-time syntax highlighting | Pygments build-time syntax highlighting | Prism.js client-side syntax |
|
|
19
|
+
| **Target Deployment** | Modern JS/TS repos, SaaS portals, luxury RTL | Python/Backend repos, enterprise wikis | Internal quick prototyping, single guides |
|
|
19
20
|
|
|
20
21
|
---
|
|
21
22
|
|
|
22
23
|
## Decision Logic & Recommendation Rules
|
|
23
24
|
|
|
24
|
-
1. **Choose
|
|
25
|
-
- The
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- Production hosting supports static directory routing (`public_html/documentation/`).
|
|
25
|
+
1. **Choose VitePress if (Recommended for Modern Web / Monorepos):**
|
|
26
|
+
- The project is in the Node.js / TypeScript / Frontend ecosystem.
|
|
27
|
+
- Requires custom interactive Vue components, modern UI aesthetics, or luxury typography (`Alexandria` + `Cairo` + `JetBrains Mono`).
|
|
28
|
+
- Needs seamless multi-language subdirectory routing with zero 404s.
|
|
29
|
+
- Developer desires sub-second Vite HMR during drafting.
|
|
30
30
|
|
|
31
|
-
2. **Choose
|
|
32
|
-
- The
|
|
33
|
-
- The
|
|
34
|
-
- The documentation
|
|
35
|
-
- The site is hosted on GitHub Pages with zero CI build workflows.
|
|
36
|
-
|
|
37
|
-
---
|
|
31
|
+
2. **Choose MkDocs Material if:**
|
|
32
|
+
- The project is Python-centric or backend-heavy.
|
|
33
|
+
- The team is already using Python toolchains (`pip`, `virtualenv`).
|
|
34
|
+
- The documentation requires MkDocs-specific plugin ecosystems.
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
- **Localized Adoption Guides**: Quickstarts, tutorials, concepts, and command matrices for Tier 1/2 growth languages (`es`, `pt`, `fa`, `zh`, `de`, `fr`) providing high-conversion onboarding.
|
|
36
|
+
3. **Choose Docsify if:**
|
|
37
|
+
- The developer environment has neither Node.js nor Python build workflows.
|
|
38
|
+
- The project needs an instant browsable site by dropping a single `index.html` into `/docs`.
|
|
39
|
+
- The documentation is strictly internal within a small Git repository.
|
|
44
40
|
|
|
45
41
|
---
|
|
46
42
|
|
|
47
43
|
## Toolchain Verification Command
|
|
48
44
|
|
|
49
45
|
```bash
|
|
50
|
-
# Check
|
|
46
|
+
# Check available runtimes
|
|
47
|
+
node --version 2>&1
|
|
51
48
|
python --version 2>&1 || python3 --version 2>&1
|
|
52
49
|
```
|
|
53
|
-
- If
|
|
54
|
-
- If Python is
|
|
50
|
+
- If Node.js is available: recommend **VitePress** as primary luxury web documentation portal.
|
|
51
|
+
- If Python is available without Node.js: recommend **MkDocs Material**.
|
|
52
|
+
- If no build runtime is available: recommend **Docsify** zero-dependency fallback.
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
# Memory: stacks/js-ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
# Memory: stacks/js-ts
|
|
2
|
+
|
|
3
|
+
<!-- last-verified: 2026-09-08 -->
|
|
4
|
+
|
|
5
|
+
Documentation conventions for JavaScript and TypeScript targets. Applies whenever the target's manifest is `package.json` and files are `.js`/`.mjs` (JS) or `.ts`/`.tsx` (TS). The two share JSDoc-style block syntax but differ in what needs restating.
|
|
6
|
+
|
|
7
|
+
## JavaScript — JSDoc (types belong in the comment, since the code itself is untyped)
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
/**
|
|
11
|
+
* <one-line summary>
|
|
12
|
+
*
|
|
13
|
+
* @param {string} name Description.
|
|
14
|
+
* @param {number} [limit] Optional, defaults to undefined.
|
|
15
|
+
* @returns {Promise<object>} Description of the resolved shape.
|
|
16
|
+
* @throws {RangeError} When <condition, from error-patterns findings>.
|
|
17
|
+
*/
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- Always include `@param`/`@returns` types — JS has no compile-time types, so the comment is the only source of truth.
|
|
21
|
+
- Optional params use `[name]` bracket syntax.
|
|
22
|
+
|
|
23
|
+
## TypeScript — TSDoc (types live in the signature, don't restate them in the comment)
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
/**
|
|
27
|
+
* <one-line summary>
|
|
28
|
+
*
|
|
29
|
+
* @param name - Description only, no type (already in the signature).
|
|
30
|
+
* @param limit - Description only.
|
|
31
|
+
* @returns Description only.
|
|
32
|
+
* @throws {RangeError} When <condition, from error-patterns findings>.
|
|
33
|
+
*/
|
|
34
|
+
function example(name: string, limit?: number): Promise<Result> { ... }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- Do NOT restate types already visible in the TS signature (`{string}`, `{number}`) — that's a JSDoc habit that's redundant and can drift out of sync in TS. Description only after the `-`.
|
|
38
|
+
- Exported `interface`/`type` declarations get their own TSDoc block above the declaration, one line per member if the member itself isn't self-explanatory.
|
|
39
|
+
|
|
40
|
+
## API reference formatting
|
|
41
|
+
|
|
42
|
+
- Show the actual signature from the source (JS: as written; TS: full typed signature).
|
|
43
|
+
- For TS, prefer documenting the public exported types directly rather than re-describing them in prose.
|
|
44
|
+
|
|
45
|
+
## What NOT to document inline
|
|
46
|
+
|
|
47
|
+
- Non-exported (module-private) helper functions with obvious names: skip full blocks unless the error-patterns findings show them as a common failure point.
|