@tidyfactor/doc 1.3.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 +16 -0
- package/AGENTS.md +10 -0
- package/CHANGELOG.md +75 -0
- package/LICENSE +17 -0
- package/README.ar.md +180 -0
- package/README.de.md +44 -0
- package/README.es.md +44 -0
- package/README.fa.md +44 -0
- package/README.fr.md +44 -0
- package/README.md +198 -0
- package/README.pt.md +44 -0
- package/README.zh.md +44 -0
- package/SKILL.md +36 -0
- package/assets/hero-banner.png +0 -0
- package/assets/og-default.png +0 -0
- package/bin/add-skill.js +27 -0
- package/brand.json +13 -0
- package/package.json +59 -0
- package/references/commands/collect.md +15 -0
- package/references/commands/docsify.md +15 -0
- package/references/commands/generate.md +23 -0
- package/references/commands/init.md +15 -0
- package/references/commands/mkdocs.md +15 -0
- package/references/commands/site.md +23 -0
- package/references/memory/collection-sources.md +47 -0
- package/references/memory/doc-templates.md +73 -0
- package/references/memory/doc-tree.md +37 -0
- package/references/memory/docsify-config.md +273 -0
- package/references/memory/mkdocs-config.md +170 -0
- package/references/memory/site-engines.md +54 -0
- package/references/memory/stacks/js-ts.md +45 -0
- package/references/memory/stacks/php.md +33 -0
- package/references/memory/stacks/react-vue-next.md +50 -0
- package/references/workflows/collect.md +25 -0
- package/references/workflows/docsify.md +19 -0
- package/references/workflows/generate-api.md +21 -0
- package/references/workflows/generate-guide.md +20 -0
- package/references/workflows/generate-inline.md +20 -0
- package/references/workflows/generate-readme.md +20 -0
- package/references/workflows/init-docs.md +18 -0
- package/references/workflows/mkdocs.md +44 -0
- package/tools/build-skill.js +152 -0
- package/tools/validate_skill.py +124 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Memory: doc-templates
|
|
2
|
+
|
|
3
|
+
Shapes for each doc type `generate` produces. Templates, not prose — fill in from `collect` findings.
|
|
4
|
+
|
|
5
|
+
## API reference (`docs/api/<target>.md`)
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# <Target> API Reference
|
|
9
|
+
|
|
10
|
+
<one-line purpose, from code parsing findings>
|
|
11
|
+
|
|
12
|
+
## <FunctionOrMethodName>
|
|
13
|
+
|
|
14
|
+
<signature, stack-formatted per the matching stacks/*.md file>
|
|
15
|
+
|
|
16
|
+
**Parameters**
|
|
17
|
+
| Name | Type | Required | Description |
|
|
18
|
+
|---|---|---|---|
|
|
19
|
+
|
|
20
|
+
**Returns**: <type> — <description>
|
|
21
|
+
|
|
22
|
+
**Throws / Errors**: <from error-patterns findings>
|
|
23
|
+
|
|
24
|
+
**Example**
|
|
25
|
+
<minimal usage example>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
<!-- repeat per public function/method/endpoint/component -->
|
|
29
|
+
|
|
30
|
+
## See also
|
|
31
|
+
<cross-links to related target docs, if any>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## README (project root `README.md`)
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
# <Project Name>
|
|
38
|
+
|
|
39
|
+
<one-line description>
|
|
40
|
+
|
|
41
|
+
## Requirements
|
|
42
|
+
<software dependencies + version constraints, from runtime & environment findings>
|
|
43
|
+
|
|
44
|
+
## Setup
|
|
45
|
+
<install steps, from runtime & environment findings>
|
|
46
|
+
|
|
47
|
+
## Environment variables
|
|
48
|
+
| Variable | Required | Default | Description | Example |
|
|
49
|
+
|---|---|---|---|---|
|
|
50
|
+
| `API_KEY` | Yes | — | Secret authentication token | `EXAMPLE_TOKEN_1234567890ABCDEFGH` |
|
|
51
|
+
| `DB_HOST` | Yes | `localhost` | Database host IP or hostname | `203.0.113.10` |
|
|
52
|
+
| `DB_PASS` | Yes | — | Database user password | `your_secret_password` |
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
<minimal example>
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
Full reference: [`/docs`](./docs/README.md)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Guide (`docs/guides/<purpose-slug>.md`)
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
# <Guide Title>
|
|
65
|
+
|
|
66
|
+
<one-line: what this guide covers and who it's for, from persona-tracing findings>
|
|
67
|
+
|
|
68
|
+
## <Section per logical step or concept>
|
|
69
|
+
<content, prioritized for the target persona>
|
|
70
|
+
|
|
71
|
+
## Related
|
|
72
|
+
<links to other guides or API docs using relative paths, e.g. [API Overview](../api/project.md)>
|
|
73
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Memory: doc-tree
|
|
2
|
+
|
|
3
|
+
Canonical `/docs` folder shape and the manifest schema. Every command reads this before touching `/docs` so the structure stays identical across projects.
|
|
4
|
+
|
|
5
|
+
## Folder shape
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
docs/
|
|
9
|
+
├── README.md # doc-site landing page (generated by init)
|
|
10
|
+
├── .doc-manifest.json # tracking file (generated by init, updated by collect/generate)
|
|
11
|
+
├── .collected/ # raw findings from `collect`, one file per target — not site content
|
|
12
|
+
│ └── <target>.md
|
|
13
|
+
├── api/ # one file per documented target — only if the project has an API surface
|
|
14
|
+
│ └── <target>.md
|
|
15
|
+
└── guides/ # one file per guide purpose — only once at least one guide exists
|
|
16
|
+
└── <purpose-slug>.md
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
No Empty Structures: `init` creates `api/` only if the stack detection found an API surface (endpoints, public package exports), and `guides/` is created lazily by the first `generate-guide` run, not by `init`. `.collected/` is created lazily by the first `collect` run.
|
|
20
|
+
|
|
21
|
+
## `.doc-manifest.json` schema
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"project": "<name from composer.json/package.json>",
|
|
26
|
+
"stacks": ["php" | "js" | "ts" | "react" | "vue" | "next", "..."],
|
|
27
|
+
"collected": {
|
|
28
|
+
"<target>": "<ISO timestamp of last collect run>"
|
|
29
|
+
},
|
|
30
|
+
"generated": {
|
|
31
|
+
"<path relative to project root>": "<ISO timestamp of last generate run>"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `collected` and `generated` are separate: a target can be collected without anything generated from it yet.
|
|
37
|
+
- `generated` entries aren't limited to `/docs` paths — `generate-readme` writes to root `README.md` and `generate-inline` touches source files, both still tracked here for audit purposes.
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Memory: docsify-config
|
|
2
|
+
|
|
3
|
+
Fixed Docsify setup used by the `docsify` workflow. Not a menu of options — locked, production-tested config for TidyFactor documentation web portals.
|
|
4
|
+
|
|
5
|
+
## `docs/index.html` Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<title><PROJECT_NAME> Documentation</title>
|
|
13
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
|
15
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap">
|
|
16
|
+
<style>
|
|
17
|
+
:root {
|
|
18
|
+
--theme-color: #0A2540;
|
|
19
|
+
--sidebar-width: 300px;
|
|
20
|
+
}
|
|
21
|
+
body {
|
|
22
|
+
font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
23
|
+
color: #1e293b;
|
|
24
|
+
background-color: #ffffff;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Header & Brand styling */
|
|
28
|
+
.app-name-link {
|
|
29
|
+
font-weight: 800 !important;
|
|
30
|
+
font-size: 1.25rem !important;
|
|
31
|
+
color: #0A2540 !important;
|
|
32
|
+
letter-spacing: -0.02em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Fixed Floating Sidebar Toggle Hamburger Button */
|
|
36
|
+
.sidebar-toggle {
|
|
37
|
+
position: fixed !important;
|
|
38
|
+
top: 14px !important;
|
|
39
|
+
left: 14px !important;
|
|
40
|
+
bottom: auto !important;
|
|
41
|
+
z-index: 1000 !important;
|
|
42
|
+
background: #0A2540 !important;
|
|
43
|
+
padding: 10px 12px !important;
|
|
44
|
+
border-radius: 8px !important;
|
|
45
|
+
box-shadow: 0 4px 12px rgba(10, 37, 64, 0.25) !important;
|
|
46
|
+
border: none !important;
|
|
47
|
+
cursor: pointer !important;
|
|
48
|
+
width: auto !important;
|
|
49
|
+
height: auto !important;
|
|
50
|
+
transition: transform 0.2s ease, background 0.2s ease !important;
|
|
51
|
+
}
|
|
52
|
+
.sidebar-toggle:hover {
|
|
53
|
+
background: #081C30 !important;
|
|
54
|
+
transform: scale(1.04);
|
|
55
|
+
}
|
|
56
|
+
.sidebar-toggle .sidebar-toggle-button {
|
|
57
|
+
display: flex !important;
|
|
58
|
+
flex-direction: column !important;
|
|
59
|
+
justify-content: center !important;
|
|
60
|
+
align-items: center !important;
|
|
61
|
+
gap: 4px !important;
|
|
62
|
+
background: transparent !important;
|
|
63
|
+
padding: 0 !important;
|
|
64
|
+
margin: 0 !important;
|
|
65
|
+
border: none !important;
|
|
66
|
+
width: auto !important;
|
|
67
|
+
height: auto !important;
|
|
68
|
+
}
|
|
69
|
+
.sidebar-toggle span {
|
|
70
|
+
display: block !important;
|
|
71
|
+
background-color: #ffffff !important;
|
|
72
|
+
height: 2px !important;
|
|
73
|
+
width: 20px !important;
|
|
74
|
+
margin: 0 !important;
|
|
75
|
+
border-radius: 2px !important;
|
|
76
|
+
float: none !important;
|
|
77
|
+
position: relative !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Sidebar Layout */
|
|
81
|
+
.sidebar {
|
|
82
|
+
padding-top: 60px !important;
|
|
83
|
+
padding-bottom: 40px !important;
|
|
84
|
+
background-color: #f8fafc !important;
|
|
85
|
+
border-right: 1px solid #e2e8f0 !important;
|
|
86
|
+
}
|
|
87
|
+
.sidebar ul li a {
|
|
88
|
+
font-weight: 500;
|
|
89
|
+
color: #475569;
|
|
90
|
+
transition: all 0.15s ease;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
}
|
|
93
|
+
.sidebar ul li a:hover {
|
|
94
|
+
color: #0A2540;
|
|
95
|
+
background-color: #e2e8f0/50;
|
|
96
|
+
}
|
|
97
|
+
.sidebar ul li.active > a {
|
|
98
|
+
color: #0A2540 !important;
|
|
99
|
+
font-weight: 700 !important;
|
|
100
|
+
border-left: 3px solid #0A2540;
|
|
101
|
+
padding-left: 8px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Content Styling & Typography */
|
|
105
|
+
.markdown-section {
|
|
106
|
+
max-width: 900px !important;
|
|
107
|
+
padding: 40px 45px !important;
|
|
108
|
+
}
|
|
109
|
+
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4 {
|
|
110
|
+
font-family: 'Inter', 'Cairo', sans-serif;
|
|
111
|
+
color: #0F172A;
|
|
112
|
+
font-weight: 700;
|
|
113
|
+
letter-spacing: -0.02em;
|
|
114
|
+
}
|
|
115
|
+
.markdown-section h1 {
|
|
116
|
+
border-bottom: 1px solid #e2e8f0;
|
|
117
|
+
padding-bottom: 12px;
|
|
118
|
+
font-size: 2.1rem;
|
|
119
|
+
}
|
|
120
|
+
.markdown-section h2 {
|
|
121
|
+
font-size: 1.5rem;
|
|
122
|
+
margin-top: 2rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Code Blocks */
|
|
126
|
+
.markdown-section pre {
|
|
127
|
+
border-radius: 8px !important;
|
|
128
|
+
background-color: #0f172a !important;
|
|
129
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
130
|
+
}
|
|
131
|
+
.markdown-section code {
|
|
132
|
+
font-family: 'Fira Code', monospace !important;
|
|
133
|
+
font-size: 0.9em;
|
|
134
|
+
}
|
|
135
|
+
.markdown-section p code {
|
|
136
|
+
background-color: #f1f5f9 !important;
|
|
137
|
+
color: #0f172a !important;
|
|
138
|
+
padding: 3px 6px !important;
|
|
139
|
+
border-radius: 4px !important;
|
|
140
|
+
border: 1px solid #cbd5e1 !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Table Styling */
|
|
144
|
+
.markdown-section table {
|
|
145
|
+
display: table !important;
|
|
146
|
+
width: 100% !important;
|
|
147
|
+
border-collapse: collapse !important;
|
|
148
|
+
border: 1px solid #e2e8f0 !important;
|
|
149
|
+
border-radius: 6px !important;
|
|
150
|
+
overflow: hidden !important;
|
|
151
|
+
margin: 20px 0 !important;
|
|
152
|
+
}
|
|
153
|
+
.markdown-section th {
|
|
154
|
+
background-color: #f8fafc !important;
|
|
155
|
+
color: #0f172a !important;
|
|
156
|
+
font-weight: 700 !important;
|
|
157
|
+
border-bottom: 2px solid #e2e8f0 !important;
|
|
158
|
+
padding: 10px 14px !important;
|
|
159
|
+
}
|
|
160
|
+
.markdown-section td {
|
|
161
|
+
border-bottom: 1px solid #e2e8f0 !important;
|
|
162
|
+
padding: 10px 14px !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Scrollbars */
|
|
166
|
+
::-webkit-scrollbar {
|
|
167
|
+
width: 8px;
|
|
168
|
+
height: 8px;
|
|
169
|
+
}
|
|
170
|
+
::-webkit-scrollbar-track {
|
|
171
|
+
background: #f1f5f9;
|
|
172
|
+
}
|
|
173
|
+
::-webkit-scrollbar-thumb {
|
|
174
|
+
background: #cbd5e1;
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
}
|
|
177
|
+
::-webkit-scrollbar-thumb:hover {
|
|
178
|
+
background: #94a3b8;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
181
|
+
</head>
|
|
182
|
+
<body>
|
|
183
|
+
<div id="app"></div>
|
|
184
|
+
<script>
|
|
185
|
+
window.$docsify = {
|
|
186
|
+
name: '<PROJECT_NAME>',
|
|
187
|
+
repo: '<REPO_URL>',
|
|
188
|
+
loadSidebar: true,
|
|
189
|
+
alias: {
|
|
190
|
+
'/.*/_sidebar.md': '/_sidebar.md'
|
|
191
|
+
},
|
|
192
|
+
subMaxLevel: 2,
|
|
193
|
+
auto2top: true,
|
|
194
|
+
search: {
|
|
195
|
+
placeholder: 'Search documentation...',
|
|
196
|
+
noData: 'No results found',
|
|
197
|
+
depth: 3
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
</script>
|
|
201
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
202
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
|
203
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code@2"></script>
|
|
204
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
|
|
205
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-php.min.js"></script>
|
|
206
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-typescript.min.js"></script>
|
|
207
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-json.min.js"></script>
|
|
208
|
+
</body>
|
|
209
|
+
</html>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Replace `<PROJECT_NAME>` from `docs/.doc-manifest.json`'s `project` field, and `<REPO_URL>` with project repository or developer link (`https://github.com/alwkala/TidyFactor-Go`).
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Critical Rules & Lessons Learned
|
|
217
|
+
|
|
218
|
+
### 1. Subfolder Navigation Sidebar Alias
|
|
219
|
+
- **CRITICAL**: Always configure `alias: { '/.*/_sidebar.md': '/_sidebar.md' }` in `window.$docsify`. Without this alias, opening subfolder guides (e.g. `/#/guides/architecture-and-setup`) causes Docsify to look for `guides/_sidebar.md` and hide the sidebar menu!
|
|
220
|
+
- **CRITICAL**: Use leading slashes `/` for all links in `_sidebar.md` (`/guides/admin-user-guide.md`, `/api/project.md`) so links resolve relative to the `/docs` root from any route depth.
|
|
221
|
+
|
|
222
|
+
### 2. Localized Pages Inside Docs Root
|
|
223
|
+
- **CRITICAL**: Docsify web root is `/docs`. Never link out of `/docs` using relative `../` paths (e.g. `../README.ar.md`), as Docsify SPA routing will throw `404 - Not Found`.
|
|
224
|
+
- Always place localized landing pages inside `/docs` (e.g. `docs/README.ar.md`), rendering smoothly at `/#/README.ar.md`.
|
|
225
|
+
|
|
226
|
+
### 3. Hamburger Toggle Button (`.sidebar-toggle`) Styling
|
|
227
|
+
- Always style `.sidebar-toggle` and `.sidebar-toggle-button` with fixed positioning (`top: 14px; left: 14px; z-index: 1000`) and explicit `<span>` lines (`width: 20px; height: 2px; display: block`) so the hamburger button remains accessible without collapsing or overlapping sidebar text items.
|
|
228
|
+
|
|
229
|
+
### 4. Cross-Platform Emojis & Typography
|
|
230
|
+
- Country flag emojis (`🇸🇦`, `🇺🇸`) render as 2-letter codes (`SA`, `US`) on Windows Chrome/Edge. Use clean text badges (`[عربي]`, `[EN]`) in `_sidebar.md`.
|
|
231
|
+
- Always load Google Fonts (`Cairo` for Arabic RTL, `Inter` for English LTR, `Fira Code` for code blocks) in `docs/index.html`.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## `_sidebar.md` Generation Rule
|
|
236
|
+
|
|
237
|
+
Group by audience/purpose, root docs first, using leading slashes `/`:
|
|
238
|
+
|
|
239
|
+
```markdown
|
|
240
|
+
- 🌐 [Overview / النظرة العامة](/README.md)
|
|
241
|
+
- 📖 [المقدمة بالعربية](/README.ar.md)
|
|
242
|
+
- 💡 [رؤية المنظومة والشركة](/guides/vision-and-ecosystem.md)
|
|
243
|
+
|
|
244
|
+
- [عربي] أدلة المستخدم (User Guides - AR)
|
|
245
|
+
- [دليل مالك الموقع (Admin User Guide)](/guides/admin-user-guide.md)
|
|
246
|
+
- [دليل تحرير المحتوى (Editing Pages Content)](/guides/pages-editing-guide.md)
|
|
247
|
+
|
|
248
|
+
- [EN] Developer & Technical Guides
|
|
249
|
+
- [Quick Start Guide](/guides/quick-start.md)
|
|
250
|
+
- [Platform & System Specifications](/guides/system-specifications.md)
|
|
251
|
+
- [AI Coding & Agent Workflows](/guides/ai-agent-workflows.md)
|
|
252
|
+
- [Content Engine Architecture & API](/guides/content-engine.md)
|
|
253
|
+
- [Architecture & Setup Guide](/guides/architecture-and-setup.md)
|
|
254
|
+
- [Database & Storage Architecture](/guides/database-and-storage.md)
|
|
255
|
+
- [Security & System Hardening](/guides/security-and-hardening.md)
|
|
256
|
+
- [Production Deployment & Hosting](/guides/deployment-and-hosting.md)
|
|
257
|
+
- [CMS Content Engine & Backups](/guides/cms-content-engine-and-backups.md)
|
|
258
|
+
|
|
259
|
+
- 📚 REST API Reference
|
|
260
|
+
- [API Endpoints Specifications](/api/project.md)
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
- 👨💻 Developed by [Alwkala](https://github.com/alwkala)
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Regenerate the whole file each run so it never drifts from what's actually in `/docs`.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Preview
|
|
272
|
+
|
|
273
|
+
Local static server: `php -S localhost:3001 -t docs` or `npx docsify-cli serve docs`.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Memory: MkDocs Material Configuration Spec
|
|
2
|
+
|
|
3
|
+
Complete architectural specification for scaffolding and compiling production-grade documentation portals with MkDocs Material.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Package Requirements (`requirements.txt`)
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
mkdocs-material>=9.5
|
|
11
|
+
mkdocs-static-i18n>=1.2
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Master Configuration Schema (`mkdocs.yml`)
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
site_name: Project Documentation
|
|
20
|
+
site_url: https://example.com/docs/
|
|
21
|
+
site_description: "Production Documentation Portal"
|
|
22
|
+
site_author: Engineering Team
|
|
23
|
+
|
|
24
|
+
docs_dir: docs
|
|
25
|
+
site_dir: site
|
|
26
|
+
|
|
27
|
+
theme:
|
|
28
|
+
name: material
|
|
29
|
+
language: en
|
|
30
|
+
direction: ltr
|
|
31
|
+
custom_dir: overrides
|
|
32
|
+
|
|
33
|
+
logo: assets/logo.png
|
|
34
|
+
favicon: assets/favicon.png
|
|
35
|
+
|
|
36
|
+
font:
|
|
37
|
+
text: Plus Jakarta Sans
|
|
38
|
+
code: Fira Code
|
|
39
|
+
|
|
40
|
+
palette:
|
|
41
|
+
# Light Mode
|
|
42
|
+
- media: "(prefers-color-scheme: light)"
|
|
43
|
+
scheme: tidyfactor-light
|
|
44
|
+
primary: custom
|
|
45
|
+
accent: custom
|
|
46
|
+
toggle:
|
|
47
|
+
icon: material/brightness-7
|
|
48
|
+
name: Switch to Dark Mode
|
|
49
|
+
|
|
50
|
+
# Dark Mode
|
|
51
|
+
- media: "(prefers-color-scheme: dark)"
|
|
52
|
+
scheme: tidyfactor-dark
|
|
53
|
+
primary: custom
|
|
54
|
+
accent: custom
|
|
55
|
+
toggle:
|
|
56
|
+
icon: material/brightness-4
|
|
57
|
+
name: Switch to Light Mode
|
|
58
|
+
|
|
59
|
+
features:
|
|
60
|
+
- navigation.tracking
|
|
61
|
+
- navigation.tabs
|
|
62
|
+
- navigation.tabs.sticky
|
|
63
|
+
- navigation.sections
|
|
64
|
+
- navigation.expand
|
|
65
|
+
- navigation.path
|
|
66
|
+
- navigation.top
|
|
67
|
+
- navigation.indexes
|
|
68
|
+
- navigation.footer
|
|
69
|
+
- search.suggest
|
|
70
|
+
- search.highlight
|
|
71
|
+
- search.share
|
|
72
|
+
- content.code.copy
|
|
73
|
+
- content.code.annotate
|
|
74
|
+
- content.tabs.link
|
|
75
|
+
- header.autohide
|
|
76
|
+
- toc.follow
|
|
77
|
+
|
|
78
|
+
plugins:
|
|
79
|
+
- search:
|
|
80
|
+
separator: '[\s\-\.]+'
|
|
81
|
+
lang:
|
|
82
|
+
- en
|
|
83
|
+
- ar
|
|
84
|
+
|
|
85
|
+
- i18n:
|
|
86
|
+
docs_structure: suffix
|
|
87
|
+
languages:
|
|
88
|
+
- locale: en
|
|
89
|
+
name: English
|
|
90
|
+
default: true
|
|
91
|
+
build: true
|
|
92
|
+
- locale: ar
|
|
93
|
+
name: العربية
|
|
94
|
+
build: true
|
|
95
|
+
theme:
|
|
96
|
+
language: ar
|
|
97
|
+
direction: rtl
|
|
98
|
+
font:
|
|
99
|
+
text: Tajawal
|
|
100
|
+
code: Fira Code
|
|
101
|
+
|
|
102
|
+
markdown_extensions:
|
|
103
|
+
- abbr
|
|
104
|
+
- admonition
|
|
105
|
+
- attr_list
|
|
106
|
+
- def_list
|
|
107
|
+
- footnotes
|
|
108
|
+
- md_in_html
|
|
109
|
+
- tables
|
|
110
|
+
- toc:
|
|
111
|
+
permalink: true
|
|
112
|
+
toc_depth: 3
|
|
113
|
+
- pymdownx.arithmatex:
|
|
114
|
+
generic: true
|
|
115
|
+
- pymdownx.betterem:
|
|
116
|
+
smart_enable: all
|
|
117
|
+
- pymdownx.caret
|
|
118
|
+
- pymdownx.details
|
|
119
|
+
- pymdownx.emoji:
|
|
120
|
+
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
|
121
|
+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
|
122
|
+
- pymdownx.highlight:
|
|
123
|
+
anchor_linenums: true
|
|
124
|
+
line_spans: __span
|
|
125
|
+
pygments_lang_class: true
|
|
126
|
+
- pymdownx.inlinehilite
|
|
127
|
+
- pymdownx.keys
|
|
128
|
+
- pymdownx.mark
|
|
129
|
+
- pymdownx.smartsymbols
|
|
130
|
+
- pymdownx.superfences:
|
|
131
|
+
custom_fences:
|
|
132
|
+
- name: mermaid
|
|
133
|
+
class: mermaid
|
|
134
|
+
format: !!python/name:pymdownx.superfences.fence_code_format
|
|
135
|
+
- pymdownx.tabbed:
|
|
136
|
+
alternate_style: true
|
|
137
|
+
- pymdownx.tasklist:
|
|
138
|
+
custom_checkbox: true
|
|
139
|
+
- pymdownx.tilde
|
|
140
|
+
|
|
141
|
+
extra_css:
|
|
142
|
+
- stylesheets/extra.css
|
|
143
|
+
|
|
144
|
+
extra_javascript:
|
|
145
|
+
- javascripts/extra.js
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 3. Bilingual Suffix Rule (i18n)
|
|
151
|
+
|
|
152
|
+
- English source files: `docs/guides/architecture.md`, `docs/index.md`
|
|
153
|
+
- Arabic source files: `docs/guides/architecture.ar.md`, `docs/index.ar.md`
|
|
154
|
+
- Rule: Never link directly to `.ar.md` from `.md` files; the `i18n` plugin handles language linking automatically via the header switcher.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 4. Local Apache Subfolder Routing (`.htaccess`)
|
|
159
|
+
|
|
160
|
+
When hosting the documentation inside a subfolder during local Apache/WAMP development:
|
|
161
|
+
|
|
162
|
+
```apache
|
|
163
|
+
<IfModule mod_rewrite.c>
|
|
164
|
+
RewriteEngine On
|
|
165
|
+
RewriteRule ^site(/.*)?$ - [L]
|
|
166
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
167
|
+
RewriteRule ^(.*)$ site/$1 [L]
|
|
168
|
+
</IfModule>
|
|
169
|
+
```
|
|
170
|
+
In production: upload the contents of `site/` directly into `public_html/docs/`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Memory: Site Engines (Docsify vs. MkDocs Material)
|
|
2
|
+
|
|
3
|
+
Technical evaluation matrix for documentation publishing engines supported by `tidyfactor-doc`.
|
|
4
|
+
|
|
5
|
+
## Engine Comparison Matrix
|
|
6
|
+
|
|
7
|
+
| Capability / Factor | ⚡ MkDocs Material (Static Compiler) | 📄 Docsify (Client-Side SPA) |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| **Architecture** | Static Site Generator (Python Markdown) | Client-Side SPA (`marked.js` in browser) |
|
|
10
|
+
| **Output Type** | Pre-rendered static HTML (`site/`) | Single `index.html` fetching `.md` via AJAX |
|
|
11
|
+
| **Build Dependency** | Python 3.10+, `pip install mkdocs-material` | Zero build step, zero compiler required |
|
|
12
|
+
| **SEO & Crawlers** | 100/100 Perfect static HTML indexing | Limited (requires JS execution by bots) |
|
|
13
|
+
| **Performance & CWV** | Instant initial paint, pre-cached assets | Client-side fetch delay on slow mobile networks |
|
|
14
|
+
| **i18n & Localization** | Native parallel builds (`/` and `/ar/`) via `mkdocs-static-i18n` | Single page language or manual separate SPAs |
|
|
15
|
+
| **Search Engine** | Lunr.js pre-indexed offline search (bilingual) | In-browser client-side fuzzy search |
|
|
16
|
+
| **Styling & Theming** | Material for MkDocs + Neo-Brutalist CSS tokens | Custom CSS over Docsify default theme |
|
|
17
|
+
| **Code Highlighting** | Pygments build-time syntax highlighting + line spans | Prism.js client-side syntax highlighting |
|
|
18
|
+
| **Target Deployment** | Production doc portals, public SaaS products, multi-language sites | Rapid internal repo docs, single-file lightweight guides |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Decision Logic & Recommendation Rules
|
|
23
|
+
|
|
24
|
+
1. **Choose MkDocs Material if:**
|
|
25
|
+
- The documentation has more than 10 pages or complex multi-level hierarchy.
|
|
26
|
+
- Public SEO visibility and search engine discoverability are critical.
|
|
27
|
+
- The project is bilingual (Arabic RTL + English LTR) requiring dedicated language switches.
|
|
28
|
+
- The local environment has Python installed (`python --version` returns 3.10+).
|
|
29
|
+
- Production hosting supports static directory routing (`public_html/documentation/`).
|
|
30
|
+
|
|
31
|
+
2. **Choose Docsify if:**
|
|
32
|
+
- The developer or server environment has **no Python runtime** and requires zero installation.
|
|
33
|
+
- The project needs an instant browsable site by dropping a single `index.html` into `/docs`.
|
|
34
|
+
- The documentation is primarily for internal developers within a repository.
|
|
35
|
+
- The site is hosted on GitHub Pages with zero CI build workflows.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Two-Tier Multi-Language Documentation Pattern
|
|
40
|
+
|
|
41
|
+
Both engines adhere to the TidyFactor Two-Tier Documentation standard:
|
|
42
|
+
- **Canonical Technical SSOT**: Full API specifications, architecture, and code deep-dives maintained in Canonical English (`/docs/en/` or root) with First-Class Arabic (`/docs/ar/`).
|
|
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.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Toolchain Verification Command
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Check if Python is available for MkDocs
|
|
51
|
+
python --version 2>&1 || python3 --version 2>&1
|
|
52
|
+
```
|
|
53
|
+
- If Python is available: recommend **MkDocs Material** as primary production track.
|
|
54
|
+
- If Python is not available: recommend **Docsify** as zero-dependency fallback.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Memory: stacks/js-ts
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## JavaScript — JSDoc (types belong in the comment, since the code itself is untyped)
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
/**
|
|
9
|
+
* <one-line summary>
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name Description.
|
|
12
|
+
* @param {number} [limit] Optional, defaults to undefined.
|
|
13
|
+
* @returns {Promise<object>} Description of the resolved shape.
|
|
14
|
+
* @throws {RangeError} When <condition, from error-patterns findings>.
|
|
15
|
+
*/
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Always include `@param`/`@returns` types — JS has no compile-time types, so the comment is the only source of truth.
|
|
19
|
+
- Optional params use `[name]` bracket syntax.
|
|
20
|
+
|
|
21
|
+
## TypeScript — TSDoc (types live in the signature, don't restate them in the comment)
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
/**
|
|
25
|
+
* <one-line summary>
|
|
26
|
+
*
|
|
27
|
+
* @param name - Description only, no type (already in the signature).
|
|
28
|
+
* @param limit - Description only.
|
|
29
|
+
* @returns Description only.
|
|
30
|
+
* @throws {RangeError} When <condition, from error-patterns findings>.
|
|
31
|
+
*/
|
|
32
|
+
function example(name: string, limit?: number): Promise<Result> { ... }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- 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 `-`.
|
|
36
|
+
- Exported `interface`/`type` declarations get their own TSDoc block above the declaration, one line per member if the member itself isn't self-explanatory.
|
|
37
|
+
|
|
38
|
+
## API reference formatting
|
|
39
|
+
|
|
40
|
+
- Show the actual signature from the source (JS: as written; TS: full typed signature).
|
|
41
|
+
- For TS, prefer documenting the public exported types directly rather than re-describing them in prose.
|
|
42
|
+
|
|
43
|
+
## What NOT to document inline
|
|
44
|
+
|
|
45
|
+
- Non-exported (module-private) helper functions with obvious names: skip full blocks unless the error-patterns findings show them as a common failure point.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Memory: stacks/php
|
|
2
|
+
|
|
3
|
+
Documentation conventions for PHP targets. Applies whenever the target's manifest is `composer.json` or files are `.php`.
|
|
4
|
+
|
|
5
|
+
## Inline comment format — PHPDoc
|
|
6
|
+
|
|
7
|
+
```php
|
|
8
|
+
/**
|
|
9
|
+
* <one-line summary>
|
|
10
|
+
*
|
|
11
|
+
* <optional longer description>
|
|
12
|
+
*
|
|
13
|
+
* @param string $name Description of the parameter.
|
|
14
|
+
* @param int|null $limit Description. Optional, defaults to null.
|
|
15
|
+
* @return array<string, mixed> Description of the return shape.
|
|
16
|
+
* @throws InvalidArgumentException When <condition, from error-patterns findings>.
|
|
17
|
+
*/
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- One blank-line-separated summary + description, then tags.
|
|
21
|
+
- Always type-hint `@param`/`@return` even when the function itself is already typed — PHPDoc types can be more specific (e.g. `array<string, int>` vs. plain `array`).
|
|
22
|
+
- `@throws` is mandatory whenever the error-patterns findings show this function throwing — never omit it to save space.
|
|
23
|
+
- Class-level docblocks get `@package` only if the project already uses PSR-4 namespacing conventions that make it meaningful; skip otherwise.
|
|
24
|
+
|
|
25
|
+
## API reference formatting
|
|
26
|
+
|
|
27
|
+
- Signatures shown as the actual PHP declaration line (with type hints), not a paraphrase: `public function createUser(string $email, ?int $roleId = null): User`
|
|
28
|
+
- Nullable/union types shown exactly as declared (`?int`, `int|string`).
|
|
29
|
+
- Static vs. instance methods both documented the same way — note staticness in the signature itself, not as prose.
|
|
30
|
+
|
|
31
|
+
## What NOT to document inline
|
|
32
|
+
|
|
33
|
+
- Private/protected helper methods with obvious single-purpose names don't need a full docblock — a one-line `// ` comment is enough, or none if truly self-evident. Full PHPDoc blocks are for the public API surface.
|