snippets

Georges Lours geo.lours at free.fr
Thu Jan 19 09:28:55 GMT 2012


Hello,

I use the software "kate" but the problem is the same with kdevelop. I want to 
insert html tags in a document. I can't find tools 
to do that. For instance, After select it, I want to replace the expression 
"this is bold" by "<strong >this is bold</strong >". Does that exist?
I've found the tool "snippets" in the external modules. But I can't use it. 
I've create a snippet called "strong" with this content:

[code]<strong>${fn`getSelect`}</strong>[/code]

and this javascript function

[code]function getSelect(src) 
{
return view.selectedText();
}[/code]

But it doesn't work.
To do that, I've had a look in kate's help file (in particular "scripting API") 
and I imitated a snippet which is supplied and which is designed like that:

[code]The filename of the document is ${fn`getFileName`}[/code]

fonction javascript

[code]function getFileName(src) {
        return document.fileName();
}[/code]

and it works
What did I do wrong? What should I modify ?

Thanks in advance for your help.
-- 
Georges Lours
Geo.Lours at free.fr
Utilisateur Linux (counter 383333)




More information about the KDevelop mailing list