ewild
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору toty794 could you, please, give any example of a DSL tag you'd wish to get as AkelPad button bar and/or menu entry? A while ago I made some bbcode, .html, .url AkelPad controls entries for my own needs based on Scripts plugin and insertTag.js script (along with ContextMenu plugin that provides you access to the context menu itself). For instance, take a note of the examples: 1. Код: "[InternetShortcut] clipboard" Call("Scripts::Main", 1, "insertTag.js", `-template="[InternetShortcut]\nURL=%%C\nComment=\nDesc=" -bbcode=0`) Icon("%a\AkelFiles\AkelPad.icl", 9) | The above command entry while editing a text returns an advanced .url file structure like this (just to be further saved as clean .url): Код: [InternetShortcut] URL={your_clipboard_content_upon_run_time_returned_by_%%C_variable} Comment= Desc= | 2. Код: "<a href='clipboard'>...</a>" Call("Scripts::Main", 1, "insertTag.js", `-template='<a href="%%C">%%S</a>' -bbcode=0`) Icon("%a\AkelFiles\AkelPad.icl", 9) | The above command entry returns in a text being edited an html tag as follows: Код: <a href="{your_clipboard_content_upon_run_time_returned_by_%%C_variable}">{selected_text_segment_upon_run_time_returned_by_%%S_variable}</a> | I think using those patterns a user can implement a nearly endless set of commands, including pretty complex bbcode/html/wiki/dsl-like tags as far as their imagination prospects. NB AkelPad.icl here is my own icon library, there could be other options to satisfy user's graphic preferences. Edit: If you need just to insert a textual tag framework without clipboard content processing (though, selection still can be processed using "\s" variable entry) you can do such things without any plugins/scripts other than the aforementioned ContextMenu plugin. Then the above-like commands could be written down pretty simpler as follows (without clipboard processing and with[the upper ones]/or without[the lower ones] selection processing): Код: "[InternetShortcut] selection" Insert("[InternetShortcut]\nURL=\s\nComment=\nDesc=", 1) "[InternetShortcut]" Insert("[InternetShortcut]\nURL=\nComment=\nDesc=", 1) "<a href='selection'></a>" Insert('<a href="\s"></a>', 1) "<a href=''></a>" Insert('<a href=""></a>', 1) | Notes: * initial "bla-bla" segments are to denote the naming, i.e. as the entries would be seen in the menu * the next "bla-bla" segments within the Insert function are to imply what's going to be inserted in the document, * "1" the Insert function modifier should be used when "bla-lba" contains Esc-sequences (it's 0 by default) The above commands would respectively render the following texts: Код: [InternetShortcut] URL={selected_text_inserted_by_\s_variable} Comment= Desc= [InternetShortcut] URL= Comment= Desc= <a href="{selected_text_inserted_by_\s_variable}"></a> <a href=""></a> |
The official language of the forum is Russian. Use translators | Всего записей: 1203 | Зарегистр. 13-08-2005 | Отправлено: 18:04 22-02-2021 | Исправлено: Maz, 20:37 24-02-2021 |
|