Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Show Markdown File" - Linux compatibility #43

Open
hektor opened this issue Apr 29, 2023 · 1 comment
Open

"Show Markdown File" - Linux compatibility #43

hektor opened this issue Apr 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@hektor
Copy link

hektor commented Apr 29, 2023

Would it be possible implement "Show Markdown File" on Linux? At this time it just opens the parent directory (which is kind of useless as you would still have to look up the file).

showSelectedItemMarkdownInFilesystem: function (idx) {

        const entry_res = this._getSelectedEntry(idx);

        const file = new FileUtils.File(OS.Path.normalize(entry_res.path));
        if (file.exists()) {
            try {
                Zotero.debug("MarkDBconnect: Revealing " + file.path);
                file.reveal();
            } catch (e) {
                // On platforms that don't support nsIFile.reveal() (e.g. Linux),
                // launch the parent directory
                Zotero.launchFile(file.parent);
            }
        }
    },

I was thinking of running xdg-open with file.path as argument, but am not sure if/how this would be possible.

@daeh
Copy link
Owner

daeh commented Apr 29, 2023

My choice of implementation for linux was based on Zotero's, e.g.

https://github.com/zotero/zotero/blob/2f0d41c0cb9ea47cce03ea51bf8ac718dbe44b15/chrome/content/zotero/zoteroPane.js#L4922

I don't have easy access to a linux platform so it's not easy for me to test other solutions. And given that this is the best solution that Zotero came up with, it's not a feature I'm going to prioritize.

That said, if you (or anyone) find something that works I'd be happy to add it.

@daeh daeh added the enhancement New feature or request label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants