Skip to content

Commit 18f2e22

Browse files
committed
Refactor 'What's New' notification and update docs
1 parent f905ec8 commit 18f2e22

5 files changed

Lines changed: 33 additions & 38 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
*.vsix
55
/.idea
66
.vscode/
7+
.yarn/

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
1919
## ✨ Features
2020

21-
- 🖼️ **Live Preview** — View EPS and PS files side-by-side with your code
22-
- 🔍 **Pan & Zoom** — Smooth SVG-based pan and zoom controls
23-
- 📄 **Multi-Page Support** — Navigate through multi-page PostScript documents
24-
- 🎨 **Theme Support** — Automatic light/dark mode matching VS Code theme
25-
- 🖌️ **Background Color Picker** — Customize preview background color
26-
- 📝 **Console Output** — View GhostScript output (from `==`, `print`, etc.)
27-
- ⚙️ **Custom Paths** — Configure paths to GhostScript and Poppler tools
28-
- 🔄 **Auto-Refresh** — Preview updates automatically when you save
21+
- **Live Preview** — View EPS and PS files side-by-side with your code
22+
- **Pan & Zoom** — Smooth SVG-based pan and zoom controls
23+
- **Multi-Page Support** — Navigate through multi-page PostScript documents
24+
- **Theme Support** — Automatic light/dark mode matching VS Code theme
25+
- **Background Color Picker** — Customize preview background color
26+
- **Console Output** — View GhostScript output (from `==`, `print`, etc.)
27+
- **Custom Paths** — Configure paths to GhostScript and Poppler tools
28+
- **Auto-Refresh** — Preview updates automatically when you save
2929

3030
<img src="https://github.com/ahnafnafee/PostScript-Preview/raw/master/demo/postscript-preview-demo.gif" alt="PostScript Preview Demo" style="zoom:50%;" />
3131

@@ -86,7 +86,7 @@ C:\ProgramData\chocolatey\lib\poppler\tools
8686

8787
</details>
8888

89-
## ⚙️ Configuration
89+
## Configuration
9090

9191
Configure custom executable paths in VS Code settings (useful for conda environments or non-standard installations):
9292

@@ -105,7 +105,7 @@ Example `settings.json`:
105105
}
106106
```
107107

108-
## 📄 Multi-Page Documents
108+
## Multi-Page Documents
109109

110110
For PostScript files with multiple `showpage` commands, navigation controls appear automatically:
111111

@@ -114,25 +114,25 @@ For PostScript files with multiple `showpage` commands, navigation controls appe
114114

115115
The preview resets to page 1 when the source file is modified.
116116

117-
## 📝 Console Output
117+
## Console Output
118118

119119
View GhostScript output in VS Code:
120120

121121
1. Open Output panel (`Ctrl+Shift+U` / `Cmd+Shift+U`)
122122
2. Select **"PostScript-Preview"** from the dropdown
123123
3. Output from `==`, `print`, and other operators will appear here
124124

125-
## 🐛 Known Issues
125+
## Known Issues
126126

127127
None currently. [Report issues here](https://github.com/ahnafnafee/PostScript-Preview/issues).
128128

129-
## 🙏 Credits
129+
## Credits
130130

131131
- [mkvoya/eps-preview](https://github.com/mkvoya/eps-preview) — Original base extension
132132
- [svg-pan-zoom](https://github.com/bumbu/svg-pan-zoom) — Pan and zoom library
133133
- [pickr](https://github.com/Simonwep/pickr) — Color picker library
134134

135-
## 🛠️ Development
135+
## Development
136136

137137
See [TESTING.md](TESTING.md) for local development instructions.
138138

@@ -142,7 +142,7 @@ yarn compile
142142
# Press F5 in VS Code to launch Extension Development Host
143143
```
144144

145-
## 📄 License
145+
## License
146146

147147
[MIT](LICENSE)
148148

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "postscript-preview",
33
"displayName": "PostScript Preview",
44
"description": "PostScript Preview is an extension that helps to preview EPS and PS files in Visual Studio Code.",
5-
"version": "0.5.2",
5+
"version": "0.5.3",
66
"icon": "images/logo.png",
77
"publisher": "ahnafnafee",
88
"engines": {
@@ -72,7 +72,6 @@
7272
"compile": "tsc -p ./",
7373
"lint": "eslint src --ext ts",
7474
"watch": "tsc -watch -p ./",
75-
"pretest": "npm run compile",
7675
"test": "node ./out/test/runTest.js"
7776
},
7877
"devDependencies": {

src/extension.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ export function activate(context: vscode.ExtensionContext): void {
1818

1919
if (isWindows) {
2020
console.log("PostScript Preview: Checking for updates (Windows)...");
21-
showWhatsNew(context).catch((error) => {
22-
console.error(
23-
"PostScript Preview: Failed to show whats new notification:",
24-
error
25-
);
26-
});
21+
showWhatsNew(context);
2722
}
2823

2924
const channel = vscode.window.createOutputChannel("PostScript-Preview");

src/whats-new.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function isMajorUpdate(
3434
/**
3535
* Show "What's New" notification on version update
3636
*/
37-
export async function showWhatsNew(context: ExtensionContext): Promise<void> {
37+
export function showWhatsNew(context: ExtensionContext): void {
3838
const previousVersion = context.globalState.get<string>(extensionId);
3939
const extension = extensions.getExtension(extensionId);
4040
const currentVersion = extension?.packageJSON?.version;
@@ -53,19 +53,19 @@ export async function showWhatsNew(context: ExtensionContext): Promise<void> {
5353
// show whats new notification:
5454
const actions = [{ title: "See Requirements" }];
5555

56-
const result = await window.showInformationMessage(
57-
`PostScript Preview v${currentVersion} — READ NEW REQUIREMENTS!`,
58-
...actions
59-
);
60-
61-
if (result !== null) {
62-
if (result === actions[0]) {
63-
await env.openExternal(
64-
Uri.parse(
65-
"https://github.com/ahnafnafee/PostScript-Preview#windows"
66-
)
67-
);
68-
}
69-
}
56+
window
57+
.showInformationMessage(
58+
`PostScript Preview v${currentVersion} — READ NEW REQUIREMENTS!`,
59+
...actions
60+
)
61+
.then((result) => {
62+
if (result !== null && result === actions[0]) {
63+
env.openExternal(
64+
Uri.parse(
65+
"https://github.com/ahnafnafee/PostScript-Preview#windows"
66+
)
67+
);
68+
}
69+
});
7070
}
7171
}

0 commit comments

Comments
 (0)