PythonScript
PythonScript copied to clipboard
Open documentation if HTML files are not associated with a browser
STR: Associate HTML files with NPP. Python -> Context Help.
Result: Can not open file...
Suggested: An option to manually add the preferred browser's path for Help.
Thanks.
@Yaron10 Which Windows version do you use? In my case Win10 I get a popup to select the program which should be used to open the local help files.
@chcg,
Windows 7. NPP 7.8.
In v1.51 Context Help
opens http://npppythonscript.sourceforge.net/docs/1.5.1.0
in Firefox (Error type: 404).
In v1.5.0 - if HTML files are associated with my default browser, it works properly.
However, if HTML files are associated with NPP, I get the following message.
Have you associated HTML files with NPP? Open with -> Select default program -> Always use this program.
Thanks.
Why would one want Pythonscript HTML help files associated with N++ so that they open there?
I edit HTML files in Firefox source code and add-ons.
@Yaron10 Thanks for the hint with version 1.5.1. Indeed I did a wrong path change in https://github.com/bruderstein/PythonScript/blob/master/PythonScript/src/HelpController.cpp.
::ShellExecute(m_hNotepad, L"open", pszOut, helpFile.c_str(), NULL, SW_SHOWNORMAL);
seems to cause the problem with n++ as html viewer.
Shouldn't it be _T("\\plugins\\doc\\PythonScript")
?
This is still the structure in NPP 7.8.
I'd like to clarify that I do not want the help files to be opened in NPP but in Firefox. This is a minor issue and you can close it if you think that most users have HTML files associated with a browser.
It is a minor issue, but it seems wrong to close it. :-)
@sasumner,
So be it. :)
I've forked this repo and modified HelpController.cpp for my personal use. How do I make AppVeyor build the DLL with my changes?
Thanks.
An option to add a browser path can be achieved without any UI changes.
Add SETTING/BrowserPath/""
to PythonScriptStartup.cnf. If not empty - use the specified path.
With https://github.com/bruderstein/PythonScript/releases/tag/v1.5.2 the path matches to the changed structure. Just one zip package could be downloaded by PluginAdmin and all the data is extracted to /plugin/pythonscript. So also the doc folder will be there now. @Yaron10 Have you registered your github account at https://ci.appveyor.com/login? If yes you need to add pythonscript as accessible project.
In general it is difficult to guess with which programm the html help should be viewed, if it should no be the chosen default programm. Maybe there is a registry key for the default browser. @Yaron10 Would that be work in your case?
See https://stackoverflow.com/questions/32354861/how-to-find-the-default-browser-via-the-registry-on-windows-10 and https://stackoverflow.com/questions/28433388/windows-registry-key-for-default-browser and https://social.msdn.microsoft.com/Forums/vstudio/en-US/77bdea9b-59bd-41ae-9780-18c49b76aba7/getting-default-browser-information-and-executable-path?forum=vclanguage
@chcg,
Have you registered your github account at https://ci.appveyor.com/login?
:+1: Thank you very much! I wish I had known that earlier.
and all the data is extracted to /plugin/pythonscript. So also the doc folder will be there now.
Downloading NPP 7.8 portable, there's a Doc
folder under Plugins
.
That's why I asked if it shouldn't be _T("\\plugins\\doc\\PythonScript")
.
But actually your structure is better and makes more sense.
Maybe there is a registry key for the default browser...
Thanks for that too.
[HKEY_CLASSES_ROOT\FirefoxURL\shell\open\command]
[HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\command]
Setting a browser as "Windows default browser" normally means opening external links and local HTML files in that browser.
I have changed the default program for local HTML files from Firefox to NPP. Firefox is still my "default browser" for external links.
EDIT. I usually want to edit local HTML files and open them in NPP. I want to view Python's help files and open them in Firefox.