Skip to content

Commit 501e702

Browse files
committed
Wip
1 parent 8d0462d commit 501e702

10 files changed

Lines changed: 824 additions & 722 deletions

File tree

website/config/container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
$converter = new CommonMarkConverter([
1313
'heading_permalink' => [
14-
'min_heading_level' => 3,
14+
'min_heading_level' => 2,
1515
'id_prefix' => '',
1616
'fragment_prefix' => '',
1717
'apply_id_to_heading' => true,
1818
'symbol' => '#',
1919
],
2020
'table_of_contents' => [
2121
'position' => 'placeholder',
22-
'min_heading_level' => 3,
22+
'min_heading_level' => 2,
2323
'max_heading_level' => 6,
2424
'placeholder' => '[TOC]',
2525
],

website/routes/development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
## Development
1+
# Development
22

33
- [Zack! at GitHub](https://github.com/tbreuss/zack)
44
- [Zack! at Packagist](https://packagist.org/packages/tebe/zack)
55

6-
### Support
6+
## Support
77

88
Support is given through GitHub only. If possible, try to reproduce your issue before asking your question.
99

1010
If you want to discuss the enhancement of Zack!, file an [issue](https://github.com/tbreuss/zack/issues) on GitHub or submit a [pull request](https://github.com/tbreuss/zack/pulls).
1111

12-
### Bug Reports
12+
## Bug Reports
1313

1414
If you find a bug, you can file an [issue](https://github.com/tbreuss/zack/issues).

website/routes/doc.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Documentation
1+
# Documentation
22

33
[TOC]
44

5-
### Requirements
5+
## Requirements
66

77
Zack! requirements are:
88

@@ -20,7 +20,7 @@ Composer `--no-dev` requirements are:
2020
- twig/markdown-extra: ^3.21
2121
- twig/twig: ^3.20
2222

23-
### Installation
23+
## Installation
2424

2525
Create a new project folder and change into it.
2626

@@ -76,7 +76,7 @@ php -S localhost:8888 -t web
7676

7777
Open <http://localhost:8888> with your preferred web browser.
7878

79-
### Folder Structure
79+
## Folder Structure
8080

8181
A typical project folder structure looks like the following:
8282

@@ -98,7 +98,7 @@ project/ # Project root folder on your server
9898

9999
Normally you only work in the `routes` and `views` folders.
100100

101-
### File-Based Routing
101+
## File-Based Routing
102102

103103
Zack! is using file-based routing for your routes.
104104
Files are automatically mapped to Symfony routes.
@@ -130,7 +130,7 @@ routes/
130130
└─ hello.post.php
131131
~~~
132132

133-
#### Simple Routes
133+
### Simple Routes
134134

135135
First, create a file in `routes` directory.
136136
The filename will be the route path.
@@ -150,9 +150,9 @@ return new Response('{"ping": "pong"}', 200, [
150150
]);
151151
~~~
152152

153-
#### Route With Params
153+
### Route With Params
154154

155-
##### Single Param
155+
#### Single Param
156156

157157
To define a route with params, use the `[<param>]` syntax where `<param>` is the name of the param.
158158
The param will be available in the `$request->attributes` object.
@@ -177,7 +177,7 @@ Call the route with the param `/hello/zack`, you will get:
177177
Hello zack!
178178
~~~
179179

180-
##### Multiple Params
180+
#### Multiple Params
181181

182182
You can define multiple params in a route using `[<param1>]/[<param2>]` syntax where each param is a folder.
183183
You cannot define multiple params in a single filename of folder.
@@ -195,7 +195,7 @@ $age = $request->attributes->get('age');
195195
return new Response("Hello $name! You are $age years old.", 200);
196196
~~~
197197

198-
##### Catch All Params
198+
#### Catch All Params
199199

200200
You can capture all the remaining parts of a URL using `[...<param>]` syntax. This will include the `/` in the param.
201201

@@ -219,7 +219,7 @@ Call the route with the param `/hello/zack/is/nice`, you will get:
219219
Hello zack/is/nice!
220220
~~~
221221

222-
#### Specific Request Method
222+
### Specific Request Method
223223

224224
You can append the HTTP method to the filename to force the route to be matched only for a specific HTTP request method.
225225
For example `hello.get.php` will only match for GET requests.
@@ -241,7 +241,7 @@ return new Response('{"updated": true}', 200, [
241241
]);
242242
~~~
243243

244-
#### Catch All Route
244+
### Catch All Route
245245

246246
You can create a special route that will match all routes that are not matched by any other route.
247247
This is useful for creating a default route.
@@ -260,7 +260,7 @@ $path = $request->attributes->get('path');
260260
return new Response("Hello $path!", 200);
261261
~~~
262262

263-
### Route Handler
263+
## Route Handler
264264

265265
You can use the file extension of a route file to force the route to be handled by a specific route handler.
266266

@@ -277,7 +277,7 @@ routes/
277277

278278
Zack! is currently delivered with the following route handlers:
279279

280-
#### HTML Route Handler
280+
### HTML Route Handler
281281

282282
File extensions: htm, html \
283283
Response content-type: text/html; charset=UTF-8
@@ -287,7 +287,7 @@ The Twig layout is determined via the layout comment `<!-- layout: my-layout.htm
287287
The page title is determined by the H1-H3 headings in the HTML content.
288288
The layout is applied and output together with the page title and the HTML content.
289289

290-
#### Markdown Route Handler
290+
### Markdown Route Handler
291291

292292
File extensions: markdown, md \
293293
Response content-type: text/html; charset=UTF-8
@@ -303,14 +303,14 @@ The Twig layout is determined via the layout comment `<!-- layout: my-layout.htm
303303
The page title is determined by the H1-H3 headings in the HTML content.
304304
The layout is applied and output together with the page title and the HTML content.
305305

306-
#### PHP Route Handler
306+
### PHP Route Handler
307307

308308
File extension: php \
309309
Response content-type: text/html; charset=UTF-8, application/json; charset=UTF-8, or other
310310

311311
The content-type of the response can be set explicitly in a PHP route handler.
312312

313-
##### Echoing Content
313+
#### Echoing Content
314314

315315
The echoed content of the PHP file is taken.
316316

@@ -320,7 +320,7 @@ Otherwise the Twig layout is determined via the layout comment `<!-- layout: my-
320320
The page title is determined by the H1-H3 headings in the HTML content.
321321
The layout is applied and output together with the page title and the HTML content.
322322

323-
##### Returning Response
323+
#### Returning Response
324324

325325
If you want finer control over the HTTP response, you can return a string, an array or a `Symfony\Component\HttpFoundation\Response` object.
326326

@@ -333,7 +333,7 @@ If the return value is a `Symfony\Component\HttpFoundation\Response` object, it
333333
With returning a response object you will have full control over the HTTP response.
334334
There are several response subclasses to help you return JSON, redirect, stream file downloads and more.
335335

336-
#### Generic Route Handler
336+
### Generic Route Handler
337337

338338
The generic route handler is a handler that supports the following file types:
339339

@@ -345,21 +345,21 @@ The generic route handler is a handler that supports the following file types:
345345

346346
The contents of the file are read and output together with the corresponding content type from the above mapping.
347347

348-
### Configuration
348+
## Configuration
349349

350350
TBD
351351

352-
### Events
352+
## Events
353353

354-
#### Zack! Events
354+
### Zack! Events
355355

356356
Zack! ships with the following events:
357357

358358
- **zack.container**: This event is dispatched after the container has been built.
359359
- **zack.controller**: This event is dispatched just before the controller (i.e. the route handler) is determined.
360360
- **zack.routes**: This event is dispatched after the routes have been built.
361361

362-
#### HttpKernel Events
362+
### HttpKernel Events
363363

364364
Zack! supports the following Symfony HttpKernel events:
365365

@@ -373,9 +373,9 @@ Zack! supports the following Symfony HttpKernel events:
373373

374374
Read [Built-in Symfony Events](https://symfony.com/doc/current/reference/events.html#kernel-events) for more information.
375375

376-
### Development Environment
376+
## Development Environment
377377

378-
#### Create Docker Image
378+
### Create Docker Image
379379

380380
Create Docker image based on the latest supported PHP version
381381

@@ -386,7 +386,7 @@ Optionally you can also use an older PHP version
386386
docker build --build-arg PHP_VERSION=8.2 -t zack https://github.com/tbreuss/zack.git
387387
docker build --build-arg PHP_VERSION=8.3 -t zack https://github.com/tbreuss/zack.git
388388

389-
#### Run Website
389+
### Run Website
390390

391391
Clone project
392392

@@ -422,27 +422,27 @@ Open generated HTML report in browser
422422

423423
docker run --rm -p 8888:8888 -v .:/app zack php -S 0.0.0.0:8888 -t /app/.coverage/report
424424

425-
### Testing
425+
## Testing
426426

427-
#### Coding Style
427+
### Coding Style
428428

429429
Fix coding style issues using [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
430430

431431
./bin/fix-coding-style.sh
432432

433-
#### Static Code Analysis
433+
### Static Code Analysis
434434

435435
Analyse code using [PHPStan](https://phpstan.org/)
436436

437437
./bin/analyse-code.sh
438438

439-
#### Functional Tests
439+
### Functional Tests
440440

441441
Run functional tests using [Hurl](https://hurl.dev/)
442442

443443
./bin/test-code.sh localhost:9330
444444

445-
#### Website Tests
445+
### Website Tests
446446

447447
Run website tests using [Hurl](https://hurl.dev/)
448448

0 commit comments

Comments
 (0)