1. euphoria.pdf help file viewing
- Posted by K_D_R Mar 24, 2016
- 1257 views
I have enjoyed viewing the euphoria.pdf file using "evince", the Ubuntu default pdf viewer. It seems that the pdf help document can make some information more easily accessible than the straight *.html documentation which seems to excel at providing specific keyword information much faster using the WEE editor. It is a simple matter to add a menu option to display the euphoria.pdf file with evince. It was also very easy to configure evince to search for a word when there is no Gtk help, no html article and no routine declaration to view. Here is a simple of simple command line program that might be helpful.
-- -- EuPDFhelp.e -- include std/console.e include std/text.e include std/filesys.e constant pdf_reader = "evince" -- adjust for your system or preference constant eui = "eui" global procedure getpdfhelp(sequence topic = "") sequence help help = locate_file( eui, getenv("PATH") ) help = help[1..length(help)-(length(eui)+4)] & "docs" &SLASH& "euphoria.pdf" system_exec(pdf_reader &" "& help & " -l "& topic) end procedure
WEE users can include EuPDFhelp.e just before the procedure view_declaration() in the file wee.exw and then add the following "else" clause toward the end of view_declaration:
if equal(decls[i][1], word) then goto_pos(decls[i][2], length(word)) exit else ---< -- no declaration, search PDF help file ---< getpdfhelp(word)---< exit--< end if
-- -- EuPDFhelp.ex -- command line front end EuPDFhelp.ex -- include EuPDFhelp.e include std/text.e include std/console.e sequence cl cl = command_line() if length(cl) >= 3 then cl = cl[3] else cl = prompt_string("Enter search topic: ") end if cl = trim(cl) -- getpdfhelp(cl)