Skip to content

Commit 8a6c871

Browse files
committed
feat: reorganize documentation and rewrite first chapters
1 parent 8186f39 commit 8a6c871

File tree

21 files changed

+423
-458
lines changed

21 files changed

+423
-458
lines changed

src/Web/Documentation/content/main/0-getting-started/00-introduction.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description: "Tempest is a PHP framework designed to get out of your way. Its co
55

66
Tempest makes writing PHP applications pleasant thanks to carefully crafted quality-of-life features that feel like a natural extension of vanilla PHP.
77

8-
It embraces modern PHP syntax in its implementation of routing, ORM, console commands, messaging, logging, it takes inspiration from the best front-end frameworks for its templating engine syntax, and provides unique capabilities amongst other framework, such as [discovery](../3-internals/02-discovery), to improve developer experience.
8+
It embraces modern PHP syntax in its implementation of routing, ORM, console commands, messaging, logging, it takes inspiration from the best front-end frameworks for its templating engine syntax, and provides unique capabilities, such as [discovery](../3-internals/02-discovery), to improve developer experience.
99

10-
You may also be interested in reading how it has an [unfair advantage](/blog/unfair-advantage) over other frameworks. But code says more than words, so here are a few examples of code written on top of Tempest:
10+
You may be interested in reading how it has an [unfair advantage](/blog/unfair-advantage) over other frameworks—but code says more than words, so here are a few examples of code written on top of Tempest:
1111

1212
```php
1313
use Tempest\Router\Get;
@@ -87,6 +87,8 @@ This is a [console command](../2-console/02-building-console-commands). Console
8787

8888
This example also shows how to [register events globally](../1-framework/07-events) using the `#[EventHandler]`.
8989

90+
---
91+
9092
:::info Ready to give it a try?
9193
Keep on reading and consider [**giving Tempest a star️ on GitHub**](https://github.com/tempestphp/tempest-framework). If you want to be part of the community, you can [**join our Discord server**](https://discord.gg/pPhpTGUMPQ), and if you feel like contributing, you can check out our [contributing guide](/docs/internals/contributing)!
9294
:::

src/Web/Documentation/content/main/0-getting-started/01-getting-started.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ Once the prerequisites are installed, you can chose your installation method. Te
1616
To get started with a new Tempest project, you may use {`tempest/app`} as the starting point. The `composer create-project` command will scaffold it for you:
1717

1818
```sh
19-
composer create-project tempest/app my-app --stability alpha
20-
cd my-app
19+
{:hl-keyword:composer:} create-project tempest/app {:hl-type:my-app:} --stability alpha
20+
{:hl-keyword:cd:} {:hl-type:my-app:}
2121
```
2222

2323
If you have a dedicated development environment, you may then access your application by opening `https://my-app.test` in your browser. Otherwise, you may use PHP's built-in server:
2424

2525
```sh
26-
php tempest serve
27-
# PHP 8.3.3 Development Server (http://localhost:8000) started
26+
{:hl-keyword:php:} tempest serve
27+
{:hl-comment:PHP 8.3.3 Development Server (http://localhost:8000) started:}
2828
```
2929

3030
### Scaffolding front-end assets
3131

3232
Optionally, you may install a basic front-end scaffolding that includes [Vite](https://vite.dev/) and [Tailwind CSS](https://tailwindcss.com/). To do so, run the Vite installer and follow through the wizard:
3333

3434
```sh
35-
php tempest install vite --tailwind
35+
{:hl-keyword:php:} tempest install vite --tailwind
3636
```
3737

3838
<!-- TODO: docs -->
@@ -41,21 +41,21 @@ The assets created by this wizard, `main.entrypoint.ts` and `main.entrypoint.css
4141
You may then run the front-end development server, which will serve your assets on-the-fly:
4242

4343
```bash
44-
npm run dev
44+
{:hl-keyword:npm:} run dev
4545
```
4646

4747
## Tempest as a package
4848

4949
If you already have a project, you can opt to install {`tempest/framework`} as a standalone package. You could do this in any project; it could already contain code, or it could be an empty project.
5050

5151
```sh
52-
composer require tempest/framework:1.0-alpha.5
52+
{:hl-keyword:composer:} require tempest/framework:1.0-alpha.5
5353
```
5454

5555
Installing Tempest this way will give you access to the Tempest console, `./vendor/bin/tempest`. Optionally, you can choose to install Tempest's entry points in your project. To do so, you may run the framework installer:
5656

5757
```txt
58-
./vendor/bin/tempest install framework
58+
{:hl-keyword:./vendor/bin/tempest:} install framework
5959
```
6060

6161
This installer will prompt you to install the following files into your project:
@@ -84,10 +84,10 @@ The following projects structures work the same way in Tempest, without requirin
8484
```txt
8585
app
8686
├── Console
87-
   └── RssSyncCommand.php
87+
└── RssSyncCommand.php
8888
├── Controllers
89-
   ├── BlogPostController.php
90-
   └── HomeController.php
89+
├── BlogPostController.php
90+
└── HomeController.php
9191
└── Views
9292
├── blog.view.php
9393
└── home.view.php
@@ -96,9 +96,9 @@ app
9696
```txt
9797
src
9898
├── Blog
99-
   ├── BlogPostController.php
100-
   ├── RssSyncCommand.php
101-
   └── blog.view.php
99+
├── BlogPostController.php
100+
├── RssSyncCommand.php
101+
└── blog.view.php
102102
└── Home
103103
├── HomeController.php
104104
└── home.view.php
@@ -174,12 +174,12 @@ By default, the discovery cache is disabled in local development. Depending on y
174174
This caching strategy will only cache discovery for vendor files. For this reason, it is recommended to run `discovery:generate` after every composer update:
175175

176176
```json
177-
{:hl-comment:// …:}
178-
179-
"scripts": {
177+
{
178+
"scripts": {
180179
"post-package-update": [
181-
"php tempest discovery:generate"
180+
"php tempest discovery:generate"
182181
]
182+
}
183183
}
184184
```
185185

0 commit comments

Comments
 (0)