Skip to content

Commit

Permalink
Merge pull request #13 from ahnafnafee/fix-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnafnafee authored Sep 23, 2024
2 parents 63e0462 + b32a577 commit 87b8237
Show file tree
Hide file tree
Showing 8 changed files with 293 additions and 175 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build extension

on:
push:
branches: ["master"]

jobs:
build:
runs-on: ubuntu-latest
name: Build and package
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
npm install -g @vscode/vsce
npm ci
- name: Get NPM Version
id: package-version
uses: martinbeentjes/[email protected]
- name: Build extension
run: vsce package -o postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
path: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
if-no-files-found: error
- name: Create release with artifact
if: ${{ success() && steps.package-version.outputs.current-version }}
uses: softprops/action-gh-release@v1
with:
name: Release v${{ steps.package-version.outputs.current-version }}
draft: false
files: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
36 changes: 36 additions & 0 deletions .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish extension

on:
release:
types: [published]

jobs:
openvsx:
name: "Open VSX Registry"
if: endsWith(github.event.release.assets[0].name, '.vsix')
runs-on: ubuntu-latest
steps:
- name: Download release artifact
run: "curl -L -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H 'Accept: application/octet-stream' ${{ github.event.release.assets[0].url }} --output extension.vsix"
- name: Validate extension file
run: unzip -f extension.vsix extension/package.json
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: extension.vsix
vs:
name: "Visual Studio Marketplace"
if: endsWith(github.event.release.assets[0].name, '.vsix')
runs-on: ubuntu-latest
steps:
- name: Download release artifact
run: "curl -L -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H 'Accept: application/octet-stream' ${{ github.event.release.assets[0].url }} --output extension.vsix"
- name: Validate extension file
run: unzip -f extension.vsix extension/package.json
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: extension.vsix
54 changes: 22 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,50 @@
# Change Log

## [0.4.4] - 2024-09-23

- Fixed README issues
- Added doc to pin to version 0.89.0 for poppler on Windows
- Added auto-refresh capability

## [0.4.0] - 2021-11-11

- Fixed pdf conversion error
- Updated README with new instructions


- Fixed pdf conversion error
- Updated README with new instructions

## [0.3.2] - 2021-11-11

- Fixed README instructions
- Version bump


- Fixed README instructions
- Version bump

## [0.3.1] - 2021-10-22

- Version bump


- Version bump

## [0.3.0] - 2021-10-11

- Fixed controller scrolling
- Added instructions for Ubuntu install


- Fixed controller scrolling
- Added instructions for Ubuntu install

## [0.2.3] - 2021-10-09

- Added option to hide controls
- Fixed container sizing issue
- Switched controller positioning


- Added option to hide controls
- Fixed container sizing issue
- Switched controller positioning

## [0.2.1] - 2021-10-08

- Fixed requirement instructions


- Fixed requirement instructions

## [0.2.0] - 2021-10-08

- Added support for SVG Pan and Zoom
- Added support for changing background color of preview window

- Fixed issue with Windows 10 preview
- Added support for SVG Pan and Zoom
- Added support for changing background color of preview window

- Fixed issue with Windows 10 preview

## [0.1.0] - 2020-07-19

- Basic functionality of EPS preview.
- A command to invoke the preview.
- A preview icon in the menu bar for open EPS file.
- README and CHANGELOG files.
- Basic functionality of EPS preview.
- A command to invoke the preview.
- A preview icon in the menu bar for open EPS file.
- README and CHANGELOG files.
55 changes: 36 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
<a href="https://marketplace.visualstudio.com/items?itemName=ahnafnafee.postscript-preview"><img src="https://img.shields.io/visual-studio-marketplace/azure-devops/installs/total/ahnafnafee.postscript-preview?logo=visualstudiocode&style=for-the-badge" alt="Installs" /></a>
</p>




<p align="center">
<img src="https://github.com/ahnafnafee/PostScript-Preview/raw/master/images/logo.png" alt="Logo" width="128px" height="auto" />
</p>
Expand All @@ -15,33 +12,26 @@
<a title="READ REQUIREMENTS AFTER INSTALL" href="#requirements"><img src="https://github.com/ahnafnafee/PostScript-Preview/raw/master/docs/images/req-btn.png" alt="Read Requirements After Install"></a>
</p>


<h1 align="center">PostScript Preview</h1>



> PostScript Preview is an extension that helps to **preview** EPS and PS files in [Visual Studio Code](https://code.visualstudio.com/). It supercharges how your view PostScript files by also allowing to **pan** and **zoom** the image. You can also change the preview background for extra **customizations**.


## Features

This extension enables the in-VSCode preview of EPS image files.
A new command `postscript-preview.sidePreview` is added as well as a preview icon in the menu bar when EPS or PS files are open in VSCode.

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



## Requirements

This extension depends on the `PostScript Language` extension to recognize EPS/PS file.
You can install that [extension](https://marketplace.visualstudio.com/items?itemName=mxschmitt.postscript) from the VSCode extension store.

This extension also depends on two commands:

- `ps2pdf` - to first convert the EPS/PS file to PDF (the command is part of GhostScript)
- `pdftocairo` - to convert the generated pdf to svg which is shown in the preview
- `ps2pdf` - to first convert the EPS/PS file to PDF (the command is part of GhostScript)
- `pdftocairo` - to convert the generated pdf to svg which is shown in the preview

Thus you need to install these two commands first and ensure they are in the executable path.

Expand All @@ -51,6 +41,7 @@ You can install them via [homebrew](https://brew.sh/):

```bash
brew install ghostscript
brew install poppler
```

### **Ubuntu**
Expand All @@ -59,21 +50,27 @@ You can install them using the following commands:

```bash
sudo apt-get install ghostscript -y
sudo apt-get install poppler-utils -y
```

### **Windows**

You need to have GhostScript installed in your system. You can install them via [Chocolatey](https://chocolatey.org/install). Run the following commands using an **Administrative PowerShell**.

Installs GhostScript for _ps2pdf_

```bash
choco install ghostscript --version 9.55.0 --force -y
```

Installs _pdftocairo_

```bash
choco install poppler -y
choco install poppler --version 0.89.0 -y --force
```

Adds the executables to the environment path

```bash
[Environment]::SetEnvironmentVariable("Path",[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";C:\Program Files\gs\gs9.55.0\lib;C:\Program Files\gs\gs9.55.0\bin;C:\ProgramData\chocolatey\lib\poppler\tools",[EnvironmentVariableTarget]::Machine)
```
Expand All @@ -87,19 +84,39 @@ C:\Program Files\gs\gs9.55.0\lib
C:\Program Files\gs\gs9.55.0\bin
C:\ProgramData\chocolatey\lib\poppler\tools
```
_Please verify that you can view files in the above folders. If the folders do not exist, you might have run into issues with your installation. It's good to close Logitech GHUB and Logitech GHUB Updater when you install these as they might interfere with the process._

_Please verify that you can view files in the above folders. If the folders do not exist, you might have run into issues with your installation. It's good to close Logitech GHUB and Logitech GHUB Updater when you install these as they might interfere with the process._

## Known Issues

None yet. If you run into issues, please report them here: https://github.com/ahnafnafee/PostScript-Preview/issues
None yet. If you run into issues, please report them here: <https://github.com/ahnafnafee/PostScript-Preview/issues>

You are also encouraged to open pull requests for additional features and fixes you want to add to this extension.

## Credits

- [mkvoya/eps-preview](https://github.com/mkvoya/eps-preview) for the original base extension
- [bumbu/svg-pan-zoom](https://github.com/bumbu/svg-pan-zoom) for the SVG Pan Zoom library
- [Simonwep/pickr](https://github.com/Simonwep/pickr) for the color picker library

## Installing Locally (for Development Purposes)

## Credits
Install the VSCode Publishing Extension

```bash
npm install -g @vscode/vsce
```

Package the extension:

```bash
vsce package
```

Publish the extension:

```bash
vsce publish
```

- [mkvoya/eps-preview](https://github.com/mkvoya/eps-preview) for the original base extension
- [bumbu/svg-pan-zoom](https://github.com/bumbu/svg-pan-zoom) for the SVG Pan Zoom library
- [Simonwep/pickr](https://github.com/Simonwep/pickr) for the color picker library
See published extensions here: <https://marketplace.visualstudio.com/manage>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"name": "postscript-preview",
"displayName": "PostScript Preview",
"description": "PostScript Preview is an extension that helps to preview EPS and PS files in Visual Studio Code.",
"version": "0.4.2",
"version": "0.4.4",
"icon": "images/logo.png",
"publisher": "ahnafnafee",
"engines": {
"vscode": "^1.46.0"
},
"categories": [
"Other"
],
"categories": ["Other"],
"author": {
"name": "Ahnaf An Nafee",
"email": "[email protected]"
Expand All @@ -19,12 +17,7 @@
"color": "#4B7D78",
"theme": "dark"
},
"keywords": [
"postscript",
"ghostscript",
"ps",
"preview"
],
"keywords": ["postscript", "ghostscript", "ps", "preview"],
"activationEvents": [
"onCommand:postscript-preview.sidePreview",
"onLanguage:postscript"
Expand Down Expand Up @@ -77,5 +70,8 @@
"repository": {
"type": "git",
"url": "https://github.com/ahnafnafee/PostScript-Preview.git"
},
"sponsor": {
"url": "https://github.com/sponsors/ahnafnafee"
}
}
Loading

0 comments on commit 87b8237

Please sign in to comment.