Some semblance of \<pre\> command parsing

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent e46476c05d
commit 575b8c2756
  1. 30
      out/DIRECTORY_LISTING
  2. 25
      out/articles/DIRECTORY_LISTING
  3. 15
      out/articles/curabitur vel tempus ex.article.html
  4. 15
      out/articles/sigplace1.article.html
  5. 27
      out/articles/test articles/DIRECTORY_LISTING
  6. 15
      out/articles/test articles/test1.article.html
  7. 15
      out/articles/test articles/test2.article.html
  8. 15
      out/articles/test articles/test3.article.html
  9. 2
      out/codeBackground
  10. 25
      out/otherpage.html
  11. 25
      out/testfile.html
  12. 15
      out/uploadform.html
  13. BIN
      out/uploads/Love_Live!_Logo.png
  14. 15
      ref/DEFAULT.html
  15. 9
      sampleCode
  16. 58
      sigPlace.java
  17. 10
      sitefiles/testfile.html

@ -16,28 +16,14 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<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-05-19T19:07:02.131093Z gitpod 190</div>
<div class="filelisting"><a href="/codeBackground" class="icon">&#x1F5CE;</a><a href="/codeBackground">codeBackground</a> 2022-05-19T19:07:02.067093Z gitpod 2635</div>
<div class="filelisting"><a href="/otherpage.html" class="icon">&#x1F5CE;</a><a href="/otherpage.html">otherpage.html</a> 2022-05-19T19:07:02.103093Z gitpod 9684</div>
<div class="filelisting"><a href="/reset.css" class="icon">&#x1F5CE;</a><a href="/reset.css">reset.css</a> 2022-05-19T19:07:02.075093Z gitpod 1093</div>
<div class="filelisting"><a href="/sig.css" class="icon">&#x1F5CE;</a><a href="/sig.css">sig.css</a> 2022-05-19T19:07:02.083093Z gitpod 5175</div>
<div class="filelisting"><a href="/testfile.html" class="icon">&#x1F5CE;</a><a href="/testfile.html">testfile.html</a> 2022-05-19T19:07:02.107093Z gitpod 1621</div>
<div class="filelisting"><a href="/uploadform.html" class="icon">&#x1F5CE;</a><a href="/uploadform.html">uploadform.html</a> 2022-05-19T19:07:02.107093Z gitpod 1676</div>
<div class="folderlisting"><a href="/uploads" class="icon">&#x1F4C1;</a><a href="/uploads">uploads</a> 2022-05-19T14:49:27Z gitpod 6</div>
<div class="contentBody">
<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-06-03T19:15:23.539299Z gitpod 190</div>
<div class="filelisting"><a href="/codeBackground" class="icon">&#x1F5CE;</a><a href="/codeBackground">codeBackground</a> 2022-06-03T19:15:23.439299Z gitpod 2635</div>
<div class="filelisting"><a href="/otherpage.html" class="icon">&#x1F5CE;</a><a href="/otherpage.html">otherpage.html</a> 2022-06-03T19:15:23.523299Z gitpod 8892</div>
<div class="filelisting"><a href="/reset.css" class="icon">&#x1F5CE;</a><a href="/reset.css">reset.css</a> 2022-06-03T19:15:23.447299Z gitpod 1093</div>
<div class="filelisting"><a href="/sig.css" class="icon">&#x1F5CE;</a><a href="/sig.css">sig.css</a> 2022-06-03T19:15:23.455299Z gitpod 5175</div>
<div class="filelisting"><a href="/testfile.html" class="icon">&#x1F5CE;</a><a href="/testfile.html">testfile.html</a> 2022-06-03T19:15:23.527299Z gitpod 2004</div>
<div class="filelisting"><a href="/uploadform.html" class="icon">&#x1F5CE;</a><a href="/uploadform.html">uploadform.html</a> 2022-06-03T19:15:23.527299Z gitpod 884</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>

@ -16,25 +16,12 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<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/curabitur vel tempus ex.article" class="icon">&#x1F5CE;</a><a href="/articles/curabitur vel tempus ex.article">curabitur vel tempus ex.article</a> 2022-05-19T19:07:02.055093Z gitpod 579</div>
<div class="filelisting"><a href="/articles/sigplace1.article" class="icon">&#x1F5CE;</a><a href="/articles/sigplace1.article">sigplace1.article</a> 2022-05-19T19:07:02.059093Z gitpod 3807</div>
<div class="folderlisting"><a href="/articles/test articles" class="icon">&#x1F4C1;</a><a href="/articles/test articles">test articles</a> 2022-05-19T19:07:02.123093Z gitpod 147</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-05-19T19:07:02.111093Z gitpod 2088</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-05-19T19:07:02.115093Z gitpod 5316</div>
<div class="contentBody">
<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/curabitur vel tempus ex.article" class="icon">&#x1F5CE;</a><a href="/articles/curabitur vel tempus ex.article">curabitur vel tempus ex.article</a> 2022-06-03T19:15:23.419299Z gitpod 579</div>
<div class="filelisting"><a href="/articles/sigplace1.article" class="icon">&#x1F5CE;</a><a href="/articles/sigplace1.article">sigplace1.article</a> 2022-06-03T19:15:23.427299Z gitpod 3807</div>
<div class="folderlisting"><a href="/articles/test articles" class="icon">&#x1F4C1;</a><a href="/articles/test articles">test articles</a> 2022-06-03T19:15:23.531299Z gitpod 147</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-06-03T19:15:23.527299Z gitpod 1296</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-06-03T19:15:23.531299Z gitpod 4524</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<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>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>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div></div>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
<div class="contentWrapper"><h1>Welcome to SigPlace!</h1><div class="expandedContent" id="content_out/articles/sigplace1.article">
<p> This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.</p>
<p> 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>

@ -16,26 +16,13 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<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-05-19T19:07:02.059093Z gitpod 1068</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-05-19T19:07:02.059093Z gitpod 764</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-05-19T19:07:02.063093Z gitpod 977</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-05-19T19:07:02.115093Z gitpod 2577</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-05-19T19:07:02.119093Z gitpod 2273</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-05-19T19:07:02.123093Z gitpod 2486</div>
<div class="contentBody">
<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-06-03T19:15:23.427299Z gitpod 1068</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-06-03T19:15:23.431299Z gitpod 764</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-06-03T19:15:23.431299Z gitpod 977</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-06-03T19:15:23.531299Z gitpod 1785</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-06-03T19:15:23.531299Z gitpod 1481</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-06-03T19:15:23.531299Z gitpod 1694</div>
</div> <!--End Content Body-->
<div class="codeForeground" id="codeForeground"></div>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
<div class="contentWrapper"><h1>A Test Title</h1><div class="expandedContent" id="content_out/articles/test articles/test1.article">
<p> 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>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
<div class="contentWrapper"><h1>Another test title</h1><div class="expandedContent" id="content_out/articles/test articles/test2.article">
<p> 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>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
<div class="contentWrapper"><h1>And More</h1><div class="expandedContent" id="content_out/articles/test articles/test3.article">
<p> 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>

@ -11,7 +11,6 @@
boolean truncateUntilBoundary=false;
String filename=null;
OutputStream stream = null;
boolean firstLine=true;
requestLine=in.readLine(); //Read the first line, this should be our request.
if (requestLine!=null) {
String[] splitter = requestLine.split(Pattern.quote(" "));
@ -38,3 +37,4 @@
System.out.println(line);
}
} else {
File myFile = new File(new File(sigPlace.OUTDIR,sigPlace.UPLOADSDIR),filename);

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
This is a different webpage.<hr>
<script type="text/javascript">
function expand(modify,element) {
@ -52,19 +39,19 @@ This is a different webpage.<hr>
<p>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>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>
</div><div class="datebar"></div><div class="date">3 May 2022 10:25AM</div><div class="unexpanded" id="expand_33" onClick="expand(this,'out/articles/sigplace1.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
</div><div class="datebar"></div><div class="date">3 May 2022 10:25AM</div><div class="unexpanded" id="expand_20" onClick="expand(this,'out/articles/sigplace1.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
<div class="contentWrapper"><h1>A Test Title</h1><div class="content" id="content_out/articles/test articles/test1.article">
<p> 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_55" onClick="expand(this,'out/articles/test articles/test1.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
</div><div class="datebar"></div><div class="date">2 May 2022 10:16AM</div><div class="unexpanded" id="expand_42" onClick="expand(this,'out/articles/test articles/test1.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
<div class="contentWrapper"><h1>Another test title</h1><div class="content" id="content_out/articles/test articles/test2.article">
<p> 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_58" onClick="expand(this,'out/articles/test articles/test2.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
</div><div class="datebar"></div><div class="date">1 May 2022 05:13AM</div><div class="unexpanded" id="expand_45" onClick="expand(this,'out/articles/test articles/test2.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
<div class="contentWrapper"><h1>And More</h1><div class="content" id="content_out/articles/test articles/test3.article">
<p> 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_61" onClick="expand(this,'out/articles/test articles/test3.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
</div><div class="datebar"></div><div class="date">30 Apr 2022 6:14PM</div><div class="unexpanded" id="expand_48" onClick="expand(this,'out/articles/test articles/test3.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
<div class="contentWrapper"><h1>Curabitur vel tempus ex</h1><div class="content" id="content_out/articles/curabitur vel tempus ex.article">
<p>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>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div><div class="unexpanded" id="expand_64" onClick="expand(this,'out/articles/curabitur vel tempus ex.article')"><br/><br/><br/><br/>&#x2908; Click to expand.</div></div>
</div><div class="datebar"></div><div class="date">29 Apr 2022 7:37PM</div><div class="unexpanded" id="expand_51" 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>

@ -16,23 +16,18 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
SigPlace
-SigPlace
Basic Content goes here.
<span class="keyword"><pre></span> <span class="variable"> System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="keyword">"Building</span> <span class="keyword">directory</span> <span class="variable">listings</span>.<span class="variable"></span>.<span class="variable"></span>.<span class="keyword">");</span> <span class="keyword"> try</span> <span class="keyword">{</span> <span class="function"> buildDirectoryListings</span>(<span class="keyword">);</span> <span class="keyword"> }</span> <span class="keyword">catch</span> <span class="function"></span>(<span class="keyword">IOException</span> <span class="keyword">e)</span> <span class="keyword">{</span> <span class="variable"> e</span>.<span class="function">printStackTrace</span>(<span class="keyword">);</span> <span class="variable"> System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="keyword">Failed</span> <span class="keyword">to</span> <span class="keyword">build</span> <span class="keyword">directory</span> <span class="keyword">listings!");</span> <span class="keyword"> return;</span>
===
<br/><br/>
<a href="otherpage.html">Other Page!</a>

@ -16,20 +16,7 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">
SigPlace
<form method="post" action="./SUBMITFILE" enctype="multipart/form-data">
<input type="file" name="file1"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

@ -16,17 +16,4 @@
</script>
</head>
<body>
<div class="contentBody">
<pre>Test<span style="color:red;">Testing</span>
Test a whole
bunch of random Java code.
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>
<div class="contentBody">

@ -0,0 +1,9 @@
<pre>
<span class="variable">System</span>.<span class="variable">out</span>.<span class="function">println</span>(<span class="string">"Building directory listings..."</span>);
<span class="keyword">try</span> {
<span class="function">buildDirectoryListings()</span>;
} <span class="keyword">catch</span> (<span class="class">IOException</span> <span class="variable">e</span>) {
<span class="variable">e.</span><span class="function">printStackTrace()</span>;
<span class="variable">System</span>.<span class="variable">err</span>.<span class="function">println</span>(<span class="string">Failed to build directory listings!"</span>);
<span class="keyword">return</span>;
}</pre>

@ -24,6 +24,9 @@ public class sigPlace {
final static String DIRECTORYLISTING_FILENAME = "DIRECTORY_LISTING";
static int PORT = 8080;
static boolean inCodeBlock = false;
static String storedCodeBlock = "";
final static HashMap<String,String> map = new HashMap<>(Map.ofEntries(
new AbstractMap.SimpleEntry<>("$SITENAME", "SigPlace"),
new AbstractMap.SimpleEntry<>("$SITE_BACKCOL", "#111"),
@ -127,6 +130,55 @@ public class sigPlace {
for (String key : map.keySet()) {
s=s.replaceAll(Pattern.quote(key),map.get(key));
}
if (s.length()>0&&isHTMLFile(f)) {
if (!inCodeBlock) {
if (s.contains("<pre>")) {
inCodeBlock=true;
storedCodeBlock+=s.substring(s.indexOf("<pre>"));
s=s.substring(0,s.indexOf("<pre>"));
}
} else {
if (s.contains("</pre>")) {
inCodeBlock=false;
storedCodeBlock+=s.substring(0,s.indexOf("</pre>")+"</pre>".length());
int startPos=0;
String endText=s.substring(s.indexOf("</pre>")+"</pre>".length(),s.length());
s="";
for (int j=0;j<storedCodeBlock.length();j++) {
if (storedCodeBlock.charAt(j)=='.') {
//Previous section was a member.
s+=SPAN("variable")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
startPos=j+1;
continue;
} else
if (storedCodeBlock.charAt(j)=='\n') {
System.out.println("newline");
//Previous section is done.
s+="\r\n";
startPos=j+1;
continue;
} else
if (storedCodeBlock.charAt(j)=='(') {
//Previous section was a keyword.
s+=SPAN("function")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
startPos=j+1;
continue;
} else
if (storedCodeBlock.charAt(j)==' '&&j>0&&storedCodeBlock.charAt(j-1)!=' ') {
//Previous section was a keyword.
s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
startPos=j+1;
continue;
}
}
s+=endText;
//System.out.println("Stored code block: "+storedCodeBlock);
} else {
storedCodeBlock+=s;
s="";
}
}
}
content.set(i,s);
}
@ -142,6 +194,12 @@ public class sigPlace {
}
}
}
/**
* Writes a span tag with the included class.
* **/
private static String SPAN(String className) {
return "<span class=\""+className+"\">";
}
private static void GenerateArticleFiles(Iterator<Path> items){
System.out.println(" Generating article files...");
while (items.hasNext()) {

@ -1,6 +1,14 @@
$SITENAME
-SigPlace
Basic Content goes here.
<pre>
System.out.println("Building directory listings...");
try {
buildDirectoryListings();
} catch (IOException e) {
e.printStackTrace();
System.err.println(Failed to build directory listings!");
return;
}</pre>
===
<br/><br/>
<a href="otherpage.html">Other Page!</a>
Loading…
Cancel
Save