HTML Tidy config set up in TextPad
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
HTML Tidy config set up in TextPad
I have set up HTML Tidy as per http://textpad.com/forum/viewtopic.php?t=4768 and it works fine. In other words, it reports the errors and warnings, and I can dbl-Click a Warning right to the offending line. However, I would like to use the Tidy-Config file option to use more than the default configuration. My problem is I have the file (I called it TidyCfg.txt) in place, and I set an environment variable in my NT4 machine, (HTML_TIDY=C:\Program Files\TextPad 4\Samples\TidyCfg.txt) and I activate HTML-Tidy using [Ctrl-5], but it doesn't seem to use the file, and I don't know what to change in my set up to make it pick-up the file and use it.
Has anyone else done this? Maybe a set of instructions to set up on both an NT4 and a Win98SE machine.
Thanks in advance.
JohnB
Has anyone else done this? Maybe a set of instructions to set up on both an NT4 and a Win98SE machine.
Thanks in advance.
JohnB
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
In Parameters for the Tidy tool in TP I'm using HTH
Code: Select all
-config C:\tidy\tconf.txt -errors -quiet $File
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be
Parameter changed, what is command format?
Thanks for such a rapid response.
I changed my Parameter setting to:
-config "C:\Program Files\TextPad 4\Samples\TidyCfg.txt" -errors -quiet $File
(Note the use of quotes around the path. They were necessary to stop TextPad from dividing the path, and then reporting errors, at the spaces in the path name (e.g. in 'Program Files')).
My TidyCfg.txt file reads (in part):
wrap: 0
indent: yes
indent-spaces: 2
wrap-php: no
clean: yes
I know TextPad is now reading my TidyCfg.txt file because it does not report the errors of the spaces in the path as it did previously. But it doesn't actually follow the instructions in the file. For instance, it does not indent the requested two spaces, or clean the code. Is this the correct commands (and format) for these parameter settings? Your help is greatly appreciated.
Thanks
JohnB
I changed my Parameter setting to:
-config "C:\Program Files\TextPad 4\Samples\TidyCfg.txt" -errors -quiet $File
(Note the use of quotes around the path. They were necessary to stop TextPad from dividing the path, and then reporting errors, at the spaces in the path name (e.g. in 'Program Files')).
My TidyCfg.txt file reads (in part):
wrap: 0
indent: yes
indent-spaces: 2
wrap-php: no
clean: yes
I know TextPad is now reading my TidyCfg.txt file because it does not report the errors of the spaces in the path as it did previously. But it doesn't actually follow the instructions in the file. For instance, it does not indent the requested two spaces, or clean the code. Is this the correct commands (and format) for these parameter settings? Your help is greatly appreciated.
Thanks
JohnB
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Thanks for your help
Thanks for your help.
If anyone else has any suggestions, please jump in...
Thanks
JohnB
If anyone else has any suggestions, please jump in...
Thanks
JohnB
I hate it when a FAQ/A peters out without resolution. So, because TextPad is my absolute favorite ASCII editor, I spent some time playing with Tidy.exe, and figuring out how to make it work in TextPad, with and without an external configuration file. (Below I have used 'single quotes' to delimit Parameter settings. They, are not part of the Parameter setting.)
Configure as per http://textpad.com/forum/viewtopic.php?t=4768
Then change the Parameter setting to '-h $File', to see a short HELP blurb, OR
change the Parameter setting to '-help-config $File' to see a list of all CONFIGURATION OPTIONS, OR
change the Parameter setting to '-show-config $File' to see a list of the CURRENT CONFIGURATION SETTINGS.
If you want to use shortened command-line Parameters, you can set whatever parameter you desire in the Configure | Preferences | Tools | Tidy | Parameters: window, (e.g. Parameters= '-iq $File'). This command-line switch directs Tidy.exe to 'indent=yes, quiet=yes'. See the above Help blurbs from Tidy.exe for the complete list, (AND CORRECT USAGE), of command-line switches.
I wanted to use an external file to set my Tidy.exe switches because I forget what switch does what and etc. So, I created a file, named, "TidyCfg.txt", and placed it in the Samples subdirectory of the TextPad installation. Then I changed the Parameter setting to read, '-config "C:\Program Files\TextPad 4\Samples\TidyCfg.txt" $File'. The double quotes are necessary around the file path to avoid errors when TextPad parses the path. In the file, "TidyCfg.txt", I have:
indent: auto
write-back: yes
wrap: 0
quiet: yes
//show-errors: 0
clean: yes
//See TidyHelpShowConfig.txt
Notice the use of // to insert comments and disable commands.
Also notice the difference in the syntax from the command-line syntax.
See the HELP blurbs above from Tidy.exe to get a complete explanation for the above switches.
Thanks
JohnB 8)
Configure as per http://textpad.com/forum/viewtopic.php?t=4768
Then change the Parameter setting to '-h $File', to see a short HELP blurb, OR
change the Parameter setting to '-help-config $File' to see a list of all CONFIGURATION OPTIONS, OR
change the Parameter setting to '-show-config $File' to see a list of the CURRENT CONFIGURATION SETTINGS.
If you want to use shortened command-line Parameters, you can set whatever parameter you desire in the Configure | Preferences | Tools | Tidy | Parameters: window, (e.g. Parameters= '-iq $File'). This command-line switch directs Tidy.exe to 'indent=yes, quiet=yes'. See the above Help blurbs from Tidy.exe for the complete list, (AND CORRECT USAGE), of command-line switches.
I wanted to use an external file to set my Tidy.exe switches because I forget what switch does what and etc. So, I created a file, named, "TidyCfg.txt", and placed it in the Samples subdirectory of the TextPad installation. Then I changed the Parameter setting to read, '-config "C:\Program Files\TextPad 4\Samples\TidyCfg.txt" $File'. The double quotes are necessary around the file path to avoid errors when TextPad parses the path. In the file, "TidyCfg.txt", I have:
indent: auto
write-back: yes
wrap: 0
quiet: yes
//show-errors: 0
clean: yes
//See TidyHelpShowConfig.txt
Notice the use of // to insert comments and disable commands.
Also notice the difference in the syntax from the command-line syntax.
See the HELP blurbs above from Tidy.exe to get a complete explanation for the above switches.
Thanks
JohnB 8)
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
I'm confused (no news here ) after reading your post. Am I right in thinking that "-config C:\tidy\tconf.txt -errors -quiet $File" is incorrect? Ie. you must either use the config file OR the parameters, not both?
Diffrent issue: I just noticed that my column settings are not working. I get the report:
and when I double click a line, TP takes me to cols 56, 44, 44 and 23 in the document! I took a quick look at "tidy -h" etc and changed my parameters back to the original "-errors -quiet $File" with no effect. Changed TP's settings for number of spaces in a tab and also for Tidy using both command line parameters and a config file. Nothing happens, I'm constantly taken to the wrong column. Any ideas?
Diffrent issue: I just noticed that my column settings are not working. I get the report:
Code: Select all
line 348 column 41 - Warning: plain text isn't allowed in <tr> elements
line 668 column 41 - Warning: nested emphasis <span>
line 668 column 41 - Warning: missing </span> before <table>
line 744 column 17 - Warning: discarding unexpected </span>
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be
First, about the jumping to the wrong column; my set-up is till according to the information in:
http://textpad.com/forum/viewtopic.php?t=4768
about the settings at the bottom of the Tools pop-up; File: =BLANK, Line: =1, and Column: =2. Quiet honestly, I don't know that much about these settings.
As for the second item, command-line vs. config-file: I don't know this definitively, but I think it is an either/or situation. (Ignore my single quotes) For a command-line setting, the Parameter field should read, '-errors -quiet $File', (which can be rewritten as '-eq $File').
Then, if you want to use a config-file, '-config "C:\tidy\tconf.txt" $File', (Please notice that the double-quotes only bracket the "absolutePath\fileName.ext", (if there are no spaces, the double-quotes are apparently not needed)).
I don't know whether you can mix the two, (command-line and config-file), but, I do know that the config-file does not work unless the switches are in the form:
...
wrap: 0
indent: yes
indent-spaces: 2
...
I hope this helps.
JohnB
http://textpad.com/forum/viewtopic.php?t=4768
about the settings at the bottom of the Tools pop-up; File: =BLANK, Line: =1, and Column: =2. Quiet honestly, I don't know that much about these settings.
As for the second item, command-line vs. config-file: I don't know this definitively, but I think it is an either/or situation. (Ignore my single quotes) For a command-line setting, the Parameter field should read, '-errors -quiet $File', (which can be rewritten as '-eq $File').
Then, if you want to use a config-file, '-config "C:\tidy\tconf.txt" $File', (Please notice that the double-quotes only bracket the "absolutePath\fileName.ext", (if there are no spaces, the double-quotes are apparently not needed)).
I don't know whether you can mix the two, (command-line and config-file), but, I do know that the config-file does not work unless the switches are in the form:
...
wrap: 0
indent: yes
indent-spaces: 2
...
I hope this helps.
JohnB
Re: Parameter changed, what is command format?
I had this problem - when I looked closely at my config file I noticed i had somehow inadvertantly introduced space characters at the start of each line. Removing them fixed it.jlbalder wrote:I know TextPad is now reading my TidyCfg.txt file because it does not report the errors of the spaces in the path as it did previously. But it doesn't actually follow the instructions in the file.)