//! zinc
library htmlFile { /* v1.0.0.0
*************************************************************************************
*
* .htmlFile
* by nel (NELMVN)
*
* A lightweight library that allows you to create, write, and design your own
* HTML file. It is more faster than .bat to .txt conversion and compatible in
* Internet Explorer, Google Chrome, Avast Secure Browser, Mozilla Firefox,
* etc.
*
************************************************************************************
*
* struct HTML extends array
*
* static method new takes string directory, real fontSize returns nothing
* - Create a new .html file.
*
* static method print takes string str returns nothing
* static method println takes string str returns nothing
*
* static method end takes nothing returns nothing
* - Close the generated .html file.
*
************************************************************************************
*
* Issues:
*
* - print() may handle up to 252 characters.
* - println() may handle up to 248 characters.
* - Use '<br>' instead of '\r\n' in print() and println().
*
***********************************************************************************/
public struct HTML[] {
private static string Directory;
public {
static method new( string directory, real fontSize ) {
PreloadGenClear();
PreloadGenStart();
debug if( directory == null ) {
debug BJDebugMsg("[HTML Error new()] directory is a null.");
}
Preload(
"<html><body class=\"x\">" +
"<style>.x { font-size: 0; }" +
".y { font-size: " + R2S(fontSize) + "; }</style>" +
"<div class=\"y\"><!--"
);
thistype.Directory = directory;
}
static method print( string str ) {
Preload("-->" + str +"<!--");
debug if( StringLength(str) > 252 ) {
debug BJDebugMsg("[HTML Error print()] str reached the limit.");
}
}
static method println( string str ) {
Preload("-->" + str +"<br><!--");
debug if( StringLength(str) > 248 ) {
debug BJDebugMsg("[HTML Error println()] str reached the limit.");
}
}
static method end() {
Preload("--></div></body></html><!--" +
"\r\n\r\n\r\nMade by github.com/NELMVN\r\n\r\n\r\n"
);
PreloadGenEnd(Directory + ".html");
thistype.Directory = null;
}
}
}
}
//! endzinc