This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to insert html tags in a Kate's document ?

Tags: None
(comma "," separated)
geolours
Registered Member
Posts
14
Karma
0
OS
Hello,

I use the software "kate" and I want to insert html tags in a document. I can't find tools
to do that. For instance, 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: Select all
<strong>${fn`getSelect`}</strong>

and this javascript function
Code: Select all
function getSelect(src)
{
return view.selectedText();
}

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: Select all
The filename of the document is ${fn`getFileName`}

fonction javascript
Code: Select all
function getFileName(src) {
        return document.fileName();
}

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

Thanks in advance for your help.
User avatar
tyreed
Registered Member
Posts
40
Karma
0
OS
have you tried Ctrl+R = 'search and replace' as it sounds like you're editing an old document?
-or-
create snippet with your code, save and use Ctrl+Spacebar to bring up the snippet list. You can narrow down your list, if you start typing "<stro"
You can dock the snippets window on side bar by going Settings> Configure Kate> Plugins> (select) Snippets tool view. Mine was first docked on right, but you can right-click and choose to dock on left, making the viewing of and inserting your snippets easier.

Reed.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell