Skip to content

Commit cee60cb

Browse files
committed
feat: Add quick demo and update README for clarity and usage instructions
This commit adds a quick demo section to the README.md to showcase the basic functionality of the CLI tool. It also updates the README with enhanced clarity and usage instructions. The changes include: - Adding a quick demo section that shows how to create an `index.html` file with WordPress template tags and then use the `phpgen build` command to generate a WordPress theme. - Replacing `node src/index.js` with `phpgen` in the example commands to reflect the globally installed executable. - Renaming the project description from 'PHP Theme Generator CLI' to 'WordPress Theme PHP Files Generator' in the README heading for better clarity.
1 parent 9794619 commit cee60cb

File tree

2 files changed

+72
-8
lines changed

2 files changed

+72
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
## 1.0.0 (2025-08-09)
44

5-
65
### Features
76

8-
* Add CLI tool to generate WordPress themes from HTML ([f882b55](https://github.com/ioncakephper/php-theme-gen/commit/f882b55dc7d755eb808c49e61a36bce8d29be34b))
9-
* Enhance README and package.json for clarity and discoverability ([8487c36](https://github.com/ioncakephper/php-theme-gen/commit/8487c3632b144f2cc4b7c453051b66ecd5aa2bfe))
7+
- Add CLI tool to generate WordPress themes from HTML ([f882b55](https://github.com/ioncakephper/php-theme-gen/commit/f882b55dc7d755eb808c49e61a36bce8d29be34b))
8+
- Enhance README and package.json for clarity and discoverability ([8487c36](https://github.com/ioncakephper/php-theme-gen/commit/8487c3632b144f2cc4b7c453051b66ecd5aa2bfe))
109

1110
## [1.2.0](https://github.com/ioncakephper/php-theme-gen/compare/v1.1.0...v1.2.0) (2025-07-07)
1211

README.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PHP Theme Generator CLI
1+
# WordPress Theme PHP Files Generator
22

33
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) [![Build Status](https://github.com/ioncakephper/php-theme-gen/actions/workflows/ci.yml/badge.svg)](https://github.com/ioncakephper/php-theme-gen/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/ioncakephper/php-theme-gen/branch/main/graph/badge.svg)](https://codecov.io/gh/ioncakephper/php-theme-gen) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![Changelog](https://img.shields.io/badge/changelog-keep_a_changelog-blue.svg)](CHANGELOG.md)
44

@@ -13,6 +13,7 @@ A command-line interface (CLI) that streamlines WordPress theme development. It
1313
- [🚀 Getting Started](#-getting-started)
1414
- [Prerequisites](#prerequisites)
1515
- [Installation](#installation)
16+
- [Quick demo](#quick-demo)
1617
- [🚀 Usage](#-usage)
1718
- [`build` Command](#build-command)
1819
- [`new` Command](#new-command)
@@ -88,9 +89,73 @@ A command-line interface (CLI) that streamlines WordPress theme development. It
8889
# npx php-theme-gen build demo/index.html --output demo/mytheme
8990
```
9091

92+
### Quick demo
93+
94+
Create `demo/index.html` with the following content:
95+
96+
```html
97+
<!-- wp:file name="header" -->
98+
<!DOCTYPE html>
99+
<html lang="en">
100+
<head>
101+
<meta charset="UTF-8" />
102+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
103+
<title>Elegant Page with Tailwind CSS</title>
104+
<script src="https://cdn.tailwindcss.com"></script>
105+
</head>
106+
<body class="bg-gray-100 text-gray-800 font-sans">
107+
<header class="bg-white shadow-md"></header>
108+
<!-- /wp:file -->
109+
110+
<main class="container mx-auto px-6 py-12">
111+
<!-- Hero Section -->
112+
<section class="text-center mb-16">
113+
<h1 class="text-5xl font-extrabold text-gray-900 mb-4">
114+
Build Your Elegant Website
115+
</h1>
116+
<p class="text-lg text-gray-600 mb-8">
117+
A beautiful and responsive starting point for your next project.
118+
</p>
119+
<a
120+
href="#"
121+
class="bg-blue-600 text-white font-bold py-3 px-8 rounded-full hover:bg-blue-700 transition duration-300"
122+
>Get Started</a
123+
>
124+
</section>
125+
</main>
126+
127+
<!-- wp:file name="footer" -->
128+
<footer class="bg-gray-800 text-white">
129+
<div class="container mx-auto px-6 py-12"></div>
130+
<div class="bg-gray-900 py-4">
131+
<div class="container mx-auto px-6 text-center text-gray-500">
132+
&copy; 2025 MyLogo. All Rights Reserved.
133+
</div>
134+
</div>
135+
</footer>
136+
</body>
137+
</html>
138+
<!-- /wp:file -->
139+
```
140+
141+
The file contains HTML code and `<~-- wp-file ... -->` and `<!-- /wp:file -->` pair to designate the `php` filename and the content for that file.
142+
143+
Invoke `phphen`:
144+
145+
```bash
146+
phpgen build demo/index.html --output demo/mytheme
147+
```
148+
149+
It generates the following files in `demo/mytheme`:
150+
151+
- `header.php`
152+
- `footer.php`
153+
- `index.php`
154+
- `style.css`
155+
91156
## 🚀 Usage
92157

93-
The `php-theme-gen` CLI tool allows you to quickly generate a WordPress theme structure from a single HTML file.
158+
The `phpgen` CLI tool allows you to quickly generate a WordPress theme structure from a single HTML file.
94159

95160
### `build` Command
96161

@@ -119,7 +184,7 @@ node src/index.js build <sourceFile> [options]
119184
To generate a theme from `demo/index.html` into the `demo/mytheme` directory with a custom theme name:
120185

121186
```bash
122-
node src/index.js build demo/index.html --output demo/mytheme --themeName "My Elegant Theme" --author "Your Name" --description "An elegant WordPress theme."
187+
phpgen build demo/index.html --output demo/mytheme --themeName "My Elegant Theme" --author "Your Name" --description "An elegant WordPress theme."
123188
```
124189

125190
This command will create the following files in `demo/mytheme`:
@@ -134,7 +199,7 @@ This command will create the following files in `demo/mytheme`:
134199
The `new` command generates a new HTML template file with basic WordPress theme tags. This is useful for quickly starting a new theme development.
135200

136201
```bash
137-
node src/index.js new <templateName> [options]
202+
phpgen new <templateName> [options]
138203
```
139204

140205
**Arguments:**
@@ -150,7 +215,7 @@ node src/index.js new <templateName> [options]
150215
To create a new HTML template named `about-us.html` in the `templates` directory:
151216

152217
```bash
153-
node src/index.js new about-us --output templates
218+
phpgen new about-us --output templates
154219
```
155220

156221
## 🚀 Available Scripts

0 commit comments

Comments
 (0)