< div class = "navbar" >
< div class = "navbaritem" > < a href = "/" > HOME< / a > < / div >
< div class = "navbaritem" > < a href = "/blog.html" > BLOG< / a > < / div >
< div class = "navbaritem" > < a href = "/arcade.html" > ARCADE< / a > < / div >
< div class = "navbaritem" > < a href = "/stream.html" > STREAM< / a > < / div > < div id = "liveindicator" > < / div >
< div class = "navbaritem" > < a href = "/code.html" > CODING SERVICES< / a > < / div >
< div class = "socials" >
< div class = "navbaritem" > DISCORD< / div >
< div class = "navbaritem" > GITHUB< / div >
< div class = "navbaritem" > TWITCH< / div >
< div class = "navbaritem" > YOUTUBE< / div >
< div class = "navbaritem" > TWITTER< / div >
< / div >
< / div >
< script type = "text/javascript" >
function getLiveStatus() {
//document.getElementById("liveindicator").innerText="🔴 LIVE"
}
getLiveStatus()
< / script >
<!DOCTYPE html>
< html >
< head >
< link rel = "stylesheet" type = "text/css" href = "/reset.css" >
< link rel = "stylesheet" type = "text/css" href = "/sig.css" >
< meta charset = "UTF-8" >
< script type = "text/javascript" >
function loadCodeBackground() {
fetch("/codeBackground").then((data)=>data.text())
.then((data)=>{
document.getElementById("codeForeground").innerText=data
document.getElementById("codeBackground").innerText=data
})
}
loadCodeBackground();
< / script >
< / head >
< body >
< div class = "contentBody" >
This is a different webpage.< hr >
< script type = "text/javascript" >
function expand(modify,element) {
var ele = document.getElementById("content_"+element);
ele.classList.remove("content");
ele.classList.add("expandedContent");
modify.remove();
}
< / script >
< div class = "contentWrapper" > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/sigplace1.article.html" > < h1 > Welcome to SigPlace!< / h1 > < / a > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/sigplace1.article.html" > 🔗< / a > < div class = "content" id = "content_out/articles/sigplace1.article" >
< p class = "color3" >
This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.
< / p >
< p class = "color4" >
Paragraphs are automatically split up for readability and generated correctly via the parser. There's quite a bit of flexibility with the system and makes it easy to post updates should they be required.
< / p >
< p class = "color4" >
A lot of content management systems would do this by having a web interface and submitting content and managing it that way, but by coding my own management system and using the built-in OS' filesystem to handle the work, I save myself a lot of pains and headaches.
< / p >
< p class = "color4" >
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In feugiat, urna ut sollicitudin luctus, nulla magna faucibus mauris, at semper nisl nisi ut mauris. Vestibulum cursus tortor velit, ut congue ex porta in. Nullam hendrerit risus sit amet neque euismod faucibus. Sed ac diam non lectus euismod pulvinar eu non mauris. Donec accumsan nisl efficitur, sodales lectus et, finibus quam. Sed vel consectetur leo. Cras ut condimentum quam. Aliquam molestie viverra congue. Donec scelerisque nibh ac nulla dictum semper. Aliquam id massa a massa bibendum finibus id ac sapien. Integer vitae ullamcorper enim, non semper massa.
< / p >
< br / >
< p class = "color5" >
Proin cursus sodales elit, vitae volutpat mi fermentum a. In vitae magna quis leo cursus accumsan id facilisis purus. Vestibulum accumsan iaculis turpis eu sollicitudin. Sed ultricies felis non elit suscipit interdum. Maecenas sollicitudin turpis justo, vel pretium sapien scelerisque eget. Nullam sagittis finibus risus ut aliquam. Praesent quam orci, dapibus ut ex ac, sodales dapibus nunc.
< / p >
< br / >
< p class = "color5" >
Fusce magna risus, iaculis non justo sit amet, semper sodales urna. Morbi eu eros lectus. Integer euismod venenatis eros a hendrerit. Nulla ultricies lectus nec quam condimentum fermentum. Quisque a turpis vitae orci pharetra ullamcorper. Nunc fringilla vitae nunc a aliquam. In aliquam gravida massa. Sed imperdiet dignissim sapien, ullamcorper rutrum lacus convallis ut.
< / p >
< br / >
< p class = "color6" >
Nunc tortor sem, dapibus mattis varius id, varius eu leo. Phasellus efficitur nulla a diam faucibus, id facilisis lacus malesuada. Nulla condimentum egestas erat a fermentum. Ut interdum dui id est condimentum, vel fermentum nisi ornare. Sed eu rhoncus magna, sit amet finibus eros. In a nibh tincidunt, suscipit tellus eleifend, faucibus mauris. Vestibulum sagittis nisi et efficitur ullamcorper. Donec sodales efficitur ligula id congue. Etiam egestas tristique interdum. Mauris at massa eget metus pellentesque fermentum nec non lacus. Nulla turpis nunc, feugiat vel euismod ac, maximus id est. Praesent cursus elit ac dolor hendrerit lacinia.
< / p >
< br / >
< p class = "color6" >
Vestibulum laoreet lorem consequat, mollis augue finibus, luctus libero. Praesent convallis sed velit vitae molestie. Vestibulum nec fringilla tellus, non dictum nulla. Donec tempor ac diam sit amet porta. Quisque mi ex, vulputate ac tincidunt vel, vestibulum vitae orci. Duis gravida mauris eget mauris pulvinar, lobortis tincidunt neque efficitur. Nunc blandit metus vitae faucibus vulputate. Curabitur rhoncus volutpat lorem, sit amet pulvinar ipsum. Fusce ultricies enim odio, a viverra quam tincidunt quis. Aliquam sollicitudin a sapien id efficitur. Proin at finibus elit, id gravida elit. Nulla facilisi. Ut tincidunt, ligula eu pulvinar dapibus, lorem nisl facilisis tellus, in ornare quam dolor quis libero. Pellentesque ut convallis orci. Donec volutpat nunc velit, tristique convallis purus lacinia sit amet. Maecenas porttitor cursus nisl sed porta.
< / p >
< br / >
< div > < figure style = "text-align:center;width:30%;float:right;" > < img src = "/images/Love_Live!_Logo.png" style = "margin:auto;width:100%;" > < figcaption > Hello there! You can see this is the Love Live logo indeed! It is quite smol right now but that's okay. Let's keep on going with the text. If the caption is really long and with commas, they will now be combined,,,,,see how that works? Amazing!< / figcaption > < / figure > < / div >
< p class = "color1" >
Here we demonstrate the love live logo. But wait, it's literally like in the middle wtf is going on.Here we demonstrate the love live logo. But wait, it's literally like in the middle wtf is going on.Here we demonstrate the love live logo. But wait, it's literally like in the middle wtf is going on.
< / p >
< br / >
< p class = "color1" >
< pre >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > io< / span > .< span class = "keyword" > IOException< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > charset< / span > .< span class = "keyword" > Charset< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > CopyOption< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > Files< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > Path< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > Paths< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > StandardCopyOption< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > nio< / span > .< span class = "class" > file< / span > .< span class = "keyword" > StandardOpenOption< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > AbstractMap< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > ArrayList< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > HashMap< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > Iterator< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > List< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "keyword" > Map< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > import< / span > < span class = "class" > java< / span > .< span class = "class" > util< / span > .< span class = "class" > regex< / span > .< span class = "keyword" > Pattern< / span > ;< span class = "variable" > < / span >
< span class = "keyword" > public< / span > < span class = "keyword" > class< / span > < span class = "keyword" > sigPlace< / span > < span class = "variable" > < / span > {
< span class = "comment" > /* Test giant multi-line comment ""
final static String ROOTDIR = "sitefiles";
final static String REFDIR = "ref";
final static String OUTDIR = "out";
final static String ARTICLESDIR = "articles";
final static String UPLOADSDIR = "uploads";
final static String COMMENTSDIR = "comments";
final static String DIRECTORYLISTING_FILENAME = "DIRECTORY_LISTING";
static int PORT = 8080;
*/< / span > < span class = "number" > < / span >
< span class = "keyword" > static< / span > < span class = "keyword" > double< / span > COLOR_< span class = "keyword" > ROTATION< / span > < span class = "variable" > < / span > = < span class = "number" > 0< / span > ;
< span class = "keyword" > static< / span > < span class = "keyword" > boolean< / span > < span class = "keyword" > inCodeBlock< / span > < span class = "variable" > < / span > = < span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > static< / span > < span class = "keyword" > String< / span > < span class = "keyword" > storedCodeBlock< / span > < span class = "variable" > < / span > = < span class = "string" > ""< / span > ;
< span class = "keyword" > final< / span > < span class = "keyword" > static< / span > < span class = "variable" > HashMap< / span > < String,String> < span class = "keyword" > map< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "variable" > HashMap< / span > < >< span class = "function" > < / span > (< span class = "class" > Map< / span > .< span class = "function" > ofEntries< / span > (
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$SITENAME"< / span > , < span class = "string" > "SigPlace"< / span > ),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$SITE_BACKCOL"< / span > , < span class = "string" > "#111"< / span > ),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$TITLE_CONTENT_START"< / span > , < span class = "string" > "< div class=\"contentWrapper\">< h1>"< / span > ),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$TITLE_CONTENT_END"< / span > , < span class = "string" > "< /h1>< div class=\"content\" %ID%>"< / span > ),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$CONTENT_END"< / span > , < span class = "string" > "< /div>"< / span > ),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (< span class = "string" > "$DATE_CONTENT_START"< / span > , < span class = "string" > "< div class=\"datebar\">< /div>< div class=\"date\">"< / span > )
));
< span class = "keyword" > final< / span > < span class = "keyword" > static< / span > < span class = "variable" > HashMap< / span > < String,Path> < span class = "keyword" > ops< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "variable" > HashMap< / span > < >< span class = "function" > < / span > (< span class = "class" > Map< / span > .< span class = "function" > ofEntries< / span > (
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (
< span class = "string" > "%DEFAULT"< / span > , < span class = "class" > Paths< / span > .< span class = "function" > get< / span > (REFDIR,< span class = "string" > "DEFAULT.html"< / span > )),
< span class = "keyword" > new< / span > < span class = "class" > AbstractMap< / span > .< span class = "variable" > SimpleEntry< / span > < >< span class = "function" > < / span > (
< span class = "string" > "%FOOTER"< / span > , < span class = "class" > Paths< / span > .< span class = "function" > get< / span > (REFDIR,< span class = "string" > "FOOTER.html"< / span > ))
));
< span class = "keyword" > public< / span > < span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > main< / span > (< span class = "variable" > String< / span > [] args) {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > args< / span > .< span class = "variable" > length< / span > >< span class = "number" > 0< / span > & & < span class = "class" > args< / span > .length%< span class = "number" > 2< / span > ==< span class = "number" > 0< / span > ) {
< span class = "keyword" > int< / span > < span class = "variable" > i< / span > =< span class = "number" > 0< / span > ;
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "variable" > i< / span > < < span class = "class" > args< / span > .length) {
< span class = "keyword" > String< / span > < span class = "variable" > arg1< / span > =args[i];
< span class = "keyword" > String< / span > < span class = "variable" > arg2< / span > =args[i+< span class = "number" > 1< / span > ];
i+=< span class = "number" > 2< / span > ;
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > arg1< / span > .< span class = "function" > equals< / span > (< span class = "string" > "-p"< / span > < span class = "variable" > < / span > )) {
PORT=< span class = "class" > Integer< / span > .< span class = "function" > parseInt< / span > (arg2);
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Port set to "< / span > +PORT+< span class = "string" > "."< / span > );
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
< span class = "class" > System< / span > .< span class = "class" > err< / span > .< span class = "function" > println< / span > (< span class = "string" > "Invalid argument \""< / span > +arg1+< span class = "string" > "\"."< / span > );
< span class = "keyword" > return< / span > ;
}
}
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Copying files over to output directory..."< / span > );
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "function" > copyDirectory< / span > (< span class = "string" > "sitefiles"< / span > ,< span class = "string" > "out"< / span > );
Iterator< Path> < span class = "keyword" > items< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > walk< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "string" > "out"< / span > )).< span class = "function" > filter< / span > (< span class = "function" > < / span > (p)->!< span class = "class" > p< / span > .< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > ().< span class = "function" > contains< / span > (< span class = "string" > "images/"< / span > )).< span class = "function" > iterator< / span > ();
< span class = "function" > ParseArticleFiles< / span > (items);
< span class = "keyword" > items< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > walk< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "string" > "out"< / span > )).< span class = "function" > iterator< / span > ();
< span class = "function" > ConvertArticleReferences< / span > (items);
< span class = "keyword" > items< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > walk< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "string" > "out"< / span > ,< span class = "string" > "articles"< / span > )).< span class = "function" > iterator< / span > ();
< span class = "function" > GenerateArticleFiles< / span > (items);
}< span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
< span class = "class" > System< / span > .< span class = "class" > err< / span > .< span class = "function" > println< / span > (< span class = "string" > "Copying files over failed!"< / span > );
< span class = "keyword" > return< / span > ;
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Building directory listings..."< / span > );
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "function" > buildDirectoryListings< / span > ();
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
< span class = "class" > System< / span > .< span class = "class" > err< / span > .< span class = "function" > println< / span > (< span class = "string" > "Failed to build directory listings!"< / span > );
< span class = "keyword" > return< / span > ;
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Site has been built into the "< / span > +OUTDIR+< span class = "string" > " directory."< / span > );
< span class = "function" > ExportCodeFile< / span > ();
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "\nStarting web server..."< / span > );
< span class = "keyword" > new< / span > < span class = "function" > sigServer< / span > (< span class = "variable" > < / span > );
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > ParseArticleFiles< / span > (< span class = "variable" > Iterator< / span > < Path> items) {
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "class" > items< / span > .< span class = "function" > hasNext< / span > (< span class = "variable" > < / span > )) {
< span class = "keyword" > Path< / span > < span class = "keyword" > f< / span > < span class = "variable" > < / span > = < span class = "class" > items< / span > .< span class = "function" > next< / span > ();
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Found "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isRegularFile< / span > (< span class = "variable" > f< / span > )) {
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Preparing "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
List< String> < span class = "keyword" > content< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (f);
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "function" > isHTMLFile< / span > (< span class = "variable" > f< / span > )) {
< span class = "class" > content< / span > .< span class = "function" > addAll< / span > (< span class = "number" > 0< / span > ,< span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%DEFAULT"< / span > )));
< span class = "class" > content< / span > .< span class = "function" > addAll< / span > (< span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%FOOTER"< / span > )));
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Parsing "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > i< / span > =< span class = "number" > 0< / span > ;i< < span class = "class" > content< / span > .< span class = "function" > size< / span > ();i++) {
< span class = "keyword" > String< / span > < span class = "keyword" > s< / span > < span class = "variable" > < / span > = < span class = "class" > content< / span > .< span class = "function" > get< / span > (i);
< span class = "comment" > //System.out.println(s);< / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > length< / span > (< span class = "variable" > < / span > )>< span class = "number" > 0< / span > & & < span class = "function" > < / span > (< span class = "function" > isHTMLFile< / span > (f)||< span class = "function" > isArticleFile< / span > (f))) {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !inCodeBlock) {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > contains< / span > (< span class = "string" > "< pre>"< / span > < span class = "variable" > < / span > )) {
< span class = "comment" > //System.out.println("Inside < pre>");< / span >
inCodeBlock=< span class = "number" > true< / span > < span class = "keyword" > < / span > ;
storedCodeBlock=< span class = "string" > ""< / span > ;
s=< span class = "class" > s< / span > .< span class = "function" > substring< / span > (< span class = "number" > 0< / span > ,< span class = "class" > s< / span > .< span class = "function" > indexOf< / span > (< span class = "string" > "< pre>"< / span > ));
}
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > inCodeBlock< / span > & & < span class = "class" > s< / span > .< span class = "function" > contains< / span > (< span class = "string" > "< /pre>"< / span > )) {
inCodeBlock=< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > boolean< / span > < span class = "variable" > keyword< / span > =< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > boolean< / span > < span class = "variable" > inString< / span > =< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > boolean< / span > < span class = "variable" > inChar< / span > =< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > boolean< / span > < span class = "variable" > canBeNumericalConstant< / span > =< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > int< / span > < span class = "variable" > lengthOfConstant< / span > =< span class = "number" > 0< / span > ;
storedCodeBlock+=< span class = "class" > s< / span > .< span class = "function" > substring< / span > (< span class = "number" > 0< / span > ,< span class = "class" > s< / span > .< span class = "function" > indexOf< / span > (< span class = "string" > "< /pre>"< / span > ));
storedCodeBlock=< span class = "class" > storedCodeBlock< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (< span class = "string" > "< "< / span > ),< span class = "string" > "< "< / span > );
s+=< span class = "string" > "< /pre>"< / span > ;
storedCodeBlock=< span class = "string" > "< pre>"< / span > +< span class = "keyword" > storedCodeBlock< / span > ;
< span class = "keyword" > int< / span > < span class = "variable" > startPos< / span > =< span class = "number" > 0< / span > ;
< span class = "keyword" > String< / span > < span class = "variable" > endText< / span > =< span class = "class" > s< / span > .< span class = "function" > substring< / span > (< span class = "class" > s< / span > .< span class = "function" > indexOf< / span > (< span class = "string" > "< /pre>"< / span > )+< span class = "string" > "< /pre>"< / span > .< span class = "function" > length< / span > (),< span class = "class" > s< / span > .< span class = "function" > length< / span > ());
s=< span class = "string" > ""< / span > ;
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > j< / span > =< span class = "number" > 0< / span > ;j< < span class = "class" > storedCodeBlock< / span > .< span class = "function" > length< / span > ();j++) {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (< span class = "variable" > j< / span > )==< span class = "string" > '"'< / span > ) {
inString=!< span class = "keyword" > inString< / span > ;
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > inString< / span > ) {
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "string"< / span > )+< span class = "string" > "\""< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
s+=< span class = "string" > "\"< /span>"< / span > ;
startPos=j+< span class = "number" > 1< / span > ;
}
} else
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !inString& & !inChar) {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > canBeNumericalConstant< / span > & & < span class = "function" > validNumericalConstantCharacters< / span > (lengthOfConstant, j)) {
lengthOfConstant++;
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Length of Constant now "< / span > +lengthOfConstant);
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > canBeNumericalConstant< / span > & & lengthOfConstant>< span class = "number" > 0< / span > & & !< span class = "function" > < / span > (< span class = "function" > validNumericalConstantCharacters< / span > (lengthOfConstant, j))) {
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "number"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
< span class = "comment" > //System.out.println("Setting "+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j));< / span >
lengthOfConstant=< span class = "number" > 0< / span > ;
canBeNumericalConstant=< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
startPos=j+< span class = "number" > 1< / span > ;
} else
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !canBeNumericalConstant& & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > '.'< / span > ) {
< span class = "comment" > //Previous section was a member.< / span >
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "class"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > j< / span > >< span class = "number" > 3< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (j-< span class = "number" > 3< / span > ,j+< span class = "number" > 1< / span > ).< span class = "function" > equals< / span > (< span class = "string" > "true"< / span > )& & !< span class = "function" > isAlphanumeric< / span > (j-< span class = "number" > 4< / span > )& & !< span class = "function" > isAlphanumeric< / span > (j+< span class = "number" > 1< / span > )) {
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "number"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)+< span class = "string" > "< /span>"< / span > ;
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > j< / span > >< span class = "number" > 4< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (j-< span class = "number" > 4< / span > ,j+< span class = "number" > 1< / span > ).< span class = "function" > equals< / span > (< span class = "string" > "false"< / span > )& & !< span class = "function" > isAlphanumeric< / span > (j-< span class = "number" > 5< / span > )& & !< span class = "function" > isAlphanumeric< / span > (j+< span class = "number" > 1< / span > )) {
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "number"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)+< span class = "string" > "< /span>"< / span > ;
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (< span class = "variable" > j< / span > )==< span class = "string" > '('< / span > ) {
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "function"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > j< / span > >< span class = "number" > 0< / span > & & < span class = "function" > isAlphanumeric< / span > (j-< span class = "number" > 1< / span > ) & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > ' '< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j-< span class = "number" > 1< / span > )!=< span class = "string" > ' '< / span > ) {
< span class = "comment" > //Previous section was a keyword.< / span >
keyword=< span class = "number" > true< / span > < span class = "keyword" > < / span > ;
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "keyword"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > j< / span > >< span class = "number" > 0< / span > & & < span class = "function" > isAlphanumeric< / span > (j-< span class = "number" > 1< / span > ) & & < span class = "function" > < / span > (< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > ';'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > ':'< / span > )) {
< span class = "comment" > //Previous section was a keyword.< / span >
< span class = "comment" > //keyword=true;< / span >
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "keyword"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > keyword< / span > & & !< span class = "function" > < / span > (< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > '0'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > '9'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'A'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'Z'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'a'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'z'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > ' '< / span > )) {
keyword=< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
s+=< span class = "function" > SPAN< / span > (< span class = "string" > "variable"< / span > )+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "string" > "< /span>"< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
} else
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !< span class = "function" > isAlphanumeric< / span > (j)){
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > startPos< / span > < j) {
s+=< span class = "class" > storedCodeBlock< / span > .< span class = "function" > substring< / span > (startPos,j)+< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
s+=< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
}
startPos=j+< span class = "number" > 1< / span > ;
}
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
s+=< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j);
startPos=j+< span class = "number" > 1< / span > ;
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > canBeNumericalConstant< / span > & & lengthOfConstant==< span class = "number" > 0< / span > & & !< span class = "function" > < / span > (< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > '0'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > '9'< / span > )) {
canBeNumericalConstant=< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !canBeNumericalConstant& & !< span class = "function" > isAlphanumeric< / span > (j)) {
canBeNumericalConstant=< span class = "number" > true< / span > < span class = "keyword" > < / span > ;
lengthOfConstant=< span class = "number" > 0< / span > ;
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Found "< / span > +< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)+< span class = "string" > ", can be numeric..."< / span > );
}
}
s+=< span class = "keyword" > endText< / span > ;
< span class = "comment" > //System.out.println("Stored code block: "+storedCodeBlock);< / span >
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > inCodeBlock< / span > ) {
storedCodeBlock+=s+< span class = "string" > "\n"< / span > ;
s=< span class = "string" > " "< / span > ;
}
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > length< / span > (< span class = "variable" > < / span > )>< span class = "number" > 0< / span > & & < span class = "function" > isArticleFile< / span > (f)) {
< span class = "comment" > //Check for markdown pieces.< / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > charAt< / span > (< span class = "number" > 0< / span > )< span class = "variable" > < / span > ==< span class = "string" > '-'< / span > ) {
< span class = "comment" > //Start of a title piece.< / span >
s=< span class = "class" > s< / span > .< span class = "function" > replace< / span > (< span class = "string" > "-"< / span > ,< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$TITLE_CONTENT_START"< / span > ));
s=s+< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$TITLE_CONTENT_END"< / span > ).< span class = "function" > replace< / span > (< span class = "string" > "%ID%"< / span > ,< span class = "string" > "id=\"content_"< / span > +f+< span class = "string" > "\""< / span > );
< span class = "comment" > //Use ⤈ if there's more text to be shown than can fit.< / span >
} else
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > contains< / span > (< span class = "string" > "==="< / span > < span class = "variable" > < / span > )) {
s=< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$CONTENT_END"< / span > )+< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$DATE_CONTENT_START"< / span > )+< span class = "class" > s< / span > .< span class = "function" > replace< / span > (< span class = "string" > "==="< / span > ,< span class = "string" > ""< / span > )+< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$CONTENT_END"< / span > )+< span class = "string" > "%CONDITIONAL_EXPAND%"< / span > +< span class = "class" > map< / span > .< span class = "function" > get< / span > (< span class = "string" > "$CONTENT_END"< / span > );
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > charAt< / span > (< span class = "number" > 0< / span > )< span class = "variable" > < / span > ==< span class = "string" > ':'< / span > ) {
< span class = "comment" > //Image with caption.< / span >
< span class = "comment" > //Format:< / span >
< span class = "comment" > //:< url>,< left|right|center>,< width>,< caption>< / span >
String[] < span class = "keyword" > splitter< / span > < span class = "variable" > < / span > = < span class = "class" > s< / span > .< span class = "function" > split< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (< span class = "string" > ","< / span > ));
< span class = "keyword" > StringBuilder< / span > < span class = "keyword" > captionText< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "function" > StringBuilder< / span > (< span class = "variable" > splitter< / span > [< span class = "number" > 3< / span > ]);
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > j< / span > =< span class = "number" > 4< / span > ;j< < span class = "class" > splitter< / span > .< span class = "keyword" > length< / span > ;j++) {
< span class = "class" > captionText< / span > .< span class = "function" > append< / span > (< span class = "string" > ","< / span > ).< span class = "function" > append< / span > (splitter[j]);
}
s=< span class = "string" > "< div>< figure style=\"text-align:center;"< / span > +< span class = "function" > < / span > (< span class = "function" > < / span > (splitter[< span class = "number" > 1< / span > ].< span class = "function" > equals< / span > (< span class = "string" > "left"< / span > )||splitter[< span class = "number" > 1< / span > ].< span class = "function" > equals< / span > (< span class = "string" > "right"< / span > ))?< span class = "string" > "width:"< / span > +splitter[< span class = "number" > 2< / span > ]+< span class = "string" > "%;float:"< / span > +splitter[< span class = "number" > 1< / span > ]+< span class = "string" > ";"< / span > :< span class = "string" > ""< / span > )+< span class = "string" > "\">< img src=\"/"< / span > +splitter[< span class = "number" > 0< / span > ].< span class = "function" > substring< / span > (< span class = "number" > 1< / span > )+< span class = "string" > "\" style=\"margin:auto;width:100%;\">< figcaption>"< / span > +< span class = "class" > captionText< / span > .< span class = "function" > toString< / span > ()+< span class = "string" > "< /figcaption>< /figure>< /div>"< / span > ;
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
< span class = "comment" > //It's regular content, so add paragraphs.< / span >
s=< span class = "string" > "< p class=\"color"< / span > +< span class = "function" > < / span > (< span class = "function" > < / span > (< span class = "function" > < / span > (int)< span class = "function" > < / span > (COLOR_ROTATION=< span class = "function" > < / span > (COLOR_ROTATION+0.< span class = "number" > 4< / span > )%< span class = "number" > 6< / span > ))+< span class = "number" > 1< / span > )+< span class = "string" > "\">"< / span > +s+< span class = "string" > "< /p>"< / span > ;
}
} < span class = "keyword" > else< / span > < span class = "variable" > < / span >
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > length< / span > (< span class = "variable" > < / span > )==< span class = "number" > 0< / span > & & < span class = "function" > isArticleFile< / span > (f)) {
s=< span class = "string" > "< br/>"< / span > ; < span class = "comment" > //Setup a line break here.< / span >
}
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > key< / span > < span class = "variable" > < / span > : < span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
s=< span class = "class" > s< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (key),< span class = "class" > map< / span > .< span class = "function" > get< / span > (key));
}
< span class = "class" > content< / span > .< span class = "function" > set< / span > (i,s);
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Writing to "< / span > +< span class = "class" > f< / span > .< span class = "function" > toAbsolutePath< / span > ());
< span class = "class" > Files< / span > .< span class = "function" > write< / span > (f, content, < span class = "class" > Charset< / span > .< span class = "function" > defaultCharset< / span > (),< span class = "class" > StandardOpenOption< / span > .CREATE,< span class = "class" > StandardOpenOption< / span > .TRUNCATE_EXISTING,< span class = "class" > StandardOpenOption< / span > .WRITE);
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > () + < span class = "string" > " conversion complete!"< / span > );
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
}
}
}
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > boolean< / span > < span class = "function" > validNumericalConstantCharacters< / span > (< span class = "keyword" > int< / span > < span class = "variable" > lengthOfConstant< / span > , < span class = "keyword" > int< / span > < span class = "variable" > j< / span > ) {
< span class = "keyword" > return< / span > < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (< span class = "variable" > j< / span > )>=< span class = "string" > '0'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > '9'< / span > ||lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > '.'< / span > ||lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'A'< / span > & & lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'F'< / span > ||lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'a'< / span > & & lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'f'< / span > ||lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > 'x'< / span > ||lengthOfConstant>< span class = "number" > 0< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)==< span class = "string" > 'X'< / span > ;
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > boolean< / span > < span class = "function" > isAlphanumeric< / span > (< span class = "keyword" > int< / span > < span class = "variable" > j< / span > ) {
< span class = "keyword" > return< / span > < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (< span class = "variable" > j< / span > )>=< span class = "string" > '0'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > '9'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'A'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'Z'< / span > ||< span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)>=< span class = "string" > 'a'< / span > & & < span class = "class" > storedCodeBlock< / span > .< span class = "function" > charAt< / span > (j)< =< span class = "string" > 'z'< / span > ;
}
< span class = "comment" > /**
* Writes a span tag with the included class.
* **/< / span >
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > String< / span > < span class = "function" > SPAN< / span > (< span class = "keyword" > String< / span > < span class = "variable" > className< / span > ) {
< span class = "keyword" > return< / span > < span class = "string" > "< span class=\""< / span > < span class = "variable" > < / span > +className+< span class = "string" > "\">"< / span > ;
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > GenerateArticleFiles< / span > (< span class = "variable" > Iterator< / span > < Path> items){
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Generating article files..."< / span > );
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "class" > items< / span > .< span class = "function" > hasNext< / span > (< span class = "variable" > < / span > )) {
< span class = "keyword" > Path< / span > < span class = "keyword" > f< / span > < span class = "variable" > < / span > = < span class = "class" > items< / span > .< span class = "function" > next< / span > ();
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isRegularFile< / span > (< span class = "variable" > f< / span > )& & < span class = "function" > isArticleFile< / span > (f)) {
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Creating article for "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
List< String> < span class = "keyword" > content< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (f);
List< String> < span class = "keyword" > preContent< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%DEFAULT"< / span > ));
List< String> < span class = "keyword" > postContent< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%FOOTER"< / span > ));
< span class = "keyword" > StringBuilder< / span > < span class = "keyword" > sb< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "function" > StringBuilder< / span > (< span class = "variable" > < / span > );
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > d< / span > < span class = "variable" > < / span > : preContent) {
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > k< / span > < span class = "variable" > < / span > : < span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
d=< span class = "class" > d< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (k),< span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > get< / span > (k));
}
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (d).< span class = "function" > append< / span > (< span class = "string" > "\n"< / span > );
}
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > d< / span > < span class = "variable" > < / span > : content) {
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > k< / span > < span class = "variable" > < / span > : < span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
d=< span class = "class" > d< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (k),< span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > get< / span > (k));
}
d=< span class = "class" > d< / span > .< span class = "function" > replaceFirst< / span > (< span class = "string" > "div class=\"content\""< / span > ,< span class = "string" > "div class=\"expandedContent\""< / span > );
d=< span class = "class" > d< / span > .< span class = "function" > replaceFirst< / span > (< span class = "string" > "%CONDITIONAL_EXPAND%"< / span > ,< span class = "string" > ""< / span > );
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (d).< span class = "function" > append< / span > (< span class = "string" > "\n"< / span > );
}
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > d< / span > < span class = "variable" > < / span > : postContent) {
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > k< / span > < span class = "variable" > < / span > : < span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
d=< span class = "class" > d< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (k),< span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > get< / span > (k));
}
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (d).< span class = "function" > append< / span > (< span class = "string" > "\n"< / span > );
}
< span class = "class" > Files< / span > .< span class = "function" > write< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "class" > f< / span > .< span class = "function" > getParent< / span > ().< span class = "function" > toString< / span > (),< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ()+< span class = "string" > ".html"< / span > ),< span class = "class" > sb< / span > .< span class = "function" > toString< / span > ().< span class = "function" > getBytes< / span > ());
}
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
}
}
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > ConvertArticleReferences< / span > (< span class = "variable" > Iterator< / span > < Path> items) {
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "class" > items< / span > .< span class = "function" > hasNext< / span > (< span class = "variable" > < / span > )) {
< span class = "keyword" > Path< / span > < span class = "keyword" > f< / span > < span class = "variable" > < / span > = < span class = "class" > items< / span > .< span class = "function" > next< / span > ();
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Looking for Article References..."< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
< span class = "keyword" > boolean< / span > < span class = "variable" > articleJavascriptIncluded< / span > =< span class = "number" > false< / span > < span class = "keyword" > < / span > ;
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isRegularFile< / span > (< span class = "variable" > f< / span > )& & < span class = "function" > isHTMLFile< / span > (f)) {
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Searching "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ());
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
List< String> < span class = "keyword" > content< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (f);
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > i< / span > =< span class = "number" > 0< / span > ;i< < span class = "class" > content< / span > .< span class = "function" > size< / span > ();i++) {
< span class = "keyword" > String< / span > < span class = "keyword" > s< / span > < span class = "variable" > < / span > = < span class = "class" > content< / span > .< span class = "function" > get< / span > (i);
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > s< / span > .< span class = "function" > length< / span > (< span class = "variable" > < / span > )>< span class = "number" > 0< / span > & & < span class = "class" > s< / span > .< span class = "function" > contains< / span > (< span class = "string" > "$ARTICLE_PREVIEW"< / span > )) {
< span class = "keyword" > String< / span > < span class = "keyword" > article< / span > < span class = "variable" > < / span > = ARTICLESDIR+< span class = "string" > "/"< / span > +< span class = "class" > s< / span > .< span class = "function" > replace< / span > (< span class = "string" > "$ARTICLE_PREVIEW "< / span > ,< span class = "string" > ""< / span > )+< span class = "string" > ".article"< / span > ;
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Found article preview request in "< / span > +< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ()+< span class = "string" > " for article "< / span > +article+< span class = "string" > "."< / span > );
< span class = "keyword" > Path< / span > < span class = "keyword" > file< / span > < span class = "variable" > < / span > = < span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR,article);
List< String> < span class = "keyword" > newData< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (file);
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > newData< / span > .< span class = "function" > size< / span > (< span class = "variable" > < / span > )>< span class = "number" > 0< / span > ) {
< span class = "class" > content< / span > .< span class = "function" > set< / span > (i,< span class = "class" > newData< / span > .< span class = "function" > get< / span > (< span class = "number" > 0< / span > ));
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > j< / span > =< span class = "number" > 1< / span > ;j< < span class = "class" > newData< / span > .< span class = "function" > size< / span > ();j++) {
< span class = "class" > content< / span > .< span class = "function" > add< / span > (i+j, < span class = "class" > newData< / span > .< span class = "function" > get< / span > (j));
}
< span class = "keyword" > String< / span > < span class = "variable" > lastline< / span > =< span class = "class" > content< / span > .< span class = "function" > get< / span > (i+< span class = "class" > newData< / span > .< span class = "function" > size< / span > ()-< span class = "number" > 1< / span > );
lastline=< span class = "class" > lastline< / span > .< span class = "function" > replace< / span > (< span class = "string" > "%CONDITIONAL_EXPAND%"< / span > ,< span class = "string" > "< div class=\"unexpanded\" id=\"expand_"< / span > +i+< span class = "string" > "\" onClick=\"expand(this,'"< / span > +< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR,< span class = "class" > article< / span > .< span class = "function" > toString< / span > ())+< span class = "string" > "')\">< br/>< br/>< br/>< br/>⤈ Click to expand.< /div>"< / span > );
< span class = "class" > content< / span > .< span class = "function" > set< / span > (i+< span class = "class" > newData< / span > .< span class = "function" > size< / span > ()-< span class = "number" > 1< / span > ,lastline);< span class = "comment" > //< div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\">< br/>< br/>< br/>< br/>⤈ Click to expand.< /div>");< / span >
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
< span class = "class" > content< / span > .< span class = "function" > set< / span > (i,< span class = "string" > ""< / span > );
}
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !articleJavascriptIncluded) {
List< String> < span class = "keyword" > articlejs< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (REFDIR,< span class = "string" > "article.js"< / span > ));
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > int< / span > < span class = "variable" > j< / span > =< span class = "class" > articlejs< / span > .< span class = "function" > size< / span > ()-< span class = "number" > 1< / span > ;j>=< span class = "number" > 0< / span > ;j--) {
< span class = "class" > content< / span > .< span class = "function" > add< / span > (i,< span class = "class" > articlejs< / span > .< span class = "function" > get< / span > (j));
}
articleJavascriptIncluded=< span class = "number" > true< / span > < span class = "keyword" > < / span > ;
}
}
}
< span class = "class" > Files< / span > .< span class = "function" > write< / span > (f,content);
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
}
}
}
}
< span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > copyDirectory< / span > (< span class = "keyword" > String< / span > < span class = "variable" > sourceDirectoryLocation< / span > , < span class = "keyword" > String< / span > < span class = "variable" > destinationDirectoryLocation< / span > )
< span class = "keyword" > throws< / span > < span class = "keyword" > IOException< / span > < span class = "variable" > < / span > {
< span class = "class" > Files< / span > .< span class = "function" > walk< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (sourceDirectoryLocation))
.< span class = "function" > forEach< / span > (< span class = "keyword" > source< / span > < span class = "variable" > < / span > -> {
< span class = "keyword" > Path< / span > < span class = "keyword" > destination< / span > < span class = "variable" > < / span > = < span class = "class" > Paths< / span > .< span class = "function" > get< / span > (destinationDirectoryLocation, < span class = "class" > source< / span > .< span class = "function" > toString< / span > ()
.< span class = "function" > substring< / span > (< span class = "class" > sourceDirectoryLocation< / span > .< span class = "function" > length< / span > ()));
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isDirectory< / span > (< span class = "variable" > destination< / span > )) {
< span class = "class" > Files< / span > .< span class = "function" > createDirectories< / span > (destination);
} < span class = "keyword" > else< / span > < span class = "variable" > < / span > {
< span class = "class" > Files< / span > .< span class = "function" > copy< / span > (source, destination, < span class = "keyword" > new< / span > < span class = "variable" > CopyOption< / span > []{< span class = "class" > StandardCopyOption< / span > .COPY_ATTRIBUTES,< span class = "class" > StandardCopyOption< / span > .REPLACE_EXISTING});
}
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
}
});
}
< span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > buildDirectoryListings< / span > (< span class = "variable" > < / span > )
< span class = "keyword" > throws< / span > < span class = "keyword" > IOException< / span > < span class = "variable" > < / span > {
< span class = "keyword" > String< / span > < span class = "variable" > startingPath< / span > =< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "class" > sigPlace< / span > .OUTDIR).< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > ();
HashMap< String,List< Path>> < span class = "keyword" > map< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "variable" > HashMap< / span > < >< span class = "function" > < / span > ();
Iterator< Path> < span class = "keyword" > it< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > walk< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "class" > sigPlace< / span > .OUTDIR)).< span class = "function" > iterator< / span > ();
< span class = "class" > map< / span > .< span class = "function" > put< / span > (< span class = "string" > "/"< / span > ,< span class = "keyword" > new< / span > < span class = "variable" > ArrayList< / span > < Path>< span class = "function" > < / span > ());
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "class" > it< / span > .< span class = "function" > hasNext< / span > (< span class = "variable" > < / span > )) {
< span class = "keyword" > Path< / span > < span class = "keyword" > f< / span > < span class = "variable" > < / span > = < span class = "class" > it< / span > .< span class = "function" > next< / span > ();
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ().< span class = "function" > toString< / span > ().< span class = "function" > equals< / span > (OUTDIR)) {
< span class = "keyword" > String< / span > < span class = "keyword" > myKey< / span > < span class = "variable" > < / span > = < span class = "class" > f< / span > .< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > ().< span class = "function" > replace< / span > (startingPath,< span class = "string" > ""< / span > ).< span class = "function" > replace< / span > (< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ().< span class = "function" > toString< / span > (),< span class = "string" > ""< / span > );
< span class = "comment" > //System.out.println(myKey+","+f);< / span >
< span class = "class" > map< / span > .< span class = "function" > putIfAbsent< / span > (myKey,< span class = "keyword" > new< / span > < span class = "variable" > ArrayList< / span > < Path>< span class = "function" > < / span > ());
< span class = "class" > map< / span > .< span class = "function" > get< / span > (myKey).< span class = "function" > add< / span > (f);
}
}
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Directory structure determined:"< / span > );
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " "< / span > +map);
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > key< / span > < span class = "variable" > < / span > : < span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > "Creating directory listing for "< / span > +key+< span class = "string" > "..."< / span > );
< span class = "keyword" > StringBuilder< / span > < span class = "keyword" > sb< / span > < span class = "variable" > < / span > = < span class = "keyword" > new< / span > < span class = "function" > StringBuilder< / span > (< span class = "string" > ""< / span > < span class = "variable" > < / span > );
List< String> < span class = "keyword" > data< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%DEFAULT"< / span > ));
List< String> < span class = "keyword" > data2< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (< span class = "class" > ops< / span > .< span class = "function" > get< / span > (< span class = "string" > "%FOOTER"< / span > ));
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > d< / span > < span class = "variable" > < / span > : data) {
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > k< / span > < span class = "variable" > < / span > : < span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
d=< span class = "class" > d< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (k),< span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > get< / span > (k));
}
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (d).< span class = "function" > append< / span > (< span class = "string" > "\n"< / span > );
}
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (< span class = "string" > "< h2>Directory Listing for "< / span > +key+< span class = "string" > "< /h2>"< / span > );
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (< span class = "string" > "< div class=\"folderlisting\">< a href=\""< / span > )
.< span class = "function" > append< / span > (key)
.< span class = "function" > append< / span > (< span class = "string" > "..\" class=\"icon\">📁 < /a>< a href=\""< / span > )
.< span class = "function" > append< / span > (key)
.< span class = "function" > append< / span > (< span class = "string" > "..\">.. < /a>< a href=\""< / span > )
.< span class = "function" > append< / span > (key)
.< span class = "function" > append< / span > (< span class = "string" > "..\" class=\"nounderline\">(Previous Directory)< /a>< /div>"< / span > );
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > Path< / span > < span class = "keyword" > f< / span > < span class = "variable" > < / span > : < span class = "class" > map< / span > .< span class = "function" > get< / span > (key)) {
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (< span class = "string" > "< div class=\""< / span > ).< span class = "function" > append< / span > (< span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isDirectory< / span > (f)?< span class = "string" > "folderlisting"< / span > :< span class = "string" > "filelisting"< / span > )).< span class = "function" > append< / span > (< span class = "string" > "\">"< / span > )
.< span class = "function" > append< / span > (< span class = "string" > "< a href=\""< / span > +< span class = "function" > < / span > (< span class = "class" > f< / span > .< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > ().< span class = "function" > replace< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR).< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > (),< span class = "string" > ""< / span > ))+< span class = "string" > "\" class=\"icon\">"< / span > )
.< span class = "function" > append< / span > (< span class = "function" > < / span > (< span class = "class" > Files< / span > .< span class = "function" > isDirectory< / span > (f)?< span class = "string" > "📁 "< / span > :< span class = "string" > "🗎 "< / span > ))
.< span class = "function" > append< / span > (< span class = "string" > "< /a>"< / span > )
.< span class = "function" > append< / span > (< span class = "string" > "< a href=\""< / span > +< span class = "function" > < / span > (< span class = "class" > f< / span > .< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > ().< span class = "function" > replace< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR).< span class = "function" > toAbsolutePath< / span > ().< span class = "function" > toString< / span > (),< span class = "string" > ""< / span > ))+< span class = "string" > "\">"< / span > )
.< span class = "function" > append< / span > (< span class = "class" > f< / span > .< span class = "function" > getFileName< / span > ())
.< span class = "function" > append< / span > (< span class = "string" > "< /a>\t"< / span > )
.< span class = "function" > append< / span > (< span class = "class" > Files< / span > .< span class = "function" > getLastModifiedTime< / span > (f))
.< span class = "function" > append< / span > (< span class = "string" > "\t"< / span > )
.< span class = "function" > append< / span > (< span class = "class" > Files< / span > .< span class = "function" > getOwner< / span > (f))
.< span class = "function" > append< / span > (< span class = "string" > "\t"< / span > )
.< span class = "function" > append< / span > (< span class = "class" > Files< / span > .< span class = "function" > size< / span > (f))
.< span class = "function" > append< / span > (< span class = "string" > "< /div>\n"< / span > );
}
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > d< / span > < span class = "variable" > < / span > : data2) {
< span class = "keyword" > for< / span > < span class = "function" > < / span > (< span class = "keyword" > String< / span > < span class = "keyword" > k< / span > < span class = "variable" > < / span > : < span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > keySet< / span > ()) {
d=< span class = "class" > d< / span > .< span class = "function" > replaceAll< / span > (< span class = "class" > Pattern< / span > .< span class = "function" > quote< / span > (k),< span class = "class" > sigPlace< / span > .< span class = "class" > map< / span > .< span class = "function" > get< / span > (k));
}
< span class = "class" > sb< / span > .< span class = "function" > append< / span > (d).< span class = "function" > append< / span > (< span class = "string" > "\n"< / span > );
}
< span class = "keyword" > Path< / span > < span class = "keyword" > newf< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > write< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR,key,DIRECTORYLISTING_FILENAME),< span class = "class" > sb< / span > .< span class = "function" > toString< / span > ().< span class = "function" > getBytes< / span > ());
< span class = "class" > System< / span > .< span class = "class" > out< / span > .< span class = "function" > println< / span > (< span class = "string" > " Added info for ("< / span > +< span class = "class" > map< / span > .< span class = "function" > size< / span > ()+< span class = "string" > ") files to "< / span > +< span class = "class" > newf< / span > .< span class = "function" > toAbsolutePath< / span > ());
}
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > boolean< / span > < span class = "function" > isArticleFile< / span > (< span class = "keyword" > Path< / span > < span class = "variable" > f< / span > ) {
< span class = "keyword" > return< / span > < span class = "class" > f< / span > .< span class = "function" > getFileName< / span > (< span class = "variable" > < / span > ).< span class = "function" > toString< / span > ().< span class = "function" > contains< / span > (< span class = "string" > ".article"< / span > );
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > boolean< / span > < span class = "function" > isHTMLFile< / span > (< span class = "keyword" > Path< / span > < span class = "variable" > f< / span > ) {
< span class = "keyword" > return< / span > < span class = "class" > f< / span > .< span class = "function" > getFileName< / span > (< span class = "variable" > < / span > ).< span class = "function" > toString< / span > ().< span class = "function" > contains< / span > (< span class = "string" > ".html"< / span > );
}
< span class = "keyword" > private< / span > < span class = "keyword" > static< / span > < span class = "keyword" > void< / span > < span class = "function" > ExportCodeFile< / span > (< span class = "variable" > < / span > ) {
< span class = "keyword" > try< / span > < span class = "variable" > < / span > {
< span class = "keyword" > Path< / span > < span class = "keyword" > file< / span > < span class = "variable" > < / span > = < span class = "class" > Paths< / span > .< span class = "function" > get< / span > (< span class = "string" > "sigServer.java"< / span > );
List< String> < span class = "keyword" > data< / span > < span class = "variable" > < / span > = < span class = "class" > Files< / span > .< span class = "function" > readAllLines< / span > (file);
< span class = "keyword" > int< / span > < span class = "variable" > i< / span > =< span class = "number" > 0< / span > ;
< span class = "keyword" > while< / span > < span class = "function" > < / span > (< span class = "variable" > < / span > !< span class = "class" > data< / span > .< span class = "function" > get< / span > (i++).< span class = "function" > contains< / span > (< span class = "string" > "sigServer()"< / span > )&&i< < span class = "class" > data< / span > .< span class = "function" > size< / span > ());
< span class = "keyword" > if< / span > < span class = "function" > < / span > (< span class = "variable" > i< / span > < < span class = "class" > data< / span > .< span class = "function" > size< / span > ()) {
< span class = "class" > Files< / span > .< span class = "function" > write< / span > (< span class = "class" > Paths< / span > .< span class = "function" > get< / span > (OUTDIR,< span class = "string" > "codeBackground"< / span > ),< span class = "class" > data< / span > .< span class = "function" > subList< / span > (i, < span class = "class" > Math< / span > .< span class = "function" > min< / span > (i+< span class = "number" > 40< / span > ,< span class = "class" > data< / span > .< span class = "function" > size< / span > ())),< span class = "class" > Charset< / span > .< span class = "function" > defaultCharset< / span > (),< span class = "class" > StandardOpenOption< / span > .CREATE,< span class = "class" > StandardOpenOption< / span > .TRUNCATE_EXISTING,< span class = "class" > StandardOpenOption< / span > .WRITE);
}
} < span class = "keyword" > catch< / span > < span class = "function" > < / span > (< span class = "keyword" > IOException< / span > < span class = "variable" > e< / span > ) {
< span class = "class" > e< / span > .< span class = "function" > printStackTrace< / span > ();
}
}
}
< / pre >
< / p >
< / div > < div class = "datebar" > < / div > < div class = "date" > 3 May 2022 10:25AM< / div > < div class = "unexpanded" id = "expand_40" onClick = "expand(this,'out/articles/sigplace1.article')" > < br / > < br / > < br / > < br / > ⤈ Click to expand.< / div > < / div >
< div class = "contentWrapper" > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test1.article.html" > < h1 > A Test Title< / h1 > < / a > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test1.article.html" > 🔗< / a > < div class = "content" id = "content_out/articles/test articles/test1.article" >
< p class = "color1" >
In dolor erat, malesuada at elit cursus, convallis imperdiet turpis. Ut aliquet magna tellus, at viverra mauris ullamcorper vehicula. Nam quis urna semper magna ornare elementum sed id mauris. Suspendisse faucibus nunc ante, ac rhoncus nisl tristique sed. Vestibulum pretium odio eget scelerisque vestibulum. Aliquam viverra ex ac vestibulum interdum. Donec ligula nunc, dignissim a purus vitae, fermentum laoreet diam. Quisque nec auctor urna. Vestibulum sit amet ligula ullamcorper, congue ipsum et, accumsan ante. Phasellus fermentum, sapien nec pulvinar blandit, elit purus pretium urna, et dapibus orci urna eu metus. Nunc molestie dictum pharetra. Suspendisse luctus felis et ante tristique, vitae commodo diam porttitor. Aliquam orci eros, placerat ac justo vitae, bibendum efficitur metus. Phasellus eget bibendum mauris.
< / p >
< / div > < div class = "datebar" > < / div > < div class = "date" > 2 May 2022 10:16AM< / div > < div class = "unexpanded" id = "expand_534" onClick = "expand(this,'out/articles/test articles/test1.article')" > < br / > < br / > < br / > < br / > ⤈ Click to expand.< / div > < / div >
< div class = "contentWrapper" > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test2.article.html" > < h1 > Another test title< / h1 > < / a > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test2.article.html" > 🔗< / a > < div class = "content" id = "content_out/articles/test articles/test2.article" >
< p class = "color1" >
Sed lobortis nisi id nunc tincidunt volutpat. Mauris cursus felis quis condimentum posuere. Pellentesque vitae dolor et justo suscipit ultrices. Integer dapibus leo id felis varius, ut volutpat massa bibendum. Quisque sed nunc arcu. In sit amet faucibus magna, non venenatis massa. Cras sed placerat risus, id consectetur est. Pellentesque in nunc dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque eget lorem ac urna posuere accumsan. Quisque sed imperdiet nisi.
< / p >
< / div > < div class = "datebar" > < / div > < div class = "date" > 1 May 2022 05:13AM< / div > < div class = "unexpanded" id = "expand_539" onClick = "expand(this,'out/articles/test articles/test2.article')" > < br / > < br / > < br / > < br / > ⤈ Click to expand.< / div > < / div >
< div class = "contentWrapper" > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test3.article.html" > < h1 > And More< / h1 > < / a > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/test articles/test3.article.html" > 🔗< / a > < div class = "content" id = "content_out/articles/test articles/test3.article" >
< p class = "color2" >
Curabitur suscipit quam tellus, non rhoncus diam vehicula in. Aliquam ut dapibus tortor. Cras accumsan arcu vel ante maximus ornare. Nam tempus fermentum leo maximus euismod. Donec vehicula pretium est a ultrices. Nunc blandit nibh lorem, nec blandit leo posuere quis. Sed mauris ligula, euismod eu aliquam vel, rhoncus eget magna. Proin eget tortor ut ligula suscipit mattis. Integer rutrum aliquet eleifend. Suspendisse leo libero, placerat nec mi id, sagittis malesuada felis. Quisque euismod ante cursus elit lobortis, eu tempus ligula condimentum. Mauris viverra metus et dignissim efficitur. Ut placerat nunc nunc, eu tempus neque ultrices nec. Suspendisse et magna risus. Phasellus in ullamcorper tortor. Sed lobortis ut mi in blandit.
< / p >
< / div > < div class = "datebar" > < / div > < div class = "date" > 30 Apr 2022 6:14PM< / div > < div class = "unexpanded" id = "expand_544" onClick = "expand(this,'out/articles/test articles/test3.article')" > < br / > < br / > < br / > < br / > ⤈ Click to expand.< / div > < / div >
< div class = "contentWrapper" > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/curabitur vel tempus ex.article.html" > < h1 > Curabitur vel tempus ex< / h1 > < / a > < a title = "Click to go to the original article and to view comments!" class = "reallink" href = "articles/curabitur vel tempus ex.article.html" > 🔗< / a > < div class = "content" id = "content_out/articles/curabitur vel tempus ex.article" >
< p class = "color3" >
Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. Nullam odio purus, tristique non turpis sit amet, malesuada ultricies purus. Mauris ut nulla nisl. Aenean sit amet est egestas justo volutpat consequat. Suspendisse in sagittis augue, et mattis tortor. Nullam viverra metus et nibh fringilla iaculis.
< / p >
< br / >
< p class = "color3" >
< pre >
< >< Test>< span class = "string" > "< /test>< /test2>< test3>"< / span >
< / pre >
< / p >
< / div > < div class = "datebar" > < / div > < div class = "date" > 29 Apr 2022 7:37PM< / div > < div class = "unexpanded" id = "expand_549" onClick = "expand(this,'out/articles/curabitur vel tempus ex.article')" > < br / > < br / > < br / > < br / > ⤈ Click to expand.< / div > < / div >
< / div > <!-- End Content Body -->
< div class = "codeForeground" id = "codeForeground" > < / div >
< div class = "codeBackground" id = "codeBackground" > < / div >
< / body >
< footer >
< / footer >
< / html >