My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require_once 'nehcfrus.php';
require_once 'io.php';
require_once 'html2txt.php';
$html_dir = NEHCFRUS_HOME.'/downloads/html';
$txt_dir = NEHCFRUS_HOME.'/php/functions';
$d=dir($html_dir);
while (false!==($entry=$d->read())) {
if (!preg_match("#function\.(.+)\.html#",$entry,$m)) continue;
$f = $html_dir.'/'.$entry;
$c = file_get_contents($f);
$txt_file = $txt_dir.'/'.$m[1].'.txt';
if (!preg_match('#<\/h1[^>]*>(.+)<hr#si',$c,$matches)) {
echo $entry.'('.strlen($c).')'."\n";
continue;
}
$text = html2txt($matches[1]);
$tags[]=str_replace('-','_',$m[1]).chr(9).$txt_file.chr(9).'1';
io::writeFile($txt_file,$text);
}
io::writeFile(NEHCFRUS_HOME.'/php/tags',implode(chr(10),$tags));
?>

Change log

r74 by surfchen on Apr 24, 2008   Diff
add 2 php files for vim tags
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 749 bytes, 22 lines
Powered by Google Project Hosting