PtokaX forum

Development Section => HOW-TO's => Topic started by: Mardeg on 18 July, 2004, 00:14:47

Title: accessing Lua helpfile directly from an editor
Post by: Mardeg on 18 July, 2004, 00:14:47
The helpfile in use here can be found at ftp://ftp.clanwos.org/pub/ebooks/Programming_in_Lua.chm
mirror: http://www.plop.nl/lua_tools/Programming_in_Lua.chm

This will allow you to go directly to a topic in the helpfile when you press F1 if the word the cursor is currently at in the editor is in the helpfile's index, otherwise it will just open the index at the closest word.

1. In Crimson editor (//www.crimsoneditor.com) Open Preferences dialog box (Tools -> Preferences) and select User Tools page
2. Select an empty slot and fill with the following arguments.
    - Menu Text: Lua Context Help
    - Command: C:\your\pathto\Programming in Lua.chm
    - Argument: $(CurrWord)
    - Initial dir: $(FileDir)
    - Hot key: F1
    - Close on exit: Yes
    - Save before execute: No


If you use a different editor that can do the same thing please add your how-to in this thread.

Title:
Post by: BottledHate on 18 July, 2004, 08:20:25
no go on that ftp link...
Title:
Post by: plop on 18 July, 2004, 17:22:19
QuoteOriginally posted by Mardeg - if someone can provide a permanent mirror site it would be good, it's soon to be mirrored (hopefully) at ftp://ftp.clanwos.org/pub/ebooks/
it's mirrored on my site under the lua tools.
http://www.plop.nl/lua_tools.php

plop
Title:
Post by: BottledHate on 18 July, 2004, 19:19:33
this is great... thanks!
Title:
Post by: Mardeg on 14 August, 2004, 19:19:04
I tested a few different editors but have yet to encounter one that is able to both directly open topics in the helpfile AND associate the helpfile specifically with .lua filetype via F1 or other shortcut keys.

In UltraEdit (trialware) you can select "Add Help Files" from the Help menu, browse for the help file, name the item then click Insert. Highlighting a word then pressing F1 *will* open the related topic of the helpfile, but it also searches any other helpfiles you "add" (up to 5) without associating them with any filetypes.
EmEditor (trialware), PrEditor (trialware), TxtEdit (free/crippleware) and Context (freeware) were all able to open the helpfile.. but not at specific topics, even though all except TxtEdit have syntax highlighters and allow association of helpfiles/keyboard shortcuts with filetypes and have the ability to pass limited "arguments" when opening the helpfile.

PrEditor allows macros to be used in the argument but I have no idea if that's a way to access a word the cursor is on in the open .lua file.
Context can use %w (for the current word) in the argument, but not directly. Instead of being able to find the word in the topics, it needs the helpfile to be an extended .chm format that requires every html topic file inside the .chm to be either coded or named in a way that includes the word (%w) being looked up, ie. "mk:@MSITStore:Programming_in_Lua.chm::/wholedocument.html#%w" or "ms-its:Programming_in_Lua.chm::/%w.html"

So far the easiest one to use without the need to pay/crack is still Crimson Editor (//www.crimsoneditor.com), though as yet it doesn't associate shortcut keys with specific filetypes.
That's enough from me, dreams beckon. Feel free to include editors I missed, just remember to mention if they're freeware/trialware/spyware/etc.
Title:
Post by: Mardeg on 07 September, 2004, 21:21:33
Found it!
http://www.pspad.com/files/pspad/pspad431inst_en.exe (Freeware)

Settings -> Highlighters Settings
Select General4 at the bottom of the list then in the Specification tab, select Lua from the User Highlighters listbox.
Use the browse button to put the location of the Help File in the same tab, then click Apply
ALT+F1 to go to the topic of a word the cursor is on.

Additionally, you can add ptokax specific words to the highlighter via Settings -> User Highlighter, click Load, Lua.INI