Skip to content

Commit 070f23f

Browse files
authored
Merge pull request #1 from soderlind/update/preview
Update/preview
2 parents e686752 + 582da7e commit 070f23f

18 files changed

+4561
-3290
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/) and this project adheres to Semantic Versioning (https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.1.1] - 2025-10-03
8+
### Added
9+
- wordpress.org tabbed preview theme (Description, Installation, FAQ, Screenshots, Changelog, Reviews placeholder)
10+
- Accessible embedded screenshot gallery with thumbnails & keyboard navigation
11+
- Forced background mode setting (`auto` | `light` | `dark`)
12+
- Tag display refinement to uppercase bracketed form `[TAG]`
13+
14+
### Changed
15+
- README updated with new features and configuration table
16+
- Improved icon and banner layout positioning in wordpress.org theme
17+
18+
### Fixed
19+
- Ensured all discovered screenshots load (removed earlier limitation)
20+
- Gallery navigation contrast and focus handling improvements
21+
22+
## [0.1.0] - 2025-10-02
23+
### Added
24+
- Initial release with live WordPress.org-style preview
25+
- Validation engine with precise line/column diagnostics & quality score
26+
- Scroll synchronization (optional)
27+
- Context menu integration across explorer, editor tab, and editor content
28+
- Custom parser for WordPress readme formatting (FAQ, changelog headers, etc.)
29+
30+
[0.1.1]: https://github.com/soderlind/wordpress-readme-preview/compare/v0.1.0...v0.1.1

LICENSE

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 2, June 1991
3+
4+
Copyright (C) 2024 Per Soderlind
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License along
17+
with this program; if not, write to the Free Software Foundation, Inc.,
18+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
20+
---
21+
22+
GNU GENERAL PUBLIC LICENSE
23+
Version 2, June 1991
24+
25+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
26+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27+
Everyone is permitted to copy and distribute verbatim copies
28+
of this license document, but changing it is not allowed.
29+
30+
Preamble
31+
32+
The licenses for most software are designed to take away your
33+
freedom to share and change it. By contrast, the GNU General Public
34+
License is intended to guarantee your freedom to share and change free
35+
software--to make sure the software is free for all its users. This
36+
General Public License applies to most of the Free Software
37+
Foundation's software and to any other program whose authors commit to
38+
using it. (You can also apply it to your programs too.)
39+
40+
When we speak of free software, we are referring to freedom, not
41+
price. Our General Public Licenses are designed to make sure that you
42+
have the freedom to distribute copies of free software (and charge for
43+
this service if you wish), that you receive source code or can get it
44+
if you want it, that you can change the software or use pieces of it
45+
in new free programs; and that you know you can do these things.
46+
47+
To protect your rights, we need to make restrictions that forbid
48+
anyone to deny you these rights or to ask you to surrender the rights.
49+
These restrictions translate to certain responsibilities for you if you
50+
distribute copies of the software, or if you modify it.
51+
52+
For example, if you distribute copies of such a program, whether
53+
gratis or for a fee, you must give the recipients all the rights that
54+
you have. You must make sure that they, too, receive or can get the
55+
source code. And you must show them these terms so they know their
56+
rights.
57+
58+
We protect your rights with two steps: (1) copyright the software, and
59+
(2) offer you this license which gives you legal permission to copy,
60+
distribute and/or modify the software.
61+
62+
Also, for each author's protection and ours, we want to make certain
63+
that everyone understands that there is no warranty for this free
64+
software. If the software is modified by someone else and passed on, we
65+
want its recipients to know that what they have is not the original, so
66+
that any problems introduced by others will not reflect on the original
67+
authors' reputations.
68+
69+
Finally, any free program is threatened constantly by software
70+
patents. We wish to avoid the danger that redistributors of a free
71+
program will individually obtain patent licenses, in effect making the
72+
program proprietary. To prevent this, we have made it clear that any
73+
patent must be licensed for everyone's free use or not licensed at all.
74+
75+
The precise terms and conditions for copying, distribution and
76+
modification follow.
77+
78+
GNU GENERAL PUBLIC LICENSE
79+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
80+
81+
0. This License applies to any program or other work which contains
82+
a notice placed by the copyright holder saying it may be distributed
83+
under the terms of this General Public License. The "Program", below,
84+
refers to any such program or work, and a "work based on the Program"
85+
means either the Program or any derivative work under copyright law:
86+
that is to say, a work containing the Program or a portion of it,
87+
either verbatim or with modifications and/or translated into another
88+
language. (Hereinafter, translation is included without limitation in
89+
the term "modification".) Each licensee is addressed as "you".
90+
91+
Activities other than copying, distribution and modification are not
92+
covered by this License; they are outside its scope. The act of
93+
running the Program is not restricted, and the output from the Program
94+
is covered only if its contents constitute a work based on the
95+
Program (independent of having been made by running the Program).
96+
Whether that is true depends on what the Program does.
97+
98+
[Full GPL v2 license text continues...]

PUBLISH-CHECKLIST.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Pre-Publication Checklist for WordPress Readme Preview
2+
3+
## **Critical Issues to Fix:**
4+
5+
### 1. **Publisher Name**
6+
- Current: `"publisher": "wordpress-readme-preview"`
7+
- **Issue**: This needs to be your actual VS Code Marketplace publisher ID
8+
- **Fix**: Change to your Microsoft/GitHub account publisher name
9+
10+
### 2. **Icon Format**
11+
- Current: SVG icon (not supported)
12+
- **Issue**: VS Code Marketplace requires PNG format
13+
- **Fix**: Convert icon.svg to icon.png (128x128 pixels)
14+
15+
### 3. **Repository Links**
16+
- **Missing**: Repository URL in package.json
17+
- **Fix**: Add repository, bugs, and homepage URLs
18+
19+
## **Recommended Improvements:**
20+
21+
### 4. **Extension Categories**
22+
- Current: ["Other", "Formatters", "Linters"]
23+
- **Better**: ["Formatters", "Linters", "Other"] (most relevant first)
24+
25+
### 5. **Keywords Enhancement**
26+
- Add more discoverable keywords: "validation", "wordpress.org", "wp-plugin"
27+
28+
### 6. **Version Strategy**
29+
- Current: 0.1.0 (good for initial release)
30+
- Consider: 1.0.0 for first stable release
31+
32+
## 🔧 **Publishing Commands:**
33+
34+
```bash
35+
# Install vsce if not installed
36+
npm install -g vsce
37+
38+
# Package the extension
39+
vsce package
40+
41+
# Publish to marketplace
42+
vsce publish
43+
```
44+
45+
## 📋 **Final Testing:**
46+
47+
- [ ] Test all commands work
48+
- [ ] Test in both light and dark themes
49+
- [ ] Test scroll synchronization
50+
- [ ] Test context menus
51+
- [ ] Test link rendering
52+
- [ ] Verify no console errors

README.md

Lines changed: 86 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ A Visual Studio Code extension that provides live preview and validation for Wor
1111
**Context Menus** - Right-click support in explorer and editor tabs
1212
**Scroll Synchronization** - Keep editor and preview in sync when scrolling
1313
**Theme Support** - Automatic dark/light theme matching with VS Code
14+
**Forced Background Modes** - Override preview to always light or dark
1415
**Quality Scoring** - Get 0-100 quality score with improvement suggestions
1516
**False Positive Prevention** - Accurate detection without hallucinated errors
17+
**Tabbed wordpress.org Layout** - Authentic multi-tab presentation (Description, Installation, FAQ, Screenshots, Changelog)
18+
**Accessible Screenshot Gallery** - Keyboard & screen reader friendly with thumbnails
19+
20+
![Alt text](media/example.png)
1621

1722
## Quick Start
1823

@@ -103,41 +108,39 @@ A Visual Studio Code extension that provides live preview and validation for Wor
103108

104109
## Configuration
105110

106-
Customize the extension behavior via VS Code settings:
107-
108-
```json
111+
All settings live under the `wordpress-readme.*` namespace.
112+
113+
| Setting | Type | Default | Description |
114+
|---------|------|---------|-------------|
115+
| `wordpress-readme.preview.autoOpen` | boolean | false | Auto-open preview when a `readme.txt` is opened |
116+
| `wordpress-readme.preview.theme` | enum(classic|wordpress-org) | classic | Select layout style |
117+
| `wordpress-readme.preview.backgroundMode` | enum(auto|light|dark) | auto | Force preview light/dark or follow editor theme |
118+
| `wordpress-readme.preview.syncScrolling` | boolean | false | Synchronize scroll position between editor & preview |
119+
| `wordpress-readme.validation.enabled` | boolean | true | Enable live validation |
120+
| `wordpress-readme.validation.showWarnings` | boolean | true | Include warnings (not just errors) |
121+
| `wordpress-readme.contextMenu.showInExplorer` | boolean | true | Show commands in Explorer context menu |
122+
| `wordpress-readme.contextMenu.showInEditorTab` | boolean | true | Show commands in editor tab context menu |
123+
| `wordpress-readme.contextMenu.showInEditor` | boolean | true | Show commands in editor content (text area) context menu |
124+
| `wordpress-readme.contextMenu.showPreview` | boolean | true | Enable "Open Preview" entries |
125+
| `wordpress-readme.contextMenu.showPreviewToSide` | boolean | true | Enable "Open Preview to the Side" entries |
126+
| `wordpress-readme.contextMenu.showValidation` | boolean | true | Enable validation command entries |
127+
128+
Example customization snippet:
129+
130+
```jsonc
109131
{
110-
// Auto-open preview when opening readme.txt files
111-
"wordpress-readme.preview.autoOpen": false,
112-
113-
// Enable scroll synchronization between editor and preview
132+
"wordpress-readme.preview.theme": "wordpress-org",
133+
"wordpress-readme.preview.backgroundMode": "dark",
114134
"wordpress-readme.preview.syncScrolling": true,
115-
116-
// Enable automatic validation as you type
117-
"wordpress-readme.validation.enabled": true,
118-
119-
// Show validation warnings (not just errors)
120-
"wordpress-readme.validation.showWarnings": true,
121-
122-
// Context menu configuration - enable/disable individual menu items
123-
"wordpress-readme.contextMenu.openPreview": true,
124-
"wordpress-readme.contextMenu.openPreviewToSide": true,
125-
"wordpress-readme.contextMenu.validate": true,
126-
"wordpress-readme.contextMenu.openFile": true,
127-
"wordpress-readme.contextMenu.separator1": true,
128-
"wordpress-readme.contextMenu.separator2": true
135+
"wordpress-readme.validation.showWarnings": false
129136
}
130137
```
131138

132-
### Context Menu Customization
133-
134-
You can customize which context menu items appear by adjusting the `wordpress-readme.contextMenu.*` settings:
139+
### Forced Background Mode
140+
Use `backgroundMode` to view your readme in a fixed light or dark palette regardless of the editor theme. Great for checking color/contrast of inline badges or screenshots.
135141

136-
- `openPreview` - Show "Open Preview" option
137-
- `openPreviewToSide` - Show "Open Preview to the Side" option
138-
- `validate` - Show "Validate Readme" option
139-
- `openFile` - Show "Open File" option
140-
- `separator1` / `separator2` - Show menu separators for organization
142+
### Tag Appearance
143+
Tags are rendered as simple uppercase bracketed items (e.g. `[SEO] [CACHE]`) for clarity and compactness—mirroring a neutral, style-light presentation for quick scanning.
141144

142145
## Available Commands
143146

@@ -188,6 +191,51 @@ All context menus provide instant access to preview and validation commands.
188191
- **Border & Shadow Adaptation** - Adjusts visual elements for each theme
189192
- **Code Block Styling** - Theme-aware syntax highlighting backgrounds
190193

194+
### Alternate Layout: wordpress-org Theme
195+
196+
You can switch to an alternative WordPress.org–style tabbed layout that more closely mirrors the official plugin directory presentation.
197+
198+
Setting:
199+
```jsonc
200+
"wordpress-readme.preview.theme": "wordpress-org" // default is "classic"
201+
```
202+
203+
Features of the `wordpress-org` theme:
204+
- Tabbed interface (Description, Installation, FAQ, Screenshots, Changelog, Reviews placeholder)
205+
- Banner + Icon rendering (auto-detected)
206+
- Responsive, accessible screenshot gallery (thumbnails + keyboard navigation + focus outlines)
207+
- Keyboard navigation: Arrow keys / Home / End across tabs and thumbnails
208+
- Deep linking using URL hash (e.g. `#faq` selects the FAQ tab)
209+
- Graceful placeholders when a tab has no content
210+
211+
If a tab has no corresponding content it displays a subtle placeholder. Reviews are not locally generated (placeholder only).
212+
213+
### Plugin Asset Auto-Discovery
214+
215+
When using the `wordpress-org` theme the extension automatically searches for standard plugin assets next to your `readme.txt`:
216+
217+
Search order (first existing directory wins precedence if duplicates):
218+
1. `.wordpress-org/`
219+
2. `assets/`
220+
221+
Supported file patterns (case-insensitive):
222+
- Banners: `banner-1544x500.(png|jpg)` (large), `banner-772x250.(png|jpg)` (small)
223+
- Icons: `icon-256x256.*`, `icon-128x128.*`, `icon-64x64.*`, `icon-32x32.*` (`.png`, `.jpg`, `.jpeg`, `.svg`)
224+
- Screenshots: `screenshot-1.(png|jpg|jpeg|gif)`, `screenshot-2.*`, etc.
225+
226+
The best available icon size is chosen in order: 256 → 128 → 64 → 32. Screenshots are displayed in ascending numerical order.
227+
228+
If no assets are found the layout gracefully omits the banner/icon/screenshot areas.
229+
230+
This mirrors the conventions used by WordPress.org so you can visually QA your assets before publishing. Gallery supports:
231+
232+
- Click thumbnail to swap main image
233+
- Arrow key navigation through thumbnails
234+
- Esc returns focus to the gallery container (when implemented in webview focus scope)
235+
- Maintains aspect ratio and centers images on varied panel widths
236+
237+
> Tip: Keep your banner image optimized. WordPress.org expects specific dimensions and reasonable file sizes for performance.
238+
191239
## File Association
192240

193241
The extension automatically activates for:
@@ -255,12 +303,16 @@ Tested up to: 6.3
255303
💡 **Feature Requests:** Suggest improvements for WordPress.org compliance
256304
🔧 **Pull Requests:** Contributions welcome for parser and validation improvements
257305

258-
# Copyright and License
306+
## License
307+
308+
GPL-2.0-or-later © 2025 Per Soderlind
309+
310+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
259311

260-
WordPress Readme Preview is copyright 2025 Per Soderlind
312+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
261313

262-
WordPress Readme Preview is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
314+
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
263315

264-
WordPress Readme Preview is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
316+
---
265317

266-
You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/.
318+
Enjoying the extension? Star the repository or open an issue with feedback. Happy publishing!

example/assets/banner-772x250.jpg

35.8 KB
Loading

example/assets/icon-128x128.jpg

4.67 KB
Loading

example/assets/screenshot-1.png

28.6 KB
Loading

example/assets/screenshot-2.png

51 KB
Loading

example/assets/screenshot-3.png

44.4 KB
Loading

0 commit comments

Comments
 (0)