Skip to content

Commit 5f9fe26

Browse files
committed
feat: add api reference
1 parent d9cb549 commit 5f9fe26

File tree

426 files changed

+563376
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+563376
-28
lines changed

.vitepress/config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,8 @@ export default defineConfig({
8787
vite: {
8888
plugins: [groupIconVitePlugin()],
8989
},
90+
91+
rewrites: {
92+
'/api/': '/api/app.html',
93+
}
9094
});

.vitepress/config/head.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,24 @@ const head: HeadConfig[] = [
162162
// 'utf-8'
163163
// ),
164164
// ],
165-
[
166-
'script',
167-
{
168-
async: '',
169-
src: 'https://www.googletagmanager.com/gtag/js?id=G-QGZVHHLK12',
170-
},
171-
],
172-
[
173-
'script',
174-
{},
175-
`
176-
window.dataLayer = window.dataLayer || [];
177-
function gtag(){dataLayer.push(arguments);}
178-
gtag('js', new Date());
165+
// [
166+
// 'script',
167+
// {
168+
// async: '',
169+
// src: 'https://www.googletagmanager.com/gtag/js?id=G-QGZVHHLK12',
170+
// },
171+
// ],
172+
// [
173+
// 'script',
174+
// {},
175+
// `
176+
// window.dataLayer = window.dataLayer || [];
177+
// function gtag(){dataLayer.push(arguments);}
178+
// gtag('js', new Date());
179179

180-
gtag('config', 'G-QGZVHHLK12');
181-
`,
182-
],
180+
// gtag('config', 'G-QGZVHHLK12');
181+
// `,
182+
// ],
183183
];
184184

185185
export default head;

.vitepress/config/navbar.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const nav: DefaultTheme.NavItem[] = [
1010
text: 'Blog',
1111
link: 'https://blog.leafphp.dev',
1212
},
13-
1413
{
1514
text: 'Community',
1615
activeMatch: `^/(about|community)/`,

.vitepress/theme/components/Home/Hero.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ import Particles from './Particles.vue';
3939
class="size-3 rounded-full bg-gray-950/5 dark:bg-white/20"></span><span class="size-3 rounded-full bg-gray-950/5 dark:bg-white/20"></span>
4040
</div>
4141
<pre>
42-
<code>$ composer global require leafs/cli:v4.0-beta</code>
43-
<code>$ leaf create app</code>
42+
<code>$ composer global require leafs/cli:v4.0-beta -W</code>
43+
<code>$ leaf create app-name</code>
4444
<code>$ cd app</code>
4545
</pre>
4646
</div>

.vitepress/theme/components/shared/SidebarLinks.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const links = [
6060
</svg>`
6161
},
6262
{
63-
name: 'Playground',
63+
name: 'Sandbox',
6464
href: 'https://sandbox.leafphp.dev/',
6565
color: 'group-hover:shadow-blue-200 dark:group-hover:bg-blue-500',
6666
icon: `<svg class="h-6 w-6" viewBox="0 0 24 24" fill="none">
@@ -90,8 +90,8 @@ const links = [
9090
</svg>`
9191
},
9292
{
93-
name: 'Community',
94-
href: 'https://discord.gg/Pkrm9NJPE3',
93+
name: 'API Reference',
94+
href: '/api/',
9595
color: 'group-hover:shadow-violet-200 dark:group-hover:bg-violet-500',
9696
icon: `<svg class="h-6 w-6" viewBox="0 0 24 24" fill="none">
9797
<path fill-rule="evenodd" clip-rule="evenodd"

src/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<meta http-equiv="refresh" content="0;url=/api/index.html" />

src/docs/cli/index.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,38 @@ composer --version
3232
To install the Leaf CLI, you can run the following command:
3333

3434
```bash:no-line-numbers
35-
composer global require leafs/cli
35+
composer global require leafs/cli:v4.0-beta -W
3636
```
3737

38-
This tells Composer to install the Leaf CLI globally on your system. You can verify that the CLI is installed correctly by running:
38+
This tells Composer to install the Leaf CLI globally on your system. You can verify that the CLI is installed correctly by typing `leaf` in your terminal:
3939

4040
```bash:no-line-numbers
41-
leaf --version
41+
42+
_ __ ___ _ ___
43+
| | ___ __ _ / _| / __| | |_ v4.0-beta
44+
| |__/ -_) _` | _| | (__| |__ | |
45+
|____\___\__,_|_| \___|____|___|
46+
47+
48+
Usage:
49+
command [options] [arguments]
50+
51+
Options:
52+
-h, --help - Display help for the given command.
53+
-V, --version - Display this application version
54+
55+
Available commands:
56+
list — List commands
57+
create — Create a new Leaf project
58+
update — Update leaf cli to the latest version
59+
install — Install a new package
60+
uninstall — Uninstall a package
61+
serve — Run a server to serve your Leaf app
62+
interact — Interact with your application
63+
run — Run a script in your composer.json
64+
view:build — Build your frontend assets
65+
view:install — Set up a new view engine
66+
4267
```
4368

4469
::: details [Error] command not found: leaf

src/docs/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ Leaf is built to be incrementally adoptable: use it as a lightweight core for sm
4242

4343
::: details Technical Requirements
4444

45-
Before you start with Leaf, verify that your system has PHP v7.4+, Composer (for package management) and [Leaf CLI](/docs/cli/) (optional but recommended for easier app management)
45+
Before you start with Leaf, verify that your system has the following installed:
46+
47+
- PHP v7.4 or higher
48+
- Composer (for package management)
49+
- [Leaf CLI](/docs/cli/) (optional but recommended for easier app management)
4650

4751
::: details Don't have PHP & Composer installed?
4852

@@ -57,7 +61,7 @@ Before you start with Leaf, verify that your system has PHP v7.4+, Composer (for
5761
Once you install PHP and Composer, you can proceed with the installation of Leaf CLI:
5862

5963
```bash:no-line-numbers
60-
composer global require leafs/cli
64+
composer global require leafs/cli:v4.0-beta -W
6165
```
6266

6367
### Building your first app

0 commit comments

Comments
 (0)