Indent script for Katepart5?

Dominik Haumann dhaumann at kde.org
Mon Nov 13 20:45:43 UTC 2017


Sorry, the code snippet is missing the "var = " in the first line:
//----------
var katescript = {
    "author": "Example Name <example.name at some.address.org>",
    "license": "LGPLv2+",
    "revision": 1,
    "kate-version": "5.1",
    "functions": ["bla"],
    "actions": [
        {   "function": "bla",
            "name": "Insert bla",
            "category": "Editing",
            "interactive": "false"
        }
    ]
}; // kate-script-header, must be at the start of the file without comments

require("range.js");

function bla()
{
    document.insertText(0, 0, "bla");
}
//----------

Greetings
Dominik


On Mon, Nov 13, 2017 at 9:44 PM, Dominik Haumann <dhaumann at kde.org> wrote:
> Hi Pierre,
>
> just tested, my location was:
> /home/dh/.local/share/katepart5/script/commands/bla.js
>
> bla.js contains the following:
> //-----------------
> katescript = {
>     "author": "Example Name <example.name at some.address.org>",
>     "license": "LGPLv2+",
>     "revision": 1,
>     "kate-version": "5.1",
>     "functions": ["bla"],
>     "actions": [
>         {   "function": "bla",
>             "name": "Insert bla",
>             "category": "Editing",
>             "interactive": "false"
>         }
>     ]
> }; // kate-script-header, must be at the start of the file without comments
>
> require("range.js");
>
> function bla()
> {
>     document.insertText(0, 0, "bla");
> }
> //-----------------
>
> I think you are missing the functions in your examples.
> Please refer to
> https://docs.kde.org/trunk5/en/applications/katepart/dev-scripting.html
> for further details.
>
> Does that already help?
>
> Best regards,
> Dominik
>
>
> On Mon, Nov 13, 2017 at 9:46 AM, Pierre de Villemereuil
> <pierre.de.villemereuil at mailoo.org> wrote:
>> Dear all,
>>
>> I've been working on an indentation script for R (with esp. RKward in mind). It's working great on Katepart4/RKward (last release still depends on the KDE 4 stack), but I can't manage to test a KF5 version on Kate.
>>
>> I have prepared a KF5 script using the new header (var katescript = { ... }) and placed it in:
>> - /usr/share/katepart5/script/indentation/
>> - ~/.local/share/katepart5/script/indentation
>> - ~/.local/share/katepart/script/indentation
>>
>> In none of the above case I obtain the R option in the indentation menu in Kate (I restarted Kate each time). What is the correct path to place the indentation script for Katepart5?
>>
>> The script is here:
>> https://github.com/devillemereuil/rindent
>>
>> Any help is welcome.
>>
>> Thanks,
>> Pierre.


More information about the KWrite-Devel mailing list