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

Tidy as Kate External Tool (not working) (solved)

Tags: None
(comma "," separated)
duns
Registered Member
Posts
78
Karma
0
OS
As nobody answered to my post in anothet thread (Sat Jan 16, 2021 7:59 am). I re-write it here.

How can get tidy work as external tool? I didn't manage to do it in any way.
My settings

* as executable : tidy
* as argument: -o %{Document:FileName} (or only %{Document:FileName}, or {Document:text}: all unsuccessfully)
* as working directory: %{Document:FilePath}
* save: current document
* output: I tried both Display in pane and Replace current document (and Insert in new document as well)

Nothing to do.
Tidy from terminal works.
Tidy config is symlinked in home as .tidyrc.

What should I do?

Last edited by duns on Mon Mar 15, 2021 3:39 pm, edited 1 time in total.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
duns wrote:As nobody answered to my post in anothet thread (Sat Jan 16, 2021 7:59 am). I re-write it here.
...
What should I do?

Be patient to start with? asking a question at the beginning of the weekend and expecting an answer immediately is a bit hurried, don't you think?

As soon as somebody knows the answer they will answer, you can't hurry people by repeating posts


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
duns
Registered Member
Posts
78
Karma
0
OS
Sorry :< . I thought that nobody had viewed a post in a (a bit) old thread...
BTW: there is a way to delete a post? (I tried to delete my post in the other thread, but unsuccessfully).
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
duns wrote:Sorry :< . I thought that nobody had viewed a post in a (a bit) old thread...
BTW: there is a way to delete a post? (I tried to delete my post in the other thread, but unsuccessfully).


I deleted it now


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
pvzh
Registered Member
Posts
24
Karma
1
OS
duns wrote:* as executable : tidy
* as argument: -o %{Document:FileName} (or only %{Document:FileName}, or {Document:text}: all unsuccessfully)
* as working directory: %{Document:FilePath}
* save: current document
* output: I tried both Display in pane and Replace current document (and Insert in new document as well)


Hello! I just checked these settings, it works:

* name: HTML Tidy
* executable : tidy
* arguments: -i -m %{Document:FilePath}
* working directory: %{Document:Path}
* save: current document
* reload document: (yes)
* output: ignored
* command: tidy

I don't have a tydy config file (.tidyrc), so here I use the option -i to add indents.

Assigning a command to this tool is another way to apply it: press F7, type "tidy" and press Enter.
fbertoldi
Registered Member
Posts
23
Karma
0
OS
Very good, it works!
Thank you very much!
duns
Registered Member
Posts
78
Karma
0
OS
pvzh wrote:
duns wrote:* as executable : tidy
* as argument: -o %{Document:FileName} (or only %{Document:FileName}, or {Document:text}: all unsuccessfully)
* as working directory: %{Document:FilePath}
* save: current document
* output: I tried both Display in pane and Replace current document (and Insert in new document as well)


Hello! I just checked these settings, it works:

* name: HTML Tidy
* executable : tidy
* arguments: -i -m %{Document:FilePath}
* working directory: %{Document:Path}
* save: current document
* reload document: (yes)
* output: ignored
* command: tidy

I don't have a tydy config file (.tidyrc), so here I use the option -i to add indents.

Assigning a command to this tool is another way to apply it: press F7, type "tidy" and press Enter.


It works, thank you.
But I noticed that it works only if there aren't spaces in filename: how avoid this problem? How can I tidy a file like "this is my file.html", without having to rename it in "this-is-my-file.html"?
User avatar
pvzh
Registered Member
Posts
24
Karma
1
OS
You're right, I forgot about the spaces. It is sufficient to add quotation marks around the file path:

* arguments: -i -m "%{Document:FilePath}"

But for the working directory quotes should not be added.
duns
Registered Member
Posts
78
Karma
0
OS
pvzh wrote:You're right, I forgot about the spaces. It is sufficient to add quotation marks around the file path:

* arguments: -i -m "%{Document:FilePath}"

But for the working directory quotes should not be added.


Perfect! Thank you.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]