Apos LilyPond PDF
A VS Code extension that provides a LilyPond-focused PDF preview with bidirectional navigation:
- PDF → source: click a note/location in the PDF and jump to the matching
.ly / .ily location.
- Source → PDF: run a command from a LilyPond source cursor location to reveal and briefly highlight the corresponding PDF location.
- Auto refresh: the custom PDF preview updates when the underlying PDF file is regenerated.
Requirements
- VS Code
1.95+
- Node.js + npm (for building/running from source)
- LilyPond-generated PDFs with point-and-click links enabled
Install (from source)
- Clone this repository.
- Install dependencies:
npm install
- Compile:
npm run compile
- Open the folder in VS Code.
- Press
F5 to launch an Extension Development Host with this extension loaded.
Install (packaged VSIX)
If you want a directly installable extension package:
- Install VSCE:
npm install --global @vscode/vsce
- Package:
vsce package
- In VS Code, run Extensions: Install from VSIX... and select the generated
.vsix file.
Usage
Open PDF preview
- Open a
.pdf file and choose LilyPond PDF Preview when prompted for editor type, or run:
LilyPond PDF: Open Preview
Navigate from source to PDF
- Open a
.ly or .ily file.
- Place the cursor on the source position you want to inspect.
- Run:
LilyPond PDF: Reveal Source Location in PDF
- The matching PDF position is revealed and highlighted briefly.
Choose the development/debug PDF when multiple PDFs exist
If your build emits both a shareable PDF and a point-and-click development PDF, configure:
aposLilypondPdf.preferredPdfSuffixes
aposLilypondPdf.developmentPdfKeywords
The extension first tries suffix matches (in order) and then ranks sibling PDFs using keywords.
Example:
{
"aposLilypondPdf.preferredPdfSuffixes": [
".with-links.pdf",
".dev.pdf",
".pdf"
],
"aposLilypondPdf.developmentPdfKeywords": [
"with-links",
"point-and-click",
"debug"
]
}
Navigate from PDF to source
- In the custom PDF preview, click a mapped note/location annotation.
- The extension opens the linked source file at the corresponding line/column.
Development commands
npm run compile — build TypeScript to out/
npm run watch — watch-mode TypeScript build
npm test — current baseline check (compile)
| |