You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. Create a `docs/en` directory and add a markdown file, e.g. `docs/en/getting-started.md`.
72
89
73
-
4. Visit your docs at `/docs` (or `/{route_prefix}` if you changed `pertuk.route_prefix`).
90
+
6. Visit your docs at `/docs` (redirects to default locale) or `/docs/en` directly.
74
91
75
-
-Optional: publish the views to customize the layout and markup:
92
+
-**Customization**: Publish the views to customize the layout and markup:
76
93
77
94
```bash
78
95
php artisan vendor:publish --tag="pertuk-views"
79
96
```
80
97
98
+
7. (Optional) Pre-render documentation for performance:
99
+
```bash
100
+
php artisan pertuk:build
101
+
```
102
+
81
103
## Usage
82
104
83
105
### Document Structure
84
106
107
+
Files must be organized by locale subdirectory.
108
+
85
109
```
86
110
docs/
87
-
├── getting-started.md
88
-
├── User Guide/
89
-
│ ├── installation.md # default (en)
90
-
│ ├── installation.ckb.md # Kurdish
91
-
│ ├── installation.ar.md # Arabic
92
-
│ └── configuration.md
93
-
├── Developer Guide/
94
-
│ ├── api.md
95
-
│ └── examples.md
96
-
└── advanced.md
111
+
├── en/ # English (default)
112
+
│ ├── getting-started.md
113
+
│ ├── User Guide/
114
+
│ │ ├── installation.md
115
+
│ │ └── configuration.md
116
+
│ └── advanced.md
117
+
├── ckb/ # Kurdish
118
+
│ ├── getting-started.md
119
+
│ └── User Guide/
120
+
│ ├── installation.md
121
+
│ └── configuration.md
122
+
└── ar/ # Arabic
123
+
└── getting-started.md
97
124
```
98
125
99
126
### Front Matter
@@ -110,15 +137,92 @@ order: 1
110
137
Your markdown content here...
111
138
```
112
139
140
+
### Interactive Components (Alpine.js)
141
+
142
+
Pertuk includes built-in interactive components powered by Alpine.js. These can be used directly in your Markdown files.
143
+
144
+
#### Tabs
145
+
146
+
Use tabs to group related content, like code examples in different languages.
147
+
148
+
```html
149
+
<x-pertuk-tabs>
150
+
<x-pertuk-tabname="PHP">
151
+
152
+
```php
153
+
echo "Hello World";
154
+
```
155
+
156
+
</x-pertuk-tab>
157
+
<x-pertuk-tabname="JS">
158
+
159
+
```javascript
160
+
console.log("Hello World");
161
+
```
162
+
163
+
</x-pertuk-tab>
164
+
</x-pertuk-tabs>
165
+
```
166
+
167
+
#### Accordion
168
+
169
+
Use accordions for collapsible sections like FAQs.
170
+
171
+
```html
172
+
<x-pertuk-accordion>
173
+
<x-pertuk-accordion-item title="Can I customize the design?">
174
+
175
+
Yes! You can publish the views and CSS to match your brand's identity.
176
+
177
+
</x-pertuk-accordion-item>
178
+
<x-pertuk-accordion-item title="What about performance?">
179
+
180
+
Pertuk uses intelligent caching and server-side rendering for lightning-fast speeds.
181
+
182
+
</x-pertuk-accordion-item>
183
+
</x-pertuk-accordion>
184
+
```
185
+
186
+
### Admonitions
187
+
188
+
Use special blocks for callouts:
189
+
190
+
```markdown
191
+
::: tip
192
+
This is a helpful tip.
193
+
:::
194
+
195
+
::: warning
196
+
Be careful with this setting.
197
+
:::
198
+
199
+
::: danger
200
+
This action cannot be undone.
201
+
:::
202
+
```
203
+
113
204
### Multi-Language Support
114
205
115
-
Create language-specific versions by adding locale suffixes:
206
+
Docs must be placed in a subdirectory matching the locale code defined in `config/pertuk.php`. The structure is strict: `docs/{locale}/{slug}.md`.
116
207
117
208
```
118
209
docs/
119
-
├── getting-started.md # English (default)
120
-
├── getting-started.ckb.md # Kurdish
121
-
└── getting-started.ar.md # Arabic
210
+
├── en/
211
+
│ └── intro.md
212
+
├── ckb/
213
+
│ └── intro.md
214
+
└── ar/
215
+
└── intro.md
216
+
```
217
+
218
+
### Performance & Deployment
219
+
220
+
To ensure maximum performance in production, you can pre-render all documentation files into the cache. This eliminates the need for parsing Markdown on the first request.
221
+
222
+
Run the following command during your deployment process:
0 commit comments