Self-hosted tool, mainly for Notepad++/npp_exec plugin combo to HTTP redirect user to proper language manual(s) by giving extension and function name in URL.
- Install Notepad++
- Upload
dispatch.php
andmanuals.php
to webserver or... - You can also use PHP's built-in server (run
php -S 127.0.0.1:5666 -t C:\PATH_TO_SCRIPT
) and then URL will be http://127.0.0.1:5666/dispatch.php - Check if everything is working properly, e.g. by checking in browser http://HOSTNAME/dispatch.php?term=strpos&lang=php
- Go to
Plugins menu>Plugin admin...
and search forNppExec
, or download it from author's repo - After restarting N++, go to
Plugins>NppExec
and pressF6
or chooseExecute Nppexec Script...
- In the text box paste contents of
nppExecScript.txt
(remember to set script URL!) - Click on
Save
and give it name (we will use it in the next point) - Go to
Setting>Shortcut Mapper...
and click on the top tabPlugin Commands
. Find your script (by name you used in previous point) and set shortcut. I used NPP's standardALT+F1
.
Just save the file (for language recognition/extension), click or select the command you need to get manual for, press ALT+F1 (see installation, last point)
Figure it out :) Just set your editor to open dispatch.php?term={SELECTED_WORD}&lang={EXTENSION OR TYPE}
Four basic ways, all need editing of manual.php
- Automatic redirect: add array element in format EXTENSION => URL{TERM} where {TERM} will be replaced with current word (e.g.
'php' => 'http://www.php.net/{TERM}'
) - Multiple manuals: add array element with nested array to make
dispatch.php
in formatNAME => URL
show multiple choices (e.g.py => ['Python3' => 'https://docs.python.org/3/search.html?q={TERM}', '3rd party' => 'https://example.com/lrn2write/{TERM}']
- this way for .py files, it will showPython3
, linking to.../3/...
and3rd party
linking to...example.com/lrn2write/
) - Aliases: just set key name to name and value to alias, (e.g.
['php3' => 'php']
will usephp
entry for files with extensionphp3
. Also, if you remember this extenstion, how's your back today? ;)) - Undefined/catch-all: set keyname for * and value to page (or pages, see 2.) which will be shown if no extension is given. This can be also used to ask semiquestions/questions, e.g. selecting 'parsing dom python' with default manuals.php you'll get links to search engine of StackOverflow and Google.
Just one, as this script just redirects you to proper manuals.
Either write an issue or create pull request.