izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Opening PDF from markdown-themeable-pdf #80

Closed cakebake closed 8 years ago

cakebake commented 8 years ago

I just had the idea, to open/update a PDF-file which was generated by the package cakebake/markdown-themeable-pdf with your package - if it is installed.

What do you think about?

Is there an easy way I can appeal in your code? Open from path, update view, ... :)

izuzak commented 8 years ago

That's a neat idea, but it's something that would need to be implemented in https://github.com/cakebake/markdown-themeable-pdf, not here. For example, there's a package which compiles PDFs from latex documents, and supports opening those PDFs with this package: https://github.com/thomasjo/atom-latex.

Let me know if I misunderstood your suggestion. :)

cakebake commented 8 years ago

My reasoning was, that my package creates PDF's and your package displays them. I do not think, that markdown-themeable-pdf should display them, that was not the aim and the focus would be lost.

As I said, it was just an idea. ;) If there would be a command like atomPdfView.show(path);, it would be easy to trigger it from another package.

izuzak commented 8 years ago

If there would be a command like atomPdfView.show(path);, it would be easy to trigger it from another package.

There already is such a command, but not in pdf-view -- it's a general command for all files:

atom.workspace.open("path/to/file.pdf")

Atom then opens the file with the correct "opener" for that file type. If you have pdf-view installed and a the file ends with .pdf, then pdf-view's opener is triggered.

Does that explain things?

cakebake commented 8 years ago

Yeah, well ... that's very awesome: D Why simple when it can be so complicated.^^

I will implement this in next version :) Thanks for the hint!!

cakebake commented 8 years ago

Do you know how I can determine if an opener is registered? I could not find a suitable option ...

izuzak commented 8 years ago

I don't think that's possible. Here's how that other package I mentioned is doing this:

https://github.com/thomasjo/atom-latex/blob/c272bbf1813bf243f30a0ad5c8044953c68e24db/lib/latex.js#L131

cakebake commented 8 years ago

Thank you for your help and the package pdf-view :)