1. How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by K_D_R Dec 23, 2011
- 1862 views
Once again, I am trying to implement context sensitive help with one key stroke. I have not been able to pass the search word to the search box at the top of the index.html page. Actually, what I would really like to do is pass the search word to the java search routine so that when I hit the designated context sensitive help key the browser displays the available options as it would if I typed the search word into the "routine or constant name search" search box and hit the submit key.
Surely, there must be a simple way to accomplish this.
Any help will be appreciated.
Regards,
2. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by K_D_R Dec 27, 2011
- 1696 views
Ok... maybe someone will come up with a way to pass a search word to the local index.html file.
I have been able to pass a search word to the Openeuphoria.org search box, but I have not been able to specific select the available search "opts". It appears that all the items, news, tickets, forum wiki and manual, will be searched. This is how it is done in ed.ex:
system_exec("epiphany " & "http://openeuphoria.org/search/results.wc?s=" & search_word,0)
Attempts to pass a search word to the local index.html with epiphany will spawn two instances of the browser, one opened to the web with the search_word pasted in the google search box and another with the local euphoria index.html open, but without any sign of the search word. Firefox does something similar, but opens multiple tabs, instead of two separate windows. Suffice it to say, the code snippet above is the only thing I have found that really works.
My experience is limited to Linux.
3. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by petelomax Dec 27, 2011
- 1682 views
My experience is limited to Linux.
My experience is limited to Windows.
What happens if you type
epiphany http://openeuphoria.org/search/results.wc?manual=1&s=repeat
in a terminal? (you may need to supply the full path)
In windows, on a very old version of Eu Help, probably 2.3, I ended up doing:
constant lib="abcdeghoprstuz" constant redirect="<html><head>"& "<meta http-equiv=refresh content=\"0;"& "url=file://localhost/%s/HTML/lib_%s_%s.htm#%s\">"& "</head></html>" ... fn = open(redirectfilepath,"w") puts(fn,sprintf(redirect,{helpfilepath,lib[i-1],lib[i],name})) close(fn) ... void = shellExecute(NULL, "open", helpfilepath, NULL, NULL, SW_SHOWNORMAL)
Not that I expect that to be much help.
Pete
4. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by K_D_R Dec 27, 2011
- 1696 views
My experience is limited to Linux.
My experience is limited to Windows.
What happens if you type
epiphany http://openeuphoria.org/search/results.wc?manual=1&s=repeat
in a terminal? (you may need to supply the full path)
Pete
No Joy... Epiphany executes and loads this page: http://openeuphoria.org/search/results.wc?manual=1 In other words it drops everything after 1.
In summary, my experience on Linux, is that you can pass a search word to the openeuphoria.org document search engine with the code:
system_exec("browser " & "http://openeuphoria.org/search/results.wc?s="&search_word, 0)
.. which will produce results as if all the search options had been selected. But this is not too bad, because you can easily thin out the search results by deselecting the unwanted search options and clicking on the Search box "go" button. So, if you have web access, context sensitive help is available with a keystroke and maybe a couple of mouse clicks.
I have not found a way to pass a search word to the local documentation stored in html, compiled html (chm), or *.pdf files. These are the best options I have come up with:
-- to load the euphoria documentation index.html file system_exec("epiphany " & "file:///home/kenneth/euphoria.4.0.3/docs/html/index.html",0) -- to use the euphoria documentation in *.pdf format: system_exec("acroread " & self_command & "euphoria.pdf",0) -- to use the compiled html documentation: system_exec("xchm " & self_command & "eu400uo.chm",0) -- or to pass a search word to the openeuphoria.org documentation search box system_exec("epiphany " & "http://openeuphoria.org/search/results.wc?s="&search_word, 0)
If someone can come up with a way to pass a search word to the search engine for the respective document files, context sensitive help can be available with one keystroke.
Regards
5. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by ne1uno Dec 28, 2011
- 1636 views
... In summary, my experience on Linux, is that you can pass a search word to the openeuphoria.org document search engine with the code:
system_exec("browser " & "http://openeuphoria.org/search/results.wc?s="&search_word, 0)
...
If someone can come up with a way to pass a search word to the search engine for the respective document files, context sensitive help can be available with one keystroke.
a little extra javascript would be needed to parse extra parameters and fill in the javascript search.
to access just the manual/doc search from GET instead of POST, http://openeuphoria.org/search/results.wc?s=BATCH&manual=1
euweb on the forum or any euphoria web turns links like [[man:batch]] into man:batch the source is available somewhere on hg:
you can go to a page directly in a chm if you know the page otherwise the default page will open.
you can start a chm in internet explorer with hh.exe mk:@MSITStore: IE6 or below probably easier, or using hh.exe in windows. the newer help format MSDN uses takes commandline options to initiate a search.
6. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by ne1uno Dec 28, 2011
- 1603 views
I assume you can run wscripts in wine? this works in windows if your editor doesn't handle context sensitive help from selected words automatically. you could link this script to a command.
//usage: openEu4Uchm.js batch //parse commandline options var oArgs = WScript.Arguments; var WshShell = new ActiveXObject("WScript.Shell") WshShell.Run( "c:\\Eu\\eu4chm\\eu410uo.chm") WScript.sleep(3990) //view->index WshShell.SendKeys("%V%N"); WScript.Sleep(800); WshShell.SendKeys(oArgs(0)+"^M"); WScript.Sleep(800); //feel lucky, hit display WshShell.SendKeys("%D");
7. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by K_D_R Dec 29, 2011
- 1547 views
[quote ne1uno]
... In summary, my experience on Linux, is that you can pass a search word to the openeuphoria.org document search engine with the code:
system_exec("browser " & "http://openeuphoria.org/search/results.wc?s="&search_word, 0)
...
If someone can come up with a way to pass a search word to the search engine for the respective document files, context sensitive help can be available with one keystroke.
a little extra javascript would be needed to parse extra parameters and fill in the javascript search.
This is certainly beyond my ability. Could this feature be added by the developers to the next release?
to access just the manual/doc search from GET instead of POST, http://openeuphoria.org/search/results.wc?s=BATCH&manual=1
I followed all the links listed on the page generated by the url referenced above and I am still clueless as to the difference between "GET" and "POST" is.
Ditto - no joy.
you can go to a page directly in a chm if you know the page otherwise the default page will open.
To a page? Using xchm to run eu400uo.chm I see no page numbers, only links to sections such as as "4.8.1 include statement". I suppose you are saying that you can go to a specific section, if you know the page you want to go to, right? But specifically how do I pass that information to eu400uo.chm?
In gnome-terminal I type xchm eu400.chm which opens eu400.chm to section "3 Using Euphoria".
The format for xchm usage is:
xchm [-c <num>] [-t] [-i] [-h] [file] -c, --contextid=<num> context-Id to open in file, requires that a file be specified -t, --notopics don't load the topics tree -i, --noindex don't load the index -h, --help displays this message.
The section number for db_open is 8.28.8.3, but when I enter:
xchm -c 8.28.8.3 eu400uo.chm Usage: xchm [-c <num>] [-t] [-i] [-h] [file] -c, --contextid=<num> context-Id to open in file, requires that a file be specified -t, --notopics don't load the topics tree -i, --noindex don't load the index -h, --help displays this message. '8.28.8.3' is not a correct numeric value for option 'c'.
None-the-less, your comments are deeply appreciated.
Regards, Kenneth Rhodes
8. Re: How do you pass a search word to the Euphoria documentation index.html search box?
- Posted by ne1uno Dec 29, 2011
- 1455 views
... In summary, my experience on Linux, is that you can pass a search word to the openeuphoria.org document search engine with the code:
system_exec("browser " & "http://openeuphoria.org/search/results.wc?s="&search_word, 0)
...
If someone can come up with a way to pass a search word to the search engine for the respective document files, context sensitive help can be available with one keystroke.
[/quote] POST is what happens when you click on a search form on a web page, the parameters is added to the cgi environment. GET is where the parameters are part of the URL. try this:
system_exec("browser " & "http://openeuphoria.org/search/results.wc?s="&search_word&"&manual=1", 0)
The format for xchm usage is:
xchm [-c <num>] [-t] [-i] [-h] [file] -c, --contextid=<num> context-Id to open in file, requires that a file be specified -t, --notopics don't load the topics tree -i, --noindex don't load the index -h, --help displays this message.
the CHM doesn't currently have contextid numbers. they could be added, but then you would need to lookup the contextid first. I'm surprised there is no option to load the index with a search word. maybe it's undocumented or a future feature.