diff --git a/out/DIRECTORY_LISTING b/out/DIRECTORY_LISTING index 24a95e1..504cca0 100644 --- a/out/DIRECTORY_LISTING +++ b/out/DIRECTORY_LISTING @@ -16,28 +16,14 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
-

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-05-19T19:07:02.131093Z gitpod 190
-
🗎codeBackground 2022-05-19T19:07:02.067093Z gitpod 2635
-
🗎otherpage.html 2022-05-19T19:07:02.103093Z gitpod 9684
-
🗎reset.css 2022-05-19T19:07:02.075093Z gitpod 1093
-
🗎sig.css 2022-05-19T19:07:02.083093Z gitpod 5175
-
🗎testfile.html 2022-05-19T19:07:02.107093Z gitpod 1621
-
🗎uploadform.html 2022-05-19T19:07:02.107093Z gitpod 1676
-
📁uploads 2022-05-19T14:49:27Z gitpod 6
+
+

Directory Listing for /

📁articles 2022-06-03T19:15:23.539299Z gitpod 190
+
🗎codeBackground 2022-06-03T19:15:23.439299Z gitpod 2635
+
🗎otherpage.html 2022-06-03T19:15:23.523299Z gitpod 8892
+
🗎reset.css 2022-06-03T19:15:23.447299Z gitpod 1093
+
🗎sig.css 2022-06-03T19:15:23.455299Z gitpod 5175
+
🗎testfile.html 2022-06-03T19:15:23.527299Z gitpod 2004
+
🗎uploadform.html 2022-06-03T19:15:23.527299Z gitpod 884
diff --git a/out/articles/DIRECTORY_LISTING b/out/articles/DIRECTORY_LISTING index 0c67efc..99032c9 100644 --- a/out/articles/DIRECTORY_LISTING +++ b/out/articles/DIRECTORY_LISTING @@ -16,25 +16,12 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
-

Directory Listing for /articles/

🗎curabitur vel tempus ex.article 2022-05-19T19:07:02.055093Z gitpod 579
-
🗎sigplace1.article 2022-05-19T19:07:02.059093Z gitpod 3807
-
📁test articles 2022-05-19T19:07:02.123093Z gitpod 147
-
🗎curabitur vel tempus ex.article.html 2022-05-19T19:07:02.111093Z gitpod 2088
-
🗎sigplace1.article.html 2022-05-19T19:07:02.115093Z gitpod 5316
+
+

Directory Listing for /articles/

🗎curabitur vel tempus ex.article 2022-06-03T19:15:23.419299Z gitpod 579
+
🗎sigplace1.article 2022-06-03T19:15:23.427299Z gitpod 3807
+
📁test articles 2022-06-03T19:15:23.531299Z gitpod 147
+
🗎curabitur vel tempus ex.article.html 2022-06-03T19:15:23.527299Z gitpod 1296
+
🗎sigplace1.article.html 2022-06-03T19:15:23.531299Z gitpod 4524
diff --git a/out/articles/curabitur vel tempus ex.article.html b/out/articles/curabitur vel tempus ex.article.html index 1c43685..9259532 100644 --- a/out/articles/curabitur vel tempus ex.article.html +++ b/out/articles/curabitur vel tempus ex.article.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+

Curabitur vel tempus ex

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.

29 Apr 2022 7:37PM
diff --git a/out/articles/sigplace1.article.html b/out/articles/sigplace1.article.html index 7cfea45..2f3a4ab 100644 --- a/out/articles/sigplace1.article.html +++ b/out/articles/sigplace1.article.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+

Welcome to SigPlace!

This is a SigPlace article! It will contain information that is important (probably) and will be layed out as such.

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.

diff --git a/out/articles/test articles/DIRECTORY_LISTING b/out/articles/test articles/DIRECTORY_LISTING index 95ee328..85cf22e 100644 --- a/out/articles/test articles/DIRECTORY_LISTING +++ b/out/articles/test articles/DIRECTORY_LISTING @@ -16,26 +16,13 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
-

Directory Listing for /articles/test articles/

🗎test1.article 2022-05-19T19:07:02.059093Z gitpod 1068
-
🗎test2.article 2022-05-19T19:07:02.059093Z gitpod 764
-
🗎test3.article 2022-05-19T19:07:02.063093Z gitpod 977
-
🗎test1.article.html 2022-05-19T19:07:02.115093Z gitpod 2577
-
🗎test2.article.html 2022-05-19T19:07:02.119093Z gitpod 2273
-
🗎test3.article.html 2022-05-19T19:07:02.123093Z gitpod 2486
+
+

Directory Listing for /articles/test articles/

🗎test1.article 2022-06-03T19:15:23.427299Z gitpod 1068
+
🗎test2.article 2022-06-03T19:15:23.431299Z gitpod 764
+
🗎test3.article 2022-06-03T19:15:23.431299Z gitpod 977
+
🗎test1.article.html 2022-06-03T19:15:23.531299Z gitpod 1785
+
🗎test2.article.html 2022-06-03T19:15:23.531299Z gitpod 1481
+
🗎test3.article.html 2022-06-03T19:15:23.531299Z gitpod 1694
diff --git a/out/articles/test articles/test1.article.html b/out/articles/test articles/test1.article.html index 534d2ee..50cab29 100644 --- a/out/articles/test articles/test1.article.html +++ b/out/articles/test articles/test1.article.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+

A Test Title

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.

2 May 2022 10:16AM
diff --git a/out/articles/test articles/test2.article.html b/out/articles/test articles/test2.article.html index fffcf5f..5822213 100644 --- a/out/articles/test articles/test2.article.html +++ b/out/articles/test articles/test2.article.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+

Another test title

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.

1 May 2022 05:13AM
diff --git a/out/articles/test articles/test3.article.html b/out/articles/test articles/test3.article.html index 438ad8c..39474c8 100644 --- a/out/articles/test articles/test3.article.html +++ b/out/articles/test articles/test3.article.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+

And More

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.

30 Apr 2022 6:14PM
diff --git a/out/codeBackground b/out/codeBackground index 8b8a175..9e16ede 100644 --- a/out/codeBackground +++ b/out/codeBackground @@ -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); diff --git a/out/otherpage.html b/out/otherpage.html index 1aaf8e2..d625b7e 100644 --- a/out/otherpage.html +++ b/out/otherpage.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+
This is a different webpage.
-
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+
SigPlace -SigPlace -Basic Content goes here. + + + + + + + + +
    System.out.println("Building directory listings...");    try {        buildDirectoryListings();    } catch (IOException e) {        e.printStackTrace();            System.err.println(Failed to build directory listings!");            return; 
 ===
 

Other Page! diff --git a/out/uploadform.html b/out/uploadform.html index ce8cf69..7518d47 100644 --- a/out/uploadform.html +++ b/out/uploadform.html @@ -16,20 +16,7 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
+
SigPlace
diff --git a/out/uploads/Love_Live!_Logo.png b/out/uploads/Love_Live!_Logo.png deleted file mode 100644 index 2f52540..0000000 Binary files a/out/uploads/Love_Live!_Logo.png and /dev/null differ diff --git a/ref/DEFAULT.html b/ref/DEFAULT.html index fe7bf5d..aeba680 100644 --- a/ref/DEFAULT.html +++ b/ref/DEFAULT.html @@ -16,17 +16,4 @@ -
- -
TestTesting
-Test a whole
-bunch of random Java code.
-
-System.out.println("Building directory listings...");
-try {
-    buildDirectoryListings();
-} catch (IOException e) {
-    e.printStackTrace();
-        System.err.println(Failed to build directory listings!");
-        return;
-}
\ No newline at end of file +
\ No newline at end of file diff --git a/sampleCode b/sampleCode new file mode 100644 index 0000000..577776f --- /dev/null +++ b/sampleCode @@ -0,0 +1,9 @@ +
+System.out.println("Building directory listings...");
+try {
+    buildDirectoryListings();
+} catch (IOException e) {
+    e.printStackTrace();
+        System.err.println(Failed to build directory listings!");
+        return;
+}
\ No newline at end of file diff --git a/sigPlace.java b/sigPlace.java index 7b2efc2..36941bd 100644 --- a/sigPlace.java +++ b/sigPlace.java @@ -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 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("
")) {
+                                    inCodeBlock=true;
+                                    storedCodeBlock+=s.substring(s.indexOf("
"));
+                                    s=s.substring(0,s.indexOf("
"));
+                                }
+                            } else {
+                                if (s.contains("
")) { + inCodeBlock=false; + storedCodeBlock+=s.substring(0,s.indexOf("
")+"
".length()); + int startPos=0; + String endText=s.substring(s.indexOf("
")+"".length(),s.length()); + s=""; + for (int j=0;j"+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)+"
"+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)+""+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 ""; + } private static void GenerateArticleFiles(Iterator items){ System.out.println(" Generating article files..."); while (items.hasNext()) { diff --git a/sitefiles/testfile.html b/sitefiles/testfile.html index 2a244c3..64dea0d 100644 --- a/sitefiles/testfile.html +++ b/sitefiles/testfile.html @@ -1,6 +1,14 @@ $SITENAME -SigPlace -Basic Content goes here. +
+    System.out.println("Building directory listings...");
+    try {
+        buildDirectoryListings();
+    } catch (IOException e) {
+        e.printStackTrace();
+            System.err.println(Failed to build directory listings!");
+            return;
+    }
===

Other Page! \ No newline at end of file