Print japanese characters

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago
parent 739d663622
commit 187e3b814f
  1. 42
      ArcadeReader.java
  2. 36
      out/DIRECTORY_LISTING
  3. 34
      out/articles/DIRECTORY_LISTING
  4. 7
      out/articles/Love Live! Custom Arcade Controller.article
  5. 194
      out/articles/Love Live! Custom Arcade Controller.article.html
  6. 11
      out/articles/curabitur vel tempus ex.article
  7. 198
      out/articles/curabitur vel tempus ex.article.html
  8. 486
      out/articles/sigplace1.article
  9. 673
      out/articles/sigplace1.article.html
  10. 33
      out/articles/test articles/DIRECTORY_LISTING
  11. 5
      out/articles/test articles/test1.article
  12. 192
      out/articles/test articles/test1.article.html
  13. 5
      out/articles/test articles/test2.article
  14. 192
      out/articles/test articles/test2.article.html
  15. 5
      out/articles/test articles/test3.article
  16. 192
      out/articles/test articles/test3.article.html
  17. 40
      out/codeBackground
  18. 50
      out/error.html
  19. 29
      out/images/DIRECTORY_LISTING
  20. BIN
      out/images/Love_Live!_Logo.png
  21. BIN
      out/images/github.webp
  22. 567
      out/otherpage.html
  23. 47
      out/reset.css
  24. 479
      out/sig.css
  25. 51
      out/testfile.html
  26. 51
      out/uploadform.html
  27. 6
      sigPlace.java

@ -1,3 +1,43 @@
import java.io.PrintWriter;
public class ArcadeReader {
public ArcadeReader() {
/*
Hiragana: 3041-3096
Katakana: 30A0-30FF
Kanji: 3400-4DB5,4E00-9FCB,F900-FA6A
Kanji Radicals: 2E80-2FD5
*/
PrintWriter pw = new PrintWriter(System.out,true);
pw.printf("0x3041~0x3096:\n");
for (char i=0x3041;i<=0x3096;i++) {
pw.print(i);
}
pw.printf("\n");
pw.printf("0x30A0~0x30FF:\n");
for (char i=0x30A0;i<=0x30FF;i++) {
pw.print(i);
}
pw.printf("\n");
pw.printf("0x3400~0x4DB5:\n");
for (char i=0x3400;i<=0x4DB5;i++) {
pw.print(i);
}
pw.printf("\n");
pw.printf("0x4E00~0x9FCB:\n");
for (char i=0x4E00;i<=0x9FCB;i++) {
pw.print(i);
}
pw.printf("\n");
pw.printf("0xF900~0xFA6A:\n");
for (char i=0xF900;i<=0xFA6A;i++) {
pw.print(i);
}
pw.printf("\n");
pw.printf("0x2E80~0x2FD5:\n");
for (char i=0x2E80;i<=0x2FD5;i++) {
pw.print(i);
}
pw.printf("\n");
}
}

@ -1,36 +0,0 @@
<!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>
<h2>Directory Listing for /</h2><div class="folderlisting"><a href="/.." class="icon">&#x1F4C1;</a><a href="/..">.. </a><a href="/.." class="nounderline">(Previous Directory)</a></div><div class="folderlisting"><a href="/articles" class="icon">&#x1F4C1;</a><a href="/articles">articles</a> 2022-08-03T19:48:45.182844Z gitpod 4096</div>
<div class="filelisting"><a href="/codeBackground" class="icon">&#x1F5CE;</a><a href="/codeBackground">codeBackground</a> 2022-08-03T19:48:45.110844Z gitpod 2635</div>
<div class="filelisting"><a href="/error.html" class="icon">&#x1F5CE;</a><a href="/error.html">error.html</a> 2022-08-03T19:48:45.126844Z gitpod 1828</div>
<div class="folderlisting"><a href="/images" class="icon">&#x1F4C1;</a><a href="/images">images</a> 2022-08-03T19:48:45.174844Z gitpod 77</div>
<div class="filelisting"><a href="/otherpage.html" class="icon">&#x1F5CE;</a><a href="/otherpage.html">otherpage.html</a> 2022-08-03T19:48:45.134844Z gitpod 88526</div>
<div class="filelisting"><a href="/reset.css" class="icon">&#x1F5CE;</a><a href="/reset.css">reset.css</a> 2022-08-03T19:48:45.114844Z gitpod 1092</div>
<div class="filelisting"><a href="/sig.css" class="icon">&#x1F5CE;</a><a href="/sig.css">sig.css</a> 2022-08-03T19:48:45.122844Z gitpod 11140</div>
<div class="filelisting"><a href="/testfile.html" class="icon">&#x1F5CE;</a><a href="/testfile.html">testfile.html</a> 2022-08-03T19:48:45.138844Z gitpod 1783</div>
<div class="filelisting"><a href="/uploadform.html" class="icon">&#x1F5CE;</a><a href="/uploadform.html">uploadform.html</a> 2022-08-03T19:48:45.138844Z gitpod 1863</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,34 +0,0 @@
<!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>
<h2>Directory Listing for /articles/</h2><div class="folderlisting"><a href="/articles/.." class="icon">&#x1F4C1;</a><a href="/articles/..">.. </a><a href="/articles/.." class="nounderline">(Previous Directory)</a></div><div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article" class="icon">&#x1F5CE;</a><a href="/articles/Love Live! Custom Arcade Controller.article">Love Live! Custom Arcade Controller.article</a> 2022-08-03T19:48:44.638844Z gitpod 497</div>
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article" class="icon">&#x1F5CE;</a><a href="/articles/curabitur vel tempus ex.article">curabitur vel tempus ex.article</a> 2022-08-03T19:48:44.666844Z gitpod 730</div>
<div class="filelisting"><a href="/articles/sigplace1.article" class="icon">&#x1F5CE;</a><a href="/articles/sigplace1.article">sigplace1.article</a> 2022-08-03T19:48:45.102844Z gitpod 80858</div>
<div class="folderlisting"><a href="/articles/test articles" class="icon">&#x1F4C1;</a><a href="/articles/test articles">test articles</a> 2022-08-03T19:48:45.166844Z gitpod 147</div>
<div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article.html" class="icon">&#x1F5CE;</a><a href="/articles/Love Live! Custom Arcade Controller.article.html">Love Live! Custom Arcade Controller.article.html</a> 2022-08-03T19:48:45.142844Z gitpod 10444</div>
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article.html" class="icon">&#x1F5CE;</a><a href="/articles/curabitur vel tempus ex.article.html">curabitur vel tempus ex.article.html</a> 2022-08-03T19:48:45.154844Z gitpod 10653</div>
<div class="filelisting"><a href="/articles/sigplace1.article.html" class="icon">&#x1F5CE;</a><a href="/articles/sigplace1.article.html">sigplace1.article.html</a> 2022-08-03T19:48:45.162844Z gitpod 90753</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,7 +0,0 @@
<div class="contentWrapper"><h1>My Love Live! Custom Arcade Controller</h1><div class="content" id="content_out/articles/Love Live! Custom Arcade Controller.article">
<br/>
<p class="color1">
For over a year since I first got into <u>Love Live! School Idol Festival ~after school ACTIVITY~ Wai-Wai!Home Meeting!!</u> <sup>Try saying that one 10 times fast!</sup><sub>Subscript</sub>
</p>
<br/>
</div><div class="datebar"></div><div class="date">15 July 2022 1:53PM</div>%CONDITIONAL_EXPAND%</div>

@ -1,194 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>My Love Live! Custom Arcade Controller</h1><div class="expandedContent" id="content_out/articles/Love Live! Custom Arcade Controller.article">
<br/>
<p class="color1">
For over a year since I first got into <u>Love Live! School Idol Festival ~after school ACTIVITY~ Wai-Wai!Home Meeting!!</u> <sup>Try saying that one 10 times fast!</sup><sub>Subscript</sub>
</p>
<br/>
</div><div class="datebar"></div><div class="date">15 July 2022 1:53PM</div></div>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=Love Live! Custom Arcade Controller.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=Love Live! Custom Arcade Controller.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,11 +0,0 @@
<div class="contentWrapper"><h1>Curabitur vel tempus ex</h1><div class="content" id="content_out/articles/curabitur vel tempus ex.article">
<p class="color1">
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="color2">
<pre>
&lt;>&lt;Test><span class="string">"&lt;/test>&lt;/test2>&lt;test3>"</span>
</pre>
</p>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div>%CONDITIONAL_EXPAND%</div>

@ -1,198 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>Curabitur vel tempus ex</h1><div class="expandedContent" id="content_out/articles/curabitur vel tempus ex.article">
<p class="color1">
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="color2">
<pre>
&lt;>&lt;Test><span class="string">"&lt;/test>&lt;/test2>&lt;test3>"</span>
</pre>
</p>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div></div>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=curabitur vel tempus ex.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=curabitur vel tempus ex.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,486 +0,0 @@
<div class="contentWrapper"><h1>Welcome to SigPlace!</h1><div class="content" id="content_out/articles/sigplace1.article">
<p class="color2">
This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.
</p>
<p class="color3">
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="color3">
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="color3">
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="color4">
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="color4">
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="color4">
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="color5">
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="color5">
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="color6">
<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>&lt;String,String> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"contentWrapper\">&lt;h1>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_END"</span>, <span class="string">"&lt;/h1>&lt;div class=\"content\" %ID%>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$CONTENT_END"</span>, <span class="string">"&lt;/div>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$DATE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"datebar\">&lt;/div>&lt;div class=\"date\">"</span>)
));
<span class="keyword">final</span> <span class="keyword">static</span> <span class="variable">HashMap</span>&lt;String,Path> <span class="keyword">ops</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;<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&lt;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>&lt;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&lt;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&lt;<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">"&lt;pre>"</span><span class="variable"></span>)) {
<span class="comment">//System.out.println("Inside &lt;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">"&lt;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">"&lt;/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">"&lt;/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">"&lt;"</span>),<span class="string">"&lt;"</span>);
s+=<span class="string">"&lt;/pre>"</span>;
storedCodeBlock=<span class="string">"&lt;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">"&lt;/pre>"</span>)+<span class="string">"&lt;/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&lt;<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">"\"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;/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>&lt;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)&lt;=<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">//:&lt;url>,&lt;left|right|center>,&lt;width>,&lt;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&lt;<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">"&lt;div>&lt;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">"\">&lt;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%;\">&lt;figcaption>"</span>+<span class="class">captionText</span>.<span class="function">toString</span>()+<span class="string">"&lt;/figcaption>&lt;/figure>&lt;/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">"&lt;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">"&lt;/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">"&lt;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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;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>&lt;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&lt;String> <span class="keyword">content</span> <span class="variable"></span>= <span class="class">Files</span>.<span class="function">readAllLines</span>(f);
List&lt;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&lt;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>&lt;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&lt;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&lt;<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&lt;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&lt;<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">"&lt;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">"')\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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">//&lt;div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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&lt;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&lt;String,List&lt;Path>> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><span class="function"></span>();
Iterator&lt;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>&lt;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>&lt;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&lt;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&lt;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">"&lt;h2>Directory Listing for "</span>+key+<span class="string">"&lt;/h2>"</span>);
<span class="class">sb</span>.<span class="function">append</span>(<span class="string">"&lt;div class=\"folderlisting\">&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"icon\">&#x1F4C1;&lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\">.. &lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"nounderline\">(Previous Directory)&lt;/a>&lt;/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">"&lt;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">"&lt;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">"&#x1F4C1;"</span>:<span class="string">"&#x1F5CE;"</span>))
.<span class="function">append</span>(<span class="string">"&lt;/a>"</span>)
.<span class="function">append</span>(<span class="string">"&lt;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">"&lt;/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">"&lt;/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&lt;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&lt;<span class="class">data</span>.<span class="function">size</span>());
<span class="keyword">if</span> <span class="function"></span>(<span class="variable">i</span>&lt;<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>%CONDITIONAL_EXPAND%</div>

@ -1,673 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>Welcome to SigPlace!</h1><div class="expandedContent" id="content_out/articles/sigplace1.article">
<p class="color2">
This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.
</p>
<p class="color3">
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="color3">
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="color3">
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="color4">
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="color4">
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="color4">
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="color5">
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="color5">
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="color6">
<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>&lt;String,String> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"contentWrapper\">&lt;h1>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_END"</span>, <span class="string">"&lt;/h1>&lt;div class=\"content\" %ID%>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$CONTENT_END"</span>, <span class="string">"&lt;/div>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$DATE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"datebar\">&lt;/div>&lt;div class=\"date\">"</span>)
));
<span class="keyword">final</span> <span class="keyword">static</span> <span class="variable">HashMap</span>&lt;String,Path> <span class="keyword">ops</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;<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&lt;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>&lt;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&lt;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&lt;<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">"&lt;pre>"</span><span class="variable"></span>)) {
<span class="comment">//System.out.println("Inside &lt;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">"&lt;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">"&lt;/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">"&lt;/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">"&lt;"</span>),<span class="string">"&lt;"</span>);
s+=<span class="string">"&lt;/pre>"</span>;
storedCodeBlock=<span class="string">"&lt;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">"&lt;/pre>"</span>)+<span class="string">"&lt;/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&lt;<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">"\"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;/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>&lt;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)&lt;=<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">//:&lt;url>,&lt;left|right|center>,&lt;width>,&lt;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&lt;<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">"&lt;div>&lt;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">"\">&lt;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%;\">&lt;figcaption>"</span>+<span class="class">captionText</span>.<span class="function">toString</span>()+<span class="string">"&lt;/figcaption>&lt;/figure>&lt;/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">"&lt;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">"&lt;/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">"&lt;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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;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>&lt;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&lt;String> <span class="keyword">content</span> <span class="variable"></span>= <span class="class">Files</span>.<span class="function">readAllLines</span>(f);
List&lt;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&lt;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>&lt;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&lt;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&lt;<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&lt;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&lt;<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">"&lt;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">"')\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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">//&lt;div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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&lt;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&lt;String,List&lt;Path>> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><span class="function"></span>();
Iterator&lt;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>&lt;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>&lt;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&lt;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&lt;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">"&lt;h2>Directory Listing for "</span>+key+<span class="string">"&lt;/h2>"</span>);
<span class="class">sb</span>.<span class="function">append</span>(<span class="string">"&lt;div class=\"folderlisting\">&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"icon\">&#x1F4C1;&lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\">.. &lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"nounderline\">(Previous Directory)&lt;/a>&lt;/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">"&lt;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">"&lt;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">"&#x1F4C1;"</span>:<span class="string">"&#x1F5CE;"</span>))
.<span class="function">append</span>(<span class="string">"&lt;/a>"</span>)
.<span class="function">append</span>(<span class="string">"&lt;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">"&lt;/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">"&lt;/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&lt;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&lt;<span class="class">data</span>.<span class="function">size</span>());
<span class="keyword">if</span> <span class="function"></span>(<span class="variable">i</span>&lt;<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>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=sigplace1.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=sigplace1.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,33 +0,0 @@
<!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>
<h2>Directory Listing for /articles/test articles/</h2><div class="folderlisting"><a href="/articles/test articles/.." class="icon">&#x1F4C1;</a><a href="/articles/test articles/..">.. </a><a href="/articles/test articles/.." class="nounderline">(Previous Directory)</a></div><div class="filelisting"><a href="/articles/test articles/test1.article" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test1.article">test1.article</a> 2022-08-03T19:48:45.106844Z gitpod 1085</div>
<div class="filelisting"><a href="/articles/test articles/test2.article" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test2.article">test2.article</a> 2022-08-03T19:48:45.106844Z gitpod 781</div>
<div class="filelisting"><a href="/articles/test articles/test3.article" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test3.article">test3.article</a> 2022-08-03T19:48:45.106844Z gitpod 994</div>
<div class="filelisting"><a href="/articles/test articles/test1.article.html" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test1.article.html">test1.article.html</a> 2022-08-03T19:48:45.162844Z gitpod 10972</div>
<div class="filelisting"><a href="/articles/test articles/test2.article.html" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test2.article.html">test2.article.html</a> 2022-08-03T19:48:45.166844Z gitpod 10668</div>
<div class="filelisting"><a href="/articles/test articles/test3.article.html" class="icon">&#x1F5CE;</a><a href="/articles/test articles/test3.article.html">test3.article.html</a> 2022-08-03T19:48:45.166844Z gitpod 10881</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,5 +0,0 @@
<div class="contentWrapper"><h1>A Test Title</h1><div class="content" id="content_out/articles/test articles/test1.article">
<p class="color6">
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>%CONDITIONAL_EXPAND%</div>

@ -1,192 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>A Test Title</h1><div class="expandedContent" id="content_out/articles/test articles/test1.article">
<p class="color6">
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>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=test1.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=test1.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,5 +0,0 @@
<div class="contentWrapper"><h1>Another test title</h1><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>%CONDITIONAL_EXPAND%</div>

@ -1,192 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>Another test title</h1><div class="expandedContent" 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>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=test2.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=test2.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,5 +0,0 @@
<div class="contentWrapper"><h1>And More</h1><div class="content" id="content_out/articles/test articles/test3.article">
<p class="color1">
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>%CONDITIONAL_EXPAND%</div>

@ -1,192 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
<div class="contentWrapper"><h1>And More</h1><div class="expandedContent" id="content_out/articles/test articles/test3.article">
<p class="color1">
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>
<hr/>
<script type="text/javascript">
function changeColor() {
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
}
function submit() {
if (document.getElementById("msg").value.replaceAll(" ","").length>1000) {
alert("Your message is longer than 1000 characters!");
return;
}
if (document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="GREEN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="RED"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="YELLOW"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="BLUE"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="MAGENTA"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="CYAN"&&
document.getElementById("col").options[document.getElementById("col").selectedIndex].text!=="WHITE") {
alert("You chose an invalid color!");
return;
}
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=true;
fetch("/COMMENTS?submit=true&article=test3.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
+encodeURIComponent(document.getElementById("name").value)+"&color="
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
, {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
document.getElementById("msg").value=""
document.getElementById("name").value=""
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
fetchComments()
})
.catch((err)=>{
document.getElementById("submit").disabled=
document.getElementById("name").disabled=
document.getElementById("col").disabled=
document.getElementById("msg").disabled=false;
})
}
function bonus(str) {
switch (str) {
case "^^":{
return "Bold Text"
}break;
case "**":{
return "Italic Text"
}break;
case "__":{
return "Underlined Text"
}break;
case "~~":{
return "//Code goes here."
}break;
case "[[":{
return "http://link.com"
}break;
}
}
function insert(c1,c2) {
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
//No highlighting. Insert here.
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
bonus(c1)+
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
} else {
if (c2!=undefined) {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart,document.getElementById("msg").selectionEnd)+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionEnd)
} else {
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
}
}
}
</script>
<div id="commentForm">
<b>Leave a comment!</b><br/><br/>
<label for="name">Display Name: </label><input id="name"></input><br/><br/>
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
<option value="RED">RED</option>
<option value="GREEN" selected>GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="BLUE">BLUE</option>
<option value="MAGENTA">MAGENTA</option>
<option value="CYAN">CYAN</option>
<option value="WHITE">WHITE</option>
</select><br/><br/>
<label for="msg" style="vertical-align:top;display:inline;">Message: </label>
<div>
<div class="toolbar">
<span class="toolbarItem" onclick="insert('^^','^^')" title="Bold">&nbsp;<b>B</b>&nbsp;</span>
<span class="toolbarItem" onclick="insert('**','**')" title="Italics">&nbsp;<i>I</i>&nbsp;</span>
<span class="toolbarItem" onclick="insert('__','__')" title="Underline">&nbsp;<u>U</u>&nbsp;</span>
<span class="toolbarItem" onclick="insert('~~','~~')" title="Code">&nbsp;&lt;code&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('[[',']]')" title="Link">&nbsp;&lt;http://&gt;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😊')" title="Smiley Face Emoji">&nbsp;😊&nbsp;</span>
<span class="toolbarItem" onclick="insert('😔')" title="Sad Face Emoji">&nbsp;😔&nbsp;</span>
<span class="toolbarItem" onclick="insert('👍')" title="Thumbs Up Emoji">&nbsp;👍&nbsp;</span>
<span class="toolbarItem" onclick="insert('❤')" title="Heart Emoji">&nbsp;&nbsp;</span>
<span class="toolbarItem" onclick="insert('😡')" title="Pouting Emoji">&nbsp;😡&nbsp;</span>
</div>
<textarea id="msg"></textarea>
</div><br/><br/>
<button id="submit" onclick="submit()">POST</button>
</div><br/><br/>
<div id="commentContainer" style="visibility:hidden;">
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
<div class="comments" id="comments"></div>
</div>
<script type="text/javascript">
function fetchComments() {
fetch("/COMMENTS?article=test3.comment", {cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
data=data.split("\n");
if (!isNaN(Number(data[0]))) {
document.getElementById("comments").innerHTML="";
document.getElementById("commentCounter").innerText=data[0]
for (var i=data.length-3;i>=1;i-=2) {
if (data[i].trim().length>0&&data[i+1].trim().length>0) {
document.getElementById("comments").innerHTML+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i]).replaceAll("\n","<br/>").replaceAll("\\\\NEWLINE\\\\","\n")+"</div><br>"
data2=data[i+1].split(";");
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
}
}
document.getElementById("commentContainer").style.visibility="visible"
}
})
}
fetchComments()
changeColor()
</script>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,40 +0,0 @@
try {
socket = new ServerSocket(sigPlace.PORT);
System.out.println("Listening on port "+sigPlace.PORT+".");
while (true) {
try (Socket client = socket.accept()) {
System.out.println("New client connection detected: "+client.toString());
InputStreamReader reader = new InputStreamReader(client.getInputStream(),"ISO-8859-1");
BufferedReader in = new BufferedReader(reader);
String requestLine,line;
ZonedDateTime modifiedDate = null;
String boundary=null;
boolean truncateUntilBoundary=false;
String filename=null;
OutputStream stream = null;
int expectedDataLength=0;
requestLine=in.readLine(); //Read the first line, this should be our request.
//System.out.println(requestLine);
if (requestLine!=null) {
String[] splitter = requestLine.split(Pattern.quote(" "));
boolean ISPOST = splitter[0].equals("POST");
boolean isApplication=false;
if (splitter.length==3) {
while (in.ready()) {
line=in.readLine();
//System.out.println(line);
if (ISPOST) {
if (isApplication) {
if (line.length()==0) { //Now expecting the body since the header is done.
for (int i=0;i<expectedDataLength;i++) {
System.out.print((char)in.read());
}
break;
}
} else //File transfer?
if (boundary!=null) {
if (!truncateUntilBoundary) {
System.out.println(line);
if (boundary.length()>0) {
if (line.equals(boundary)) {

@ -1,50 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
We're Sorry! Your webpage is in another castle!
===
<br/><br/>
<h2><a href="javascript:history.back()">Go Back</a></h2>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,29 +0,0 @@
<!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>
<h2>Directory Listing for /images/</h2><div class="folderlisting"><a href="/images/.." class="icon">&#x1F4C1;</a><a href="/images/..">.. </a><a href="/images/.." class="nounderline">(Previous Directory)</a></div><div class="filelisting"><a href="/images/Love_Live!_Logo.png" class="icon">&#x1F5CE;</a><a href="/images/Love_Live!_Logo.png">Love_Live!_Logo.png</a> 2022-08-01T14:45:39Z gitpod 12167</div>
<div class="filelisting"><a href="/images/github.webp" class="icon">&#x1F5CE;</a><a href="/images/github.webp">github.webp</a> 2022-08-01T14:58:45Z gitpod 7270</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

@ -1,567 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<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="color2">
This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.
</p>
<p class="color3">
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="color3">
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="color3">
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="color4">
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="color4">
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="color4">
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="color5">
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="color5">
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="color6">
<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>&lt;String,String> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"contentWrapper\">&lt;h1>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$TITLE_CONTENT_END"</span>, <span class="string">"&lt;/h1>&lt;div class=\"content\" %ID%>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$CONTENT_END"</span>, <span class="string">"&lt;/div>"</span>),
<span class="keyword">new</span> <span class="class">AbstractMap</span>.<span class="variable">SimpleEntry</span>&lt;><span class="function"></span>(<span class="string">"$DATE_CONTENT_START"</span>, <span class="string">"&lt;div class=\"datebar\">&lt;/div>&lt;div class=\"date\">"</span>)
));
<span class="keyword">final</span> <span class="keyword">static</span> <span class="variable">HashMap</span>&lt;String,Path> <span class="keyword">ops</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><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>&lt;><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>&lt;><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>&lt;<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&lt;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>&lt;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&lt;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&lt;<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">"&lt;pre>"</span><span class="variable"></span>)) {
<span class="comment">//System.out.println("Inside &lt;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">"&lt;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">"&lt;/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">"&lt;/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">"&lt;"</span>),<span class="string">"&lt;"</span>);
s+=<span class="string">"&lt;/pre>"</span>;
storedCodeBlock=<span class="string">"&lt;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">"&lt;/pre>"</span>)+<span class="string">"&lt;/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&lt;<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">"\"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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">"&lt;/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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;/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>&lt;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)&lt;=<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">//:&lt;url>,&lt;left|right|center>,&lt;width>,&lt;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&lt;<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">"&lt;div>&lt;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">"\">&lt;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%;\">&lt;figcaption>"</span>+<span class="class">captionText</span>.<span class="function">toString</span>()+<span class="string">"&lt;/figcaption>&lt;/figure>&lt;/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">"&lt;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">"&lt;/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">"&lt;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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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)&lt;=<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">"&lt;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>&lt;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&lt;String> <span class="keyword">content</span> <span class="variable"></span>= <span class="class">Files</span>.<span class="function">readAllLines</span>(f);
List&lt;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&lt;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>&lt;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&lt;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&lt;<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&lt;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&lt;<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">"&lt;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">"')\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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">//&lt;div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\">&lt;br/>&lt;br/>&lt;br/>&lt;br/>&#x2908; Click to expand.&lt;/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&lt;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&lt;String,List&lt;Path>> <span class="keyword">map</span> <span class="variable"></span>= <span class="keyword">new</span> <span class="variable">HashMap</span>&lt;><span class="function"></span>();
Iterator&lt;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>&lt;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>&lt;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&lt;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&lt;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">"&lt;h2>Directory Listing for "</span>+key+<span class="string">"&lt;/h2>"</span>);
<span class="class">sb</span>.<span class="function">append</span>(<span class="string">"&lt;div class=\"folderlisting\">&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"icon\">&#x1F4C1;&lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\">.. &lt;/a>&lt;a href=\""</span>)
.<span class="function">append</span>(key)
.<span class="function">append</span>(<span class="string">"..\" class=\"nounderline\">(Previous Directory)&lt;/a>&lt;/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">"&lt;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">"&lt;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">"&#x1F4C1;"</span>:<span class="string">"&#x1F5CE;"</span>))
.<span class="function">append</span>(<span class="string">"&lt;/a>"</span>)
.<span class="function">append</span>(<span class="string">"&lt;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">"&lt;/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">"&lt;/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&lt;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&lt;<span class="class">data</span>.<span class="function">size</span>());
<span class="keyword">if</span> <span class="function"></span>(<span class="variable">i</span>&lt;<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/>&#x2908; 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="color6">
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/>&#x2908; 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/>&#x2908; 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="color1">
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/>&#x2908; 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="color1">
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="color2">
<pre>
&lt;>&lt;Test><span class="string">"&lt;/test>&lt;/test2>&lt;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/>&#x2908; 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>

@ -1,47 +0,0 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

@ -1,479 +0,0 @@
a:link{
color:#D7F;
font-size:0.8em;
}
a:visited{
color:#D7F;
font-size:0.8em;
}
a:hover{
color:white;
font-size:0.8em;
}
a.nounderline:link{
text-decoration:none;
}
a.nounderline:visited{
text-decoration:none;
}
a.nounderline:hover{
text-decoration:none;
}
h2{
font-size:3em;
}
.generateTime{
font-size:10px;
color:blue;
}
.codeForeground{
font-family:'Courier New', Courier, monospace;
position:fixed;
left:-12px;
top:-8px;
z-index:-4999;
color:rgba(0,0,0,0);
background: linear-gradient(90deg, rgba(17,17,17,1) 0%, rgba(17,17,17,1) 42%, rgba(17,17,17,0.6825105042016807) 44%, rgba(17,17,17,1) 46%, rgba(17,17,17,1) 100%);
background-size:300% 100%;
user-select:none;
animation-name:backgroundMove;
animation-duration:15s;
animation-iteration-count: infinite;
font-size:32px;
overflow:hidden;
max-width:98vw;
max-height:90vh;
}
.codeBackground{
font-family:'Courier New', Courier, monospace;
position:fixed;
left:-12px;
top:-8px;
color:#44FF44;
z-index:-5000;
user-select:none;
font-size:32px;
overflow:hidden;
max-width:98vw;
max-height:90vh;
}
@keyframes backgroundMove{
0%{
background-position: 0% 50%;
}
100%{
background-position: 100% 50%;
}
}
body{
font-family: 'Trebuchet MS', Garamond, serif, 'Tahoma', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color:#111;
}
sub{
font-size:0.65em;
position:relative;
bottom:-4px;
}
sup{
font-size:0.65em;
position:relative;
top:-8px;
}
.contentBody{
backdrop-filter: blur(4px);
color: #a985e4;
font-weight:900;
text-shadow: 0.3px 0.3px 3px #666666;
z-index:-1;
padding-top:4px;
}
.contentBody .color1{
color: #a985e4;
}
.contentBody .color2{
color: #85abe4;
}
.contentBody .color3{
color: #85e4ad;
}
.contentBody .color4{
color: #d3e485;
}
.contentBody .color5{
color: #e4a385;
}
.contentBody .color6{
color: #e485b1;
}
.contentBody .contentWrapper{
position:relative;
border-style: none none outset none;
border-radius: 0px 0px 12px 0px;
border-color: rgb(17, 153, 17, .3);
border-width: 3px;
margin: 0px 4px 8px 4px;
min-width:98vw;
z-index:0;
}
.contentBody .contentWrapper:hover{
border-color: rgb(17, 153, 17, .8);
}
.contentBody .contentWrapper h1{
display: inline-block;
font-size:2.1em;
margin: 12px 4px 0px 4px;
padding: 12px 32px 12px 32px;
border-bottom-style: outset;
border-radius:32px 32px 0px 0px;
color: #AA77FF;
background-color:rgba(255, 255, 255, .06);
z-index:0;
}
.contentBody .contentWrapper .content{
display: inline-block;
min-width:97vw;
font-size:1.15em;
line-height:1.4;
padding: 4px;
margin: 0px 4px 0px 4px;
background-color: rgba(255, 255, 255, .06);
z-index:0;
max-height:120px;
overflow:hidden;
}
.contentBody .contentWrapper .expandedContent{
display: inline-block;
min-width:97vw;
font-size:1.15em;
line-height:1.4;
padding: 4px;
margin: 0px 4px 0px 4px;
background-color: rgba(255, 255, 255, .06);
z-index:0;
}
.contentBody .contentWrapper figure{
border: 2px ridge rgb(88, 35, 86);
border-radius:4px;
margin:12px 20px 12px 20px;
}
.contentBody .contentWrapper figcaption{
font-size: 0.85em;
font-style: italic;
color:rgb(221, 105, 217);
}
.contentBody .contentWrapper .datebar{
font-size:0.75em;
margin: 0px 4px 0px 4px;
min-width:98vw;
min-height:1px;
z-index:0;
background: linear-gradient(90deg,rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, .3) 20%,rgba(255, 255, 255, .06) 45%,rgba(255, 255, 255, .06) 0%);
}
.contentBody .contentWrapper .date{
font-size:0.75em;
margin: 0px 4px 0px 4px;
padding: 2px 0px 0px 2px;
min-width:98vw;
z-index:0;
background-color: rgba(255, 255, 255, .06);
}
.contentBody .contentWrapper .unexpanded{
position:absolute;
bottom:0px;
min-width:98vw;
text-align:center;
font-size:1.75em;
background: linear-gradient(180deg,rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 5%, rgba(32,32,32,1.0) 100%);
user-select:none;
}
.contentBody .contentWrapper .unexpanded:hover{
bottom:-8px;
background: linear-gradient(180deg,rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 5%, rgba(64,64,64,1.0) 100%);
cursor:pointer;
}
.contentBody .filelisting{
padding:12px 4px 2px 4px;
font-size:1.75em;
}
.contentBody .folderlisting{
padding:12px 4px 2px 4px;
font-size:1.75em;
}
.contentBody .icon:link{
text-decoration:none;
}
.contentBody .icon:visited{
text-decoration:none;
}
.contentBody .icon:hover{
text-decoration:none;
}
pre{
font-family:'Courier New', Courier, monospace;
display:inline-block;
padding:3px;
margin-left:20px;
font-size:0.85em;
position:relative;
width:85vw;
max-height:480px;
overflow:scroll;
inline-size: 85vw;
color:darkseagreen;
background:radial-gradient(farthest-side at 90% 90%,rgba(0, 255, 0, .06) 0%, rgba(255, 255, 255, .06) 100%);
}
/* width */
::-webkit-scrollbar {
width:8px;
height:8px;
float:right;
}
::-webkit-scrollbar:hover{
width: 16px;
height: 16px;
}
/* Track */
::-webkit-scrollbar-track {
background:rgba(0,0,0,0);
}
/* Handle */
::-webkit-scrollbar-thumb {
background: rgb(161, 46, 161);
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: rgb(197, 34, 189);
}
::-webkit-scrollbar-corner{
background:rgba(0,0,0,0);
}
/* width */
pre::-webkit-scrollbar {
width:16px;
height:16px;
}
pre .keyword{
color:cornflowerblue;
}
pre .variable{
color:#AA77FF;
}
pre .class{
color:rgb(216, 107, 74);
}
pre .function{
color:darkgoldenrod;
}
pre .string{
color:forestgreen;
}
pre .number{
color:#d8f070;
}
pre .comment{
color:#6b235e;
}
textarea{
font-family:'Courier New', Courier, monospace;
display:inline-block;
padding:3px;
margin-left:20px;
font-size:0.85em;
position:relative;
inline-size: 85vw;
color:darkseagreen;
background:radial-gradient(farthest-side at 90% 90%,rgba(0, 255, 0, .06) 0%, rgba(255, 255, 255, .06) 100%);
border-radius:8px;
font-size:1.4em;
}
textarea:focus{
outline: none !important;
}
h1 {
font-size:3.25em;
}
.commentForm{
padding:16px;
line-height:2.2;
vertical-align: text-top;
}
.commentInfo{
padding-left:24px;
}
.commentDisplayer{
font-family:'Courier New', Courier, monospace;
border: 1px solid rgb(36, 163, 36);
border-radius:8px;
margin:16px;
padding:8px;
line-height:1.4;
}
input{
font-family:'Courier New', Courier, monospace;
width:240px;
background-color:rgba(0,0,0,0);
border: 1px solid rgb(4, 80, 4);
color:lime;
font-size:1.4em;
}
input:focus{
outline: none !important;
background-color:rgb(24, 24, 24);
border: 1px solid rgb(10, 136, 10);
}
option{
font-family:'Courier New', Courier, monospace;
width:240px;
background-color:rgba(0,0,0,0);
border: 1px solid rgb(4, 80, 4);
color:lime;
font-size:1.4em;
}
option:focus{
outline: none !important;
background-color:rgb(24, 24, 24);
border: 1px solid rgb(10, 136, 10);
}
select{
font-family:'Courier New', Courier, monospace;
width:240px;
background-color:rgba(0,0,0,0);
border: 1px solid rgb(4, 80, 4);
color:lime;
font-size:1.4em;
}
select:focus{
outline: none !important;
background-color:rgb(24, 24, 24);
border: 1px solid rgb(10, 136, 10);
}
button{
background-color:rgba(0,0,0,0);
border: 1px solid rgb(4, 80, 4);
font-size:2em;
margin-left:24px;
margin-top:8px;
color:lime;
}
button:hover{
background-color:rgb(0, 53, 3);
border: 1px solid rgb(10, 136, 10);
}
button:disabled{
background-color:rgb(0, 81, 95);
}
select:disabled{
background-color:rgb(0, 81, 95);
}
input:disabled{
background-color:rgb(0, 81, 95);
}
textarea:disabled{
background-color:rgb(0, 81, 95);
}
.toolbar{
background-color:#666666;
color:#000000;
font-size:0.75em;
width:fit-content;
margin-left:36px;
margin-top:24px;
}
.toolbarItem:hover{
background-color:#a1a1a1;
cursor:pointer;
}
.contentWrapper .reallink{
font-size:1.7em;
text-decoration: none;
color:white;
}
.navbar{
font-size:1.0em;
color:lime;
padding-top:8px;
padding-bottom:8px;
border-bottom: 1px solid darkgreen;
position: -webkit-sticky; /* Safari */
position: sticky;
top:0px;
z-index:2;
width:100%;
background:radial-gradient(farthest-side at 90% 90%,rgba(0, 64, 0, .5) 0%, rgba(64, 0, 64, .5) 100%);
}
.navbar:hover{
background:radial-gradient(farthest-side at 90% 90%,rgba(0, 64, 0, .95) 0%, rgba(64, 0, 64, .95) 100%);
}
.navbaritem{
padding-left:16px;
padding-right:16px;
display:inline-flex;
text-decoration:underline;
color:rgb(255, 200, 253);
}
.navbaritem a:link{
color:rgb(255, 200, 253);
}
.navbaritem a:hover{
color:white;
}
.navbaritem a:visited{
color:rgb(255, 200, 253);
}
#liveindicator a:link{
color:red;
text-decoration: none;
}
#liveindicator a:hover{
color:red;
}
#liveindicator a:visited{
color:rgb(255, 200, 253);
}
.navbaritem:first-of-type{
padding-left:32px;
}
.navbaritem:hover{
color:white;
cursor:pointer;
}
@keyframes blink{
0%{color:rgba(255,0,0,0);}
100%{color:rgba(255,0,0,0.8);}
}
#liveindicator{
display:inline-flex;
}
#liveindicator a{
animation-name: blink;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-direction:alternate;
text-decoration: none;
padding-left:8px;
font-weight:900;
}
.socials{
display:inline;
float:right;
}
.socials img{
width:16px;
padding-right:16px;
filter: invert(100%);
}
.socials img:hover{
cursor:pointer;
}
.socials img:first-of-type{
padding-right:32px;
}
.socials a:link{
color:rgb(255, 200, 253);
}
.socials a:hover{
color:white;
}
.socials a:visited{
color:rgb(255, 200, 253);
}

@ -1,51 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
SigPlace
-SigPlace
===
<br/><br/>
<a href="otherpage.html">Other Page!</a>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -1,51 +0,0 @@
<!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="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"><a href="/code.html">DISCORD</a></div>
<div class="navbaritem"><a href="/code.html">GITHUB</a></div>
<div class="navbaritem"><a href="/code.html">TWITCH</a></div>
<div class="navbaritem"><a href="/code.html">YOUTUBE</a></div>
<div class="navbaritem"><a href="/code.html">TWITTER</a></div>
</div>
</div>
<script type="text/javascript">
function getLiveStatus() {
document.getElementById("liveindicator").innerHTML="<a href=\"/stream.html\">🔴 LIVE</a>"
}
getLiveStatus()
</script>
<div class="contentBody">
SigPlace
<form method="post" action="./SUBMITFILE" enctype="multipart/form-data">
<input type="file" name="file1"/>
<input type="submit"/>
</form>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>
<div class="codeBackground" id="codeBackground"></div>
</body>
<footer>
</footer>
</html>

@ -48,8 +48,8 @@ public class sigPlace {
"%FOOTER", Paths.get(REFDIR,"FOOTER.html"))
));
public static void main(String[] args) {
Path secretFile = Paths.get(".clientsecret");
new ArcadeReader();
/* Path secretFile = Paths.get(".clientsecret");
List<String> data;
try {
data = Files.readAllLines(secretFile);
@ -355,7 +355,7 @@ public class sigPlace {
e.printStackTrace();
}
}
}
} */
}
private static boolean validNumericalConstantCharacters(int lengthOfConstant, int j) {
return storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='.'||lengthOfConstant>0&&storedCodeBlock.charAt(j)>='A'&&lengthOfConstant>0&&storedCodeBlock.charAt(j)<='F'||lengthOfConstant>0&&storedCodeBlock.charAt(j)>='a'&&lengthOfConstant>0&&storedCodeBlock.charAt(j)<='f'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='x'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='X';

Loading…
Cancel
Save