### Txt2Html.tcl 1.0.0 fFG93nkC #SUGGESTED # PBinSrc.tcl fMrtKqyq #LICENSE # Copyright © 2013 Alberto Dietze "DoctorD90" # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Full GPLv3 Text: http://www.gnu.org/licenses/gpl.txt #PATERNITY #Coder: DoctorD90 #Network: irc.OnlineGamesNet.net #Chan: #eHito #Mail: DoctorD90@EggTcl.tk #PURPOSE #Converts text files into html pages. #USAGE #Add this script to your eggdrop's list to load it. ### DON'T EDIT ANYTHING BELOW ### proc txt2html {file lines {title ""}} { if {![string length $file] || ![llength $lines]} { return 0 } if {![string match -nocase "*.html" $file]} { append file ".html" } if {![string length $title]} { set title [string trim [join [lrange [split [lindex [split $file "/"] end] "."] 0 end-1]]] } set fs [open "$file" w] puts $fs "
" puts $fs " " puts $fs " " puts $fs " $title" puts $fs " " puts $fs " " puts $fs [join $lines "
\n"] puts $fs " " puts $fs "" close $fs return 1 } ### putlog "Txt2Html.tcl LOADED"