TIDY(3) 1 TIDY(3)The tidy classINTRODUCTION
An HTML node in an HTML file, as detected by tidy.
CLASS SYNOPSIS
tidy
tidy
Properties
o
string$tidy->errorBuffer
Methods
o
tidyNode tidy::body (void )
o
bool tidy::cleanRepair (void )
o
tidy::__construct ([string $filename], [mixed $config], [string $encoding], [bool $use_include_path])
o
bool tidy::diagnose (void )
o
array tidy::getConfig (void )
o
int tidy::getHtmlVer (void )
o
mixed tidy::getOpt (string $option)
o
string tidy::getOptDoc (string $optname)
o
string tidy::getRelease (void )
o
int tidy::getStatus (void )
o
tidyNode tidy::head (void )
o
tidyNode tidy::html (void )
o
bool tidy::isXhtml (void )
o
bool tidy::isXml (void )
o
bool tidy::parseFile (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
o
bool tidy::parseString (string $input, [mixed $config], [string $encoding])
o
string tidy::repairFile (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
o
string tidy::repairString (string $data, [mixed $config], [string $encoding])
o
tidyNode tidy::root (void )
PHP Documentation Group TIDY(3)
Check Out this Related Man Page
TIDY_REPAIR_FILE(3) 1 TIDY_REPAIR_FILE(3)tidy::repairFile - Repair a file and return it as a string
Object oriented style
SYNOPSIS
string tidy::repairFile (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
DESCRIPTION
Procedural style
string tidy_repair_file (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
Repairs the given file and returns it as a string.
PARAMETERS
o $filename
- The file to be repaired.
o $config
- The config $config can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the
configuration file, otherwise, it is interpreted as the options themselves. Check http://tidy.sourceforge.net/docs/quickref.html
for an explanation about each option.
o $encoding
- The $encoding parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0,
latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5, and shiftjis.
o $use_include_path
- Search for the file in the include_path.
RETURN VALUES
Returns the repaired contents as a string.
EXAMPLES
Example #1
tidy_repair_file(3) example
<?php
$file = 'file.html';
$tidy = new tidy();
$repaired = $tidy->repairfile($file);
rename($file, $file . '.bak');
file_put_contents($file, $repaired);
?>
NOTES
Note
The optional parameters $config and $encoding were added in Tidy 2.0.
SEE ALSO tidy.parseFile(3), tidy.parseString(3), tidy.repairString(3).
PHP Documentation Group TIDY_REPAIR_FILE(3)
Hi
I believe there is a method to remove all temporary files when a KSH script terminates (either expectedly or unexpectedly).
I think is some sort of subroutine you can create that runs when the script exits. Can anyone help me with this please?
Many thanks
Helen :confused: (2 Replies)
Hi.
A post by ghostdog74 at split files by specifying a string (bash shell) - LinuxQuestions.org made me think that many awk scripts could benefit from being tidied.
I know that {aigles awk bakunin cfaj futurelet ghostdog74 radoulov summer_cherry vgersh99 Ygor} among others post awk code. ... (5 Replies)
Hi all,
Is there a tool to tidy up shell script source file and reformat it. Preferably I am looking for a perfect tool to do this.
Also I have heard it is possible to do with emacs editor but unfortunately it is looking very different and new from vi. Emacs is new to me and I could not find... (1 Reply)
Hi guys,
Simple question really (only when you know how!)
I would like to clear the screen between two parts of script.
However I would like the user to be prompted if he/she has completed reading the output from the first part of the script before moving on.
i.e =
grep "$###" #####... (2 Replies)
Hello,
I have a CSV-like dataset where some of the columns contain HTML snippets which I need to convert to XHTML. For any given snippet, I have a functioning config for the text processor 'tidy' such that
tidy -config tidy.cfg example.html
does the job I need done.
I would like to process... (10 Replies)