GithubHelp home page GithubHelp logo

lhl2617 / vslilypond-pdf-preview Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 8.0 11.88 MB

Provides PDF Preview for LilyPond-generated PDFs. Supports point-and-click from PDF to source code.

Home Page: https://marketplace.visualstudio.com/items?itemName=lhl2617.lilypond-pdf-preview

License: MIT License

TypeScript 99.23% CSS 0.77%
vscode lilypond pdf-preview

vslilypond-pdf-preview's Introduction

LilyPond PDF Preview

Visual Studio Marketplace Visual Studio Marketplace

Provides PDF Preview for LilyPond-generated PDFs. Supports point-and-click from PDF to source code.

Included in the VSLilyPond extension.

Features

Two-way Point and Click ๐Ÿ“„

Forward (Score to PDF)

Forward Point-and-Click

Backward (PDF to Score)

Backward Point-and-Click

Requirements

  • (Optional but recommended): VSLilyPond -- Provides advanced LilyPond language support

Usage Guide

  • Open your LilyPond-compiled PDF in VSCode using the LilyPond PDF Preview option. If you have multiple PDF previewer extensions, make sure that you choose LilyPond PDF Preview when opening the file. Step 1 Step 2

  • Forward point-and-click

    • Click on the code location you are interested in, then execute the LilyPond PDF Preview: Go to PDF location from Cursor command
      • Press Ctrl/Cmd + Shift + P to open the Command Palette
      • It is advisable to bind a shortcut to this feature as you please via the Command Palette
  • Backward point-and-click

    • Click on any of the noteheads etc..

Extension Settings

Issues

Please submit issues in the GitHub repository.

Contributing

Development

Requirements

Setup

  • Clone repository

    git clone https://github.com/lhl2617/VSLilyPond-PDF-preview
  • Install npm dependencies

    npm i
  • Hit F5 to run an Extension Development Host.

    See here for a detailed extension development guide.

Releasing

Releasing is done automatically via GitHub Actions. Bump the version in package.json and update CHANGELOG.md before merging into the default branch.

Acknowledgements

  • This extension is based on tomoki1207/vscode-pdf, licensed under the MIT License.
  • This extension bundles pdf.js, licensed under the Apache License 2.0.

vslilypond-pdf-preview's People

Contributors

aron-hanowski avatar dependabot[bot] avatar imgbotapp avatar lhl2617 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vslilypond-pdf-preview's Issues

Confused as to what this plugin does

Hi. I thought this plugin made VS into something like Frescobaldi - when I save my .ly file the plugin will display the PDF in a side window.
But it seems each time you save you have to convert and open the PDF yourself? All this plugin does is allow you to click on a section of the PDF and jump to a spot in the code? Is that right? The documentation doesn't make the purpose clear to me.

"Go to PDF location from cursor" keeps opening pdf as a new tab

Hi, I am having problems with using the "Go to PDF location from cursor" function. I have the .ly file open to the left side and the pdf open on the right side. When using the "Go to PDF location from cursor" it closes my pdf on the right side and reopens the pdf as a new tab. Thanks for the help.

[Bug Report][Windows 10] Both Point-and-Clicks failed when blank space exist on the file path

First of all, I want to say thank you.

I'm a newbie for LilyPond, this VSLilyPond plugin really helps me a lot, it is awesome.


I met this problem when I try using VSLilyPond:

  1. When Forward (Score to PDF), the error message is:
[ERROR]: Error: No valid PDF location can be found from the cursor
  1. When Backward (PDF to Score), the error message is:
[ERROR]: Error: cannot open file:///e%3A/LilyPond%2520Sheet/test.ly. Detail: Unable to read file 'e:\LilyPond%20Sheet\test.ly' (Error: Unable to resolve nonexistent file 'e:\LilyPond%20Sheet\test.ly')

And it works as expect if I change the folder name from LilyPond Sheet to just LilyPond.

I check the code, maybe we should use decodeURIComponent for fsPath here? https://github.com/lhl2617/VSLilyPond-PDF-preview/blob/master/src/extension/pdf-goto.ts#L86

I'm not familiar with VSCode plugin development, please forgive me if I'm wrong.

Feature request: Focus code with point and click

In my setup, I do a vertical split. On the left I have my LilyPond code and on the right I have the PDF preview.

When I click on a note in the PDF with point and click, the note gets highlighted and the cursor gets moved, but the code tab / split doesn't get focused.

If instead I don't have a vertical split and the code and PDF share the same window, then vscode will switch to the code tab and it will be correctly focused.

Sidebar reopens on refresh

When I edit the LilyPond text file and save, the PDF gets regenerated and the sidebar is toggled back on after the refresh.

Ability to set the background colour of the page

Hey there, hope you're doing well.

I was wondering if you would allow users to set the background colour of the preview page (similar to Frescobaldi). The pure white is really harsh on the eyes, especially with a dark VS Code theme. I prefer an old paper background colour such as Little Greene Old Paper.

Thanks heaps
Fotis

Won't refresh automatically

Operating system: MacOs 14.1.1
Version: 0.2.8
By saving and compiling, the pdf tab won't refresh automatically.
I don't know if it was a bug or I did something wrong in the settings.
Please help, thank you.

The PDF does not refresh

Hi,

When I am recompiling, the PDF file does not refresh. I see no error message in the output of VS Code.
Maybe there is something wrong with my setup?
I am using LilyPond PDF Preview v0.2.8 with VSLilyPond v1.7.3.
Any clue?
With the auto-refresh it would be the perfect user experience.
Thanks, great plugin.

Fred

Publish VSLilyPond-PDF-preview to Open VSX

Dear extension author,
Please publish this extension to the Open VSX marketplace.

Context

Unfortunately, as Microsoft prohibits usages of the Microsoft marketplace by any other products or redistribution of .vsix files from it, in order to use VS Code extensions in non-Microsoft products, we kindly ask that you take ownership of the VS Code extension namespace in Open VSX and publish this extension on Open VSX.

What is Open VSX? Why does it exist?

Open VSX is a vendor neutral alternative to the MS marketplace used by most other derivatives of VS Code like VSCodium, Gitpod, OpenVSCode, Theia-based IDEs, and so on.

You can read on about Open VSX at the Eclipse Foundation's Open VSX FAQ.

How can you publish to Open VSX?

The docs to publish an extension can be found here. This process is straightforward and shouldn't take too long. Essentially, you need an authentication token and to execute the ovsx publish command to publish your extension. There's also a doc explaining the whole process with an example GitHub Action workflow.

CJK glyph display issue with Harano Aji font

When displaying this file using VSLilyPond-PDF-preview (VSLilyPond v1.7.3), no character is displayed.
The file displays correctly with tomoki1207.pdf v1.2.0 and Adobe Acrobat Reader DC.

It was generated with the following code (requires the Harano Aji fonts installed on the system) using LilyPond 2.23.7:

\version "2.22.0"
\header { tagline = "" }
\markup {
  \override #'(font-name . "Harano Aji Mincho")
  { ่ฆ‹ }
}

This seems to only affect the Harano Aji fonts and not other Japanese fonts like Noto Sans or IPAex.

textedit protocol is parsed badly(?)

In the textedit protocol, a link will look like this: textedit://c:/super-lilypond.ly:34:2:3

Multiple variables can be extracted:

  • file: c:/super-lilypond.ly
  • line: 34
  • char: 2
  • column: 3

When I click on a note, it looks like I end up at column + 1 which puts the cursor to the right of a note instead of at the start.
(For a note like ees, the cursor ends up at e|es instead of |ees.)

Both Point-and-Clicks fails with big files from 2nd page onwards.

Stumbled upon debugging, will update here with MWE. Seems to be occurring with multi-instrument big files.

I think it is due to textlayerrendered being fired immediately when the first page's text layer was rendered and that occurred before the second page's loading? But that doesn't make sense, because then the backward point-and-click wouldn't work.

Formatter hangs when saving files (with format-on-save)

When I try to save a lilypond document, and the lilypond formatter runs automatically (due to format-on-save), the "Saving" dialog just spins until I hit cancel. I have tried waiting upwards of 3 minutes and it still is just sitting there.

As a test case, I am using this simple file:

{
  c' e' g' e'
          }

As far as I can tell from the exthost logs, the formatter seems to be executing successfully within moments:

%  tail -f 3-VSLilyPond\ Formatter.log
[COMMAND]: /Users/chris/.pyenv/versions/3.10.0/bin/python -c "import ly"
[LOG]: Reformatting "/Users/chris/projects/lilypond/example.ly" with "/Users/chris/.pyenv/versions/3.10.0/bin/python", timeout: "10000ms"
[COMMAND]: /Users/chris/.pyenv/versions/3.10.0/bin/python -m ly reformat /Users/chris/projects/lilypond/example.ly
[LOG]: Formatting succeeded.

However, the UI does not seem to notice this and the contents of the editor are never updated with the reformatted version.

I can also run the same command and see that it runs without problem:

% time /Users/chris/.pyenv/versions/3.10.0/bin/python -m ly reformat /Users/chris/projects/lilypond/example.ly
\

{
  c' e' g' e'
}
/Users/chris/.pyenv/versions/3.10.0/bin/python -m ly reformat   0.07s user 0.01s system 95% cpu 0.094 total

Any ideas on what's going on here?

Ctrl+Click zooms do not persist

In pdf.js ctrl+click zooms do not persist--none of the eventBus events reflect this except for updateviewarea, which unfortunately is too broad and will reset when the PDF changes (e.g. due to compilation)

Find a way to persist sidebar settings

When the PDF is recompiled the sidebarviewchanged event is fired before the new PDF is loaded, resetting all the settings to be persisted. The sidebar therefore reappears because it defaults to appearing (so annoying).

Currently we have it always closed on any load.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.