diff --git a/ArcadeReader.java b/ArcadeReader.java index a7a5a7f..5627071 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.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"); + } } diff --git a/out/DIRECTORY_LISTING b/out/DIRECTORY_LISTING deleted file mode 100644 index 43f878e..0000000 --- a/out/DIRECTORY_LISTING +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - -

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-08-03T19:48:45.182844Z gitpod 4096
-
🗎codeBackground 2022-08-03T19:48:45.110844Z gitpod 2635
-
🗎error.html 2022-08-03T19:48:45.126844Z gitpod 1828
-
📁images 2022-08-03T19:48:45.174844Z gitpod 77
-
🗎otherpage.html 2022-08-03T19:48:45.134844Z gitpod 88526
-
🗎reset.css 2022-08-03T19:48:45.114844Z gitpod 1092
-
🗎sig.css 2022-08-03T19:48:45.122844Z gitpod 11140
-
🗎testfile.html 2022-08-03T19:48:45.138844Z gitpod 1783
-
🗎uploadform.html 2022-08-03T19:48:45.138844Z gitpod 1863
- - -
-
- - - diff --git a/out/articles/DIRECTORY_LISTING b/out/articles/DIRECTORY_LISTING deleted file mode 100644 index 9cb657c..0000000 --- a/out/articles/DIRECTORY_LISTING +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - -

Directory Listing for /articles/

📁.. (Previous Directory)
🗎Love Live! Custom Arcade Controller.article 2022-08-03T19:48:44.638844Z gitpod 497
-
🗎curabitur vel tempus ex.article 2022-08-03T19:48:44.666844Z gitpod 730
-
🗎sigplace1.article 2022-08-03T19:48:45.102844Z gitpod 80858
-
📁test articles 2022-08-03T19:48:45.166844Z gitpod 147
-
🗎Love Live! Custom Arcade Controller.article.html 2022-08-03T19:48:45.142844Z gitpod 10444
-
🗎curabitur vel tempus ex.article.html 2022-08-03T19:48:45.154844Z gitpod 10653
-
🗎sigplace1.article.html 2022-08-03T19:48:45.162844Z gitpod 90753
- - -
-
- - - diff --git a/out/articles/Love Live! Custom Arcade Controller.article b/out/articles/Love Live! Custom Arcade Controller.article deleted file mode 100644 index 80fb2c3..0000000 --- a/out/articles/Love Live! Custom Arcade Controller.article +++ /dev/null @@ -1,7 +0,0 @@ -

My Love Live! Custom Arcade Controller

-
-

-For over a year since I first got into Love Live! School Idol Festival ~after school ACTIVITY~ Wai-Wai!Home Meeting!! Try saying that one 10 times fast!Subscript -

-
-
15 July 2022 1:53PM
%CONDITIONAL_EXPAND%
diff --git a/out/articles/Love Live! Custom Arcade Controller.article.html b/out/articles/Love Live! Custom Arcade Controller.article.html deleted file mode 100644 index 1185938..0000000 --- a/out/articles/Love Live! Custom Arcade Controller.article.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - -
-

My Love Live! Custom Arcade Controller

-
-

-For over a year since I first got into Love Live! School Idol Festival ~after school ACTIVITY~ Wai-Wai!Home Meeting!! Try saying that one 10 times fast!Subscript -

-
-
15 July 2022 1:53PM
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/articles/curabitur vel tempus ex.article b/out/articles/curabitur vel tempus ex.article deleted file mode 100644 index 6e005a0..0000000 --- a/out/articles/curabitur vel tempus ex.article +++ /dev/null @@ -1,11 +0,0 @@ -

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. -

-
-

-

-<><Test>"</test></test2><test3>"
-            
-

-
29 Apr 2022 7:37PM
%CONDITIONAL_EXPAND%
diff --git a/out/articles/curabitur vel tempus ex.article.html b/out/articles/curabitur vel tempus ex.article.html deleted file mode 100644 index 36a0de8..0000000 --- a/out/articles/curabitur vel tempus ex.article.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - -
-

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. -

-
-

-

-<><Test>"</test></test2><test3>"
-            
-

-
29 Apr 2022 7:37PM
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/articles/sigplace1.article b/out/articles/sigplace1.article deleted file mode 100644 index 19cd529..0000000 --- a/out/articles/sigplace1.article +++ /dev/null @@ -1,486 +0,0 @@ -

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. -

-

- 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. -

-

- 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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-
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!
-

-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. -

-
-

-

-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.CopyOption;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.StandardOpenOption;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-public class sigPlace {
-    /* 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;
-    */
-    static double COLOR_ROTATION = 0;
-    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"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_START", "<div class=\"contentWrapper\"><h1>"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_END", "</h1><div class=\"content\" %ID%>"),
-        new AbstractMap.SimpleEntry<>("$CONTENT_END", "</div>"),
-        new AbstractMap.SimpleEntry<>("$DATE_CONTENT_START", "<div class=\"datebar\"></div><div class=\"date\">")
-    ));
-    final static HashMap<String,Path> ops = new HashMap<>(Map.ofEntries(
-        new AbstractMap.SimpleEntry<>(
-            "%DEFAULT", Paths.get(REFDIR,"DEFAULT.html")),
-        new AbstractMap.SimpleEntry<>(
-            "%FOOTER", Paths.get(REFDIR,"FOOTER.html"))
-    ));
-    public static void main(String[] args) {
-        if (args.length>0&&args.length%2==0) {
-            int i=0;
-            while (i<args.length) {
-                String arg1=args[i];
-                String arg2=args[i+1];
-                i+=2;
-                if (arg1.equals("-p")) {
-                    PORT=Integer.parseInt(arg2);
-                    System.out.println("Port set to "+PORT+".");
-                } else {
-                    System.err.println("Invalid argument \""+arg1+"\".");
-                    return;
-                }
-            }
-        }
-        System.out.println("Copying files over to output directory...");
-        try {
-            copyDirectory("sitefiles","out");
-            Iterator<Path> items = Files.walk(Paths.get("out")).filter((p)->!p.toAbsolutePath().toString().contains("images/")).iterator();
-            ParseArticleFiles(items);
-            items = Files.walk(Paths.get("out")).iterator();
-            ConvertArticleReferences(items);
-            items = Files.walk(Paths.get("out","articles")).iterator();
-            GenerateArticleFiles(items);
-        }catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Copying files over failed!");
-            return;
-        }
-        System.out.println("Building directory listings...");
-        try {
-            buildDirectoryListings();
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Failed to build directory listings!");
-            return;
-        }
-        System.out.println("Site has been built into the "+OUTDIR+" directory.");
-        ExportCodeFile();
-        System.out.println("\nStarting web server...");
-        new sigServer();
-    }
-    private static void ParseArticleFiles(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Found "+f.getFileName());
-            if (Files.isRegularFile(f)) {
-                try {
-                    System.out.println("  Preparing "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    if (isHTMLFile(f)) {
-                        content.addAll(0,Files.readAllLines(ops.get("%DEFAULT")));
-                        content.addAll(Files.readAllLines(ops.get("%FOOTER")));
-                    }
-                    System.out.println("  Parsing "+f.getFileName());
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        //System.out.println(s);
-                        if (s.length()>0&&(isHTMLFile(f)||isArticleFile(f))) {
-                            if (!inCodeBlock) {
-                                if (s.contains("<pre>")) {
-                                    //System.out.println("Inside <pre>");
-                                    inCodeBlock=true;
-                                    storedCodeBlock="";
-                                    s=s.substring(0,s.indexOf("<pre>"));
-                                }
-                            }
-                            if (inCodeBlock&&s.contains("</pre>")) {
-                                inCodeBlock=false;
-                                boolean keyword=false;
-                                boolean inString=false;
-                                boolean inChar=false;
-                                boolean canBeNumericalConstant=false;
-                                int lengthOfConstant=0;
-                                storedCodeBlock+=s.substring(0,s.indexOf("</pre>"));
-                                storedCodeBlock=storedCodeBlock.replaceAll(Pattern.quote("<"),"<");
-                                s+="</pre>";
-                                storedCodeBlock="<pre>"+storedCodeBlock;
-                                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)=='"') {
-                                        inString=!inString;
-                                        if (inString) {
-                                            s+=SPAN("string")+"\"";
-                                        } else {
-                                            s+="\"</span>";
-                                            startPos=j+1;
-                                        }
-                                    } else
-                                    if (!inString&&!inChar) {
-                                        if (canBeNumericalConstant&&validNumericalConstantCharacters(lengthOfConstant, j)) {
-                                            lengthOfConstant++;
-                                            System.out.println("Length of Constant now "+lengthOfConstant);
-                                        }
-                                        if (canBeNumericalConstant&&lengthOfConstant>0&&!(validNumericalConstantCharacters(lengthOfConstant, j))) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            //System.out.println("Setting "+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j));
-                                            lengthOfConstant=0;
-                                            canBeNumericalConstant=false;
-                                            startPos=j+1;
-                                        } else
-                                        if (!canBeNumericalConstant&&storedCodeBlock.charAt(j)=='.') {
-                                            //Previous section was a member.
-                                            s+=SPAN("class")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>3&&storedCodeBlock.substring(j-3,j+1).equals("true")&&!isAlphanumeric(j-4)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>4&&storedCodeBlock.substring(j-4,j+1).equals("false")&&!isAlphanumeric(j-5)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (storedCodeBlock.charAt(j)=='(') {
-                                            s+=SPAN("function")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && storedCodeBlock.charAt(j)==' '&&storedCodeBlock.charAt(j-1)!=' ') {
-                                            //Previous section was a keyword.
-                                            keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && (storedCodeBlock.charAt(j)==';'||storedCodeBlock.charAt(j)==':')) {
-                                            //Previous section was a keyword.
-                                            //keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (keyword&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z'||storedCodeBlock.charAt(j)==' ')) {
-                                            keyword=false;
-                                            s+=SPAN("variable")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else
-                                        if (!isAlphanumeric(j)){
-                                            if (startPos<j) {
-                                                s+=storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j);
-                                            } else {
-                                                s+=storedCodeBlock.charAt(j);
-                                            }
-                                            startPos=j+1;
-                                        }
-                                    } else {
-                                        s+=storedCodeBlock.charAt(j);
-                                        startPos=j+1;
-                                    }
-                                    if (canBeNumericalConstant&&lengthOfConstant==0&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9')) {
-                                        canBeNumericalConstant=false;
-                                    }
-                                    if (!canBeNumericalConstant&&!isAlphanumeric(j)) {
-                                        canBeNumericalConstant=true;
-                                        lengthOfConstant=0;
-                                        System.out.println("Found "+storedCodeBlock.charAt(j)+", can be numeric...");
-                                    }
-                                }
-                                s+=endText;
-                                //System.out.println("Stored code block: "+storedCodeBlock);
-                            } else 
-                            if (inCodeBlock) {
-                                storedCodeBlock+=s+"\n";
-                                s=" ";
-                            }
-                        }
-                        if (s.length()>0&&isArticleFile(f)) {
-                            //Check for markdown pieces.
-                            if (s.charAt(0)=='-') {
-                                //Start of a title piece.
-                                s=s.replace("-",map.get("$TITLE_CONTENT_START"));
-                                s=s+map.get("$TITLE_CONTENT_END").replace("%ID%","id=\"content_"+f+"\"");
-                                //Use โคˆ if there's more text to be shown than can fit.
-                            } else
-                            if (s.contains("===")) {
-                                s=map.get("$CONTENT_END")+map.get("$DATE_CONTENT_START")+s.replace("===","")+map.get("$CONTENT_END")+"%CONDITIONAL_EXPAND%"+map.get("$CONTENT_END");
-                            } else 
-                            if (s.charAt(0)==':') {
-                                //Image with caption.
-                                //Format:
-                                //:<url>,<left|right|center>,<width>,<caption>
-                                String[] splitter = s.split(Pattern.quote(","));
-                                StringBuilder captionText = new StringBuilder(splitter[3]);
-                                for (int j=4;j<splitter.length;j++) {
-                                    captionText.append(",").append(splitter[j]);
-                                }
-                                s="<div><figure style=\"text-align:center;"+((splitter[1].equals("left")||splitter[1].equals("right"))?"width:"+splitter[2]+"%;float:"+splitter[1]+";":"")+"\"><img src=\"/"+splitter[0].substring(1)+"\" style=\"margin:auto;width:100%;\"><figcaption>"+captionText.toString()+"</figcaption></figure></div>";
-                            } else {
-                                //It's regular content, so add paragraphs.
-                                s="<p class=\"color"+(((int)(COLOR_ROTATION=(COLOR_ROTATION+0.4)%6))+1)+"\">"+s+"</p>";
-                            }
-                        } else 
-                        if (s.length()==0&&isArticleFile(f)) {
-                            s="<br/>"; //Setup a line break here.
-                        }
-                        for (String key : map.keySet()) {
-                            s=s.replaceAll(Pattern.quote(key),map.get(key));
-                        }
-                        content.set(i,s);
-                    }
-                    System.out.println("  Writing to "+f.toAbsolutePath());
-                    Files.write(f, content, Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-                    
-                    System.out.println(" "+f.getFileName() + " conversion complete!");
-                } catch (IOException e) {
-                    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';
-    }
-    private static boolean isAlphanumeric(int j) {
-        return storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z';
-    }
-    /**
-     * 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()) {
-            Path f = items.next();
-            try {
-                if (Files.isRegularFile(f)&&isArticleFile(f)) {
-                    System.out.println("  Creating article for "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    List<String> preContent = Files.readAllLines(ops.get("%DEFAULT"));
-                    List<String> postContent = Files.readAllLines(ops.get("%FOOTER"));
-                    StringBuilder sb = new StringBuilder();
-                    for (String d : preContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : content) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        d=d.replaceFirst("div class=\"content\"","div class=\"expandedContent\"");
-                        d=d.replaceFirst("%CONDITIONAL_EXPAND%","");
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : postContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    Files.write(Paths.get(f.getParent().toString(),f.getFileName()+".html"),sb.toString().getBytes());
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    private static void ConvertArticleReferences(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Looking for Article References..."+f.getFileName());
-            boolean articleJavascriptIncluded=false;
-            if (Files.isRegularFile(f)&&isHTMLFile(f)) {
-                System.out.println("  Searching "+f.getFileName());
-                try {
-                    List<String> content = Files.readAllLines(f);
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        if (s.length()>0&&s.contains("$ARTICLE_PREVIEW")) {
-                            String article = ARTICLESDIR+"/"+s.replace("$ARTICLE_PREVIEW ","")+".article";
-                            System.out.println("   Found article preview request in "+f.getFileName()+" for article "+article+".");
-                            Path file = Paths.get(OUTDIR,article);
-                            List<String> newData = Files.readAllLines(file);
-                            if (newData.size()>0) {
-                                content.set(i,newData.get(0));
-                                for (int j=1;j<newData.size();j++) {
-                                    content.add(i+j, newData.get(j));
-                                }
-                                String lastline=content.get(i+newData.size()-1);
-                                lastline=lastline.replace("%CONDITIONAL_EXPAND%","<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand(this,'"+Paths.get(OUTDIR,article.toString())+"')\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                                content.set(i+newData.size()-1,lastline);//<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                            } else {
-                                content.set(i,"");
-                            }
-                            if (!articleJavascriptIncluded) {
-                                List<String> articlejs = Files.readAllLines(Paths.get(REFDIR,"article.js"));
-                                for (int j=articlejs.size()-1;j>=0;j--) {
-                                    content.add(i,articlejs.get(j));
-                                }
-                                articleJavascriptIncluded=true;
-                            }
-                        }
-                    }
-                    Files.write(f,content);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-    static void copyDirectory(String sourceDirectoryLocation, String destinationDirectoryLocation) 
-    throws IOException {
-        Files.walk(Paths.get(sourceDirectoryLocation))
-        .forEach(source -> {
-            Path destination = Paths.get(destinationDirectoryLocation, source.toString()
-                .substring(sourceDirectoryLocation.length()));
-            try {
-                if (Files.isDirectory(destination)) {
-                    Files.createDirectories(destination);
-                } else {
-                    Files.copy(source, destination, new CopyOption[]{StandardCopyOption.COPY_ATTRIBUTES,StandardCopyOption.REPLACE_EXISTING});
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        });
-    }
-    static void buildDirectoryListings() 
-    throws IOException {
-        String startingPath=Paths.get(sigPlace.OUTDIR).toAbsolutePath().toString();
-        HashMap<String,List<Path>> map = new HashMap<>();
-        Iterator<Path> it = Files.walk(Paths.get(sigPlace.OUTDIR)).iterator();
-        map.put("/",new ArrayList<Path>());
-        while (it.hasNext()) {
-            Path f = it.next();
-            if (!f.getFileName().toString().equals(OUTDIR)) {
-                String myKey = f.toAbsolutePath().toString().replace(startingPath,"").replace(f.getFileName().toString(),"");
-                //System.out.println(myKey+","+f);
-                map.putIfAbsent(myKey,new ArrayList<Path>());
-                map.get(myKey).add(f);
-            }
-        }
-        System.out.println("Directory structure determined:");
-        System.out.println("    "+map);
-        for (String key : map.keySet()) {
-            System.out.println("Creating directory listing for "+key+"...");
-            StringBuilder sb = new StringBuilder("");
-            List<String> data = Files.readAllLines(ops.get("%DEFAULT"));
-            List<String> data2 = Files.readAllLines(ops.get("%FOOTER"));
-            for (String d : data) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            sb.append("<h2>Directory Listing for "+key+"</h2>");
-            sb.append("<div class=\"folderlisting\"><a href=\"")
-            .append(key)
-            .append("..\" class=\"icon\">📁</a><a href=\"")
-            .append(key)
-            .append("..\">.. </a><a href=\"")
-            .append(key)
-            .append("..\" class=\"nounderline\">(Previous Directory)</a></div>");
-            for (Path f : map.get(key)) {
-                sb.append("<div class=\"").append((Files.isDirectory(f)?"folderlisting":"filelisting")).append("\">")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\" class=\"icon\">")
-                .append((Files.isDirectory(f)?"📁":"🗎"))
-                .append("</a>")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\">")
-                .append(f.getFileName())
-                .append("</a>\t")
-                .append(Files.getLastModifiedTime(f))
-                .append("\t")
-                .append(Files.getOwner(f))
-                .append("\t")
-                .append(Files.size(f))
-                .append("</div>\n");
-            }
-            for (String d : data2) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            Path newf = Files.write(Paths.get(OUTDIR,key,DIRECTORYLISTING_FILENAME),sb.toString().getBytes());
-            System.out.println("  Added info for ("+map.size()+") files to "+newf.toAbsolutePath());
-        }
-    }
-    private static boolean isArticleFile(Path f) {
-        return f.getFileName().toString().contains(".article");
-    }
-    private static boolean isHTMLFile(Path f) {
-        return f.getFileName().toString().contains(".html");
-    }
-    private static void ExportCodeFile() {
-        try {
-            Path file = Paths.get("sigServer.java");
-            List<String> data = Files.readAllLines(file);
-            int i=0;
-            while (!data.get(i++).contains("sigServer()")&&i<data.size());
-            if (i<data.size()) {
-                Files.write(Paths.get(OUTDIR,"codeBackground"),data.subList(i, Math.min(i+40,data.size())),Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        
-    }
-}
-
-

-
3 May 2022 10:25AM
%CONDITIONAL_EXPAND%
diff --git a/out/articles/sigplace1.article.html b/out/articles/sigplace1.article.html deleted file mode 100644 index 8553604..0000000 --- a/out/articles/sigplace1.article.html +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - - - - - - -
-

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. -

-

- 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. -

-

- 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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-
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!
-

-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. -

-
-

-

-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.CopyOption;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.StandardOpenOption;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-public class sigPlace {
-    /* 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;
-    */
-    static double COLOR_ROTATION = 0;
-    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"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_START", "<div class=\"contentWrapper\"><h1>"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_END", "</h1><div class=\"content\" %ID%>"),
-        new AbstractMap.SimpleEntry<>("$CONTENT_END", "</div>"),
-        new AbstractMap.SimpleEntry<>("$DATE_CONTENT_START", "<div class=\"datebar\"></div><div class=\"date\">")
-    ));
-    final static HashMap<String,Path> ops = new HashMap<>(Map.ofEntries(
-        new AbstractMap.SimpleEntry<>(
-            "%DEFAULT", Paths.get(REFDIR,"DEFAULT.html")),
-        new AbstractMap.SimpleEntry<>(
-            "%FOOTER", Paths.get(REFDIR,"FOOTER.html"))
-    ));
-    public static void main(String[] args) {
-        if (args.length>0&&args.length%2==0) {
-            int i=0;
-            while (i<args.length) {
-                String arg1=args[i];
-                String arg2=args[i+1];
-                i+=2;
-                if (arg1.equals("-p")) {
-                    PORT=Integer.parseInt(arg2);
-                    System.out.println("Port set to "+PORT+".");
-                } else {
-                    System.err.println("Invalid argument \""+arg1+"\".");
-                    return;
-                }
-            }
-        }
-        System.out.println("Copying files over to output directory...");
-        try {
-            copyDirectory("sitefiles","out");
-            Iterator<Path> items = Files.walk(Paths.get("out")).filter((p)->!p.toAbsolutePath().toString().contains("images/")).iterator();
-            ParseArticleFiles(items);
-            items = Files.walk(Paths.get("out")).iterator();
-            ConvertArticleReferences(items);
-            items = Files.walk(Paths.get("out","articles")).iterator();
-            GenerateArticleFiles(items);
-        }catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Copying files over failed!");
-            return;
-        }
-        System.out.println("Building directory listings...");
-        try {
-            buildDirectoryListings();
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Failed to build directory listings!");
-            return;
-        }
-        System.out.println("Site has been built into the "+OUTDIR+" directory.");
-        ExportCodeFile();
-        System.out.println("\nStarting web server...");
-        new sigServer();
-    }
-    private static void ParseArticleFiles(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Found "+f.getFileName());
-            if (Files.isRegularFile(f)) {
-                try {
-                    System.out.println("  Preparing "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    if (isHTMLFile(f)) {
-                        content.addAll(0,Files.readAllLines(ops.get("%DEFAULT")));
-                        content.addAll(Files.readAllLines(ops.get("%FOOTER")));
-                    }
-                    System.out.println("  Parsing "+f.getFileName());
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        //System.out.println(s);
-                        if (s.length()>0&&(isHTMLFile(f)||isArticleFile(f))) {
-                            if (!inCodeBlock) {
-                                if (s.contains("<pre>")) {
-                                    //System.out.println("Inside <pre>");
-                                    inCodeBlock=true;
-                                    storedCodeBlock="";
-                                    s=s.substring(0,s.indexOf("<pre>"));
-                                }
-                            }
-                            if (inCodeBlock&&s.contains("</pre>")) {
-                                inCodeBlock=false;
-                                boolean keyword=false;
-                                boolean inString=false;
-                                boolean inChar=false;
-                                boolean canBeNumericalConstant=false;
-                                int lengthOfConstant=0;
-                                storedCodeBlock+=s.substring(0,s.indexOf("</pre>"));
-                                storedCodeBlock=storedCodeBlock.replaceAll(Pattern.quote("<"),"<");
-                                s+="</pre>";
-                                storedCodeBlock="<pre>"+storedCodeBlock;
-                                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)=='"') {
-                                        inString=!inString;
-                                        if (inString) {
-                                            s+=SPAN("string")+"\"";
-                                        } else {
-                                            s+="\"</span>";
-                                            startPos=j+1;
-                                        }
-                                    } else
-                                    if (!inString&&!inChar) {
-                                        if (canBeNumericalConstant&&validNumericalConstantCharacters(lengthOfConstant, j)) {
-                                            lengthOfConstant++;
-                                            System.out.println("Length of Constant now "+lengthOfConstant);
-                                        }
-                                        if (canBeNumericalConstant&&lengthOfConstant>0&&!(validNumericalConstantCharacters(lengthOfConstant, j))) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            //System.out.println("Setting "+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j));
-                                            lengthOfConstant=0;
-                                            canBeNumericalConstant=false;
-                                            startPos=j+1;
-                                        } else
-                                        if (!canBeNumericalConstant&&storedCodeBlock.charAt(j)=='.') {
-                                            //Previous section was a member.
-                                            s+=SPAN("class")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>3&&storedCodeBlock.substring(j-3,j+1).equals("true")&&!isAlphanumeric(j-4)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>4&&storedCodeBlock.substring(j-4,j+1).equals("false")&&!isAlphanumeric(j-5)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (storedCodeBlock.charAt(j)=='(') {
-                                            s+=SPAN("function")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && storedCodeBlock.charAt(j)==' '&&storedCodeBlock.charAt(j-1)!=' ') {
-                                            //Previous section was a keyword.
-                                            keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && (storedCodeBlock.charAt(j)==';'||storedCodeBlock.charAt(j)==':')) {
-                                            //Previous section was a keyword.
-                                            //keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (keyword&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z'||storedCodeBlock.charAt(j)==' ')) {
-                                            keyword=false;
-                                            s+=SPAN("variable")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else
-                                        if (!isAlphanumeric(j)){
-                                            if (startPos<j) {
-                                                s+=storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j);
-                                            } else {
-                                                s+=storedCodeBlock.charAt(j);
-                                            }
-                                            startPos=j+1;
-                                        }
-                                    } else {
-                                        s+=storedCodeBlock.charAt(j);
-                                        startPos=j+1;
-                                    }
-                                    if (canBeNumericalConstant&&lengthOfConstant==0&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9')) {
-                                        canBeNumericalConstant=false;
-                                    }
-                                    if (!canBeNumericalConstant&&!isAlphanumeric(j)) {
-                                        canBeNumericalConstant=true;
-                                        lengthOfConstant=0;
-                                        System.out.println("Found "+storedCodeBlock.charAt(j)+", can be numeric...");
-                                    }
-                                }
-                                s+=endText;
-                                //System.out.println("Stored code block: "+storedCodeBlock);
-                            } else 
-                            if (inCodeBlock) {
-                                storedCodeBlock+=s+"\n";
-                                s=" ";
-                            }
-                        }
-                        if (s.length()>0&&isArticleFile(f)) {
-                            //Check for markdown pieces.
-                            if (s.charAt(0)=='-') {
-                                //Start of a title piece.
-                                s=s.replace("-",map.get("$TITLE_CONTENT_START"));
-                                s=s+map.get("$TITLE_CONTENT_END").replace("%ID%","id=\"content_"+f+"\"");
-                                //Use โคˆ if there's more text to be shown than can fit.
-                            } else
-                            if (s.contains("===")) {
-                                s=map.get("$CONTENT_END")+map.get("$DATE_CONTENT_START")+s.replace("===","")+map.get("$CONTENT_END")+"%CONDITIONAL_EXPAND%"+map.get("$CONTENT_END");
-                            } else 
-                            if (s.charAt(0)==':') {
-                                //Image with caption.
-                                //Format:
-                                //:<url>,<left|right|center>,<width>,<caption>
-                                String[] splitter = s.split(Pattern.quote(","));
-                                StringBuilder captionText = new StringBuilder(splitter[3]);
-                                for (int j=4;j<splitter.length;j++) {
-                                    captionText.append(",").append(splitter[j]);
-                                }
-                                s="<div><figure style=\"text-align:center;"+((splitter[1].equals("left")||splitter[1].equals("right"))?"width:"+splitter[2]+"%;float:"+splitter[1]+";":"")+"\"><img src=\"/"+splitter[0].substring(1)+"\" style=\"margin:auto;width:100%;\"><figcaption>"+captionText.toString()+"</figcaption></figure></div>";
-                            } else {
-                                //It's regular content, so add paragraphs.
-                                s="<p class=\"color"+(((int)(COLOR_ROTATION=(COLOR_ROTATION+0.4)%6))+1)+"\">"+s+"</p>";
-                            }
-                        } else 
-                        if (s.length()==0&&isArticleFile(f)) {
-                            s="<br/>"; //Setup a line break here.
-                        }
-                        for (String key : map.keySet()) {
-                            s=s.replaceAll(Pattern.quote(key),map.get(key));
-                        }
-                        content.set(i,s);
-                    }
-                    System.out.println("  Writing to "+f.toAbsolutePath());
-                    Files.write(f, content, Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-                    
-                    System.out.println(" "+f.getFileName() + " conversion complete!");
-                } catch (IOException e) {
-                    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';
-    }
-    private static boolean isAlphanumeric(int j) {
-        return storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z';
-    }
-    /**
-     * 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()) {
-            Path f = items.next();
-            try {
-                if (Files.isRegularFile(f)&&isArticleFile(f)) {
-                    System.out.println("  Creating article for "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    List<String> preContent = Files.readAllLines(ops.get("%DEFAULT"));
-                    List<String> postContent = Files.readAllLines(ops.get("%FOOTER"));
-                    StringBuilder sb = new StringBuilder();
-                    for (String d : preContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : content) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        d=d.replaceFirst("div class=\"content\"","div class=\"expandedContent\"");
-                        d=d.replaceFirst("%CONDITIONAL_EXPAND%","");
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : postContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    Files.write(Paths.get(f.getParent().toString(),f.getFileName()+".html"),sb.toString().getBytes());
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    private static void ConvertArticleReferences(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Looking for Article References..."+f.getFileName());
-            boolean articleJavascriptIncluded=false;
-            if (Files.isRegularFile(f)&&isHTMLFile(f)) {
-                System.out.println("  Searching "+f.getFileName());
-                try {
-                    List<String> content = Files.readAllLines(f);
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        if (s.length()>0&&s.contains("$ARTICLE_PREVIEW")) {
-                            String article = ARTICLESDIR+"/"+s.replace("$ARTICLE_PREVIEW ","")+".article";
-                            System.out.println("   Found article preview request in "+f.getFileName()+" for article "+article+".");
-                            Path file = Paths.get(OUTDIR,article);
-                            List<String> newData = Files.readAllLines(file);
-                            if (newData.size()>0) {
-                                content.set(i,newData.get(0));
-                                for (int j=1;j<newData.size();j++) {
-                                    content.add(i+j, newData.get(j));
-                                }
-                                String lastline=content.get(i+newData.size()-1);
-                                lastline=lastline.replace("%CONDITIONAL_EXPAND%","<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand(this,'"+Paths.get(OUTDIR,article.toString())+"')\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                                content.set(i+newData.size()-1,lastline);//<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                            } else {
-                                content.set(i,"");
-                            }
-                            if (!articleJavascriptIncluded) {
-                                List<String> articlejs = Files.readAllLines(Paths.get(REFDIR,"article.js"));
-                                for (int j=articlejs.size()-1;j>=0;j--) {
-                                    content.add(i,articlejs.get(j));
-                                }
-                                articleJavascriptIncluded=true;
-                            }
-                        }
-                    }
-                    Files.write(f,content);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-    static void copyDirectory(String sourceDirectoryLocation, String destinationDirectoryLocation) 
-    throws IOException {
-        Files.walk(Paths.get(sourceDirectoryLocation))
-        .forEach(source -> {
-            Path destination = Paths.get(destinationDirectoryLocation, source.toString()
-                .substring(sourceDirectoryLocation.length()));
-            try {
-                if (Files.isDirectory(destination)) {
-                    Files.createDirectories(destination);
-                } else {
-                    Files.copy(source, destination, new CopyOption[]{StandardCopyOption.COPY_ATTRIBUTES,StandardCopyOption.REPLACE_EXISTING});
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        });
-    }
-    static void buildDirectoryListings() 
-    throws IOException {
-        String startingPath=Paths.get(sigPlace.OUTDIR).toAbsolutePath().toString();
-        HashMap<String,List<Path>> map = new HashMap<>();
-        Iterator<Path> it = Files.walk(Paths.get(sigPlace.OUTDIR)).iterator();
-        map.put("/",new ArrayList<Path>());
-        while (it.hasNext()) {
-            Path f = it.next();
-            if (!f.getFileName().toString().equals(OUTDIR)) {
-                String myKey = f.toAbsolutePath().toString().replace(startingPath,"").replace(f.getFileName().toString(),"");
-                //System.out.println(myKey+","+f);
-                map.putIfAbsent(myKey,new ArrayList<Path>());
-                map.get(myKey).add(f);
-            }
-        }
-        System.out.println("Directory structure determined:");
-        System.out.println("    "+map);
-        for (String key : map.keySet()) {
-            System.out.println("Creating directory listing for "+key+"...");
-            StringBuilder sb = new StringBuilder("");
-            List<String> data = Files.readAllLines(ops.get("%DEFAULT"));
-            List<String> data2 = Files.readAllLines(ops.get("%FOOTER"));
-            for (String d : data) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            sb.append("<h2>Directory Listing for "+key+"</h2>");
-            sb.append("<div class=\"folderlisting\"><a href=\"")
-            .append(key)
-            .append("..\" class=\"icon\">📁</a><a href=\"")
-            .append(key)
-            .append("..\">.. </a><a href=\"")
-            .append(key)
-            .append("..\" class=\"nounderline\">(Previous Directory)</a></div>");
-            for (Path f : map.get(key)) {
-                sb.append("<div class=\"").append((Files.isDirectory(f)?"folderlisting":"filelisting")).append("\">")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\" class=\"icon\">")
-                .append((Files.isDirectory(f)?"📁":"🗎"))
-                .append("</a>")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\">")
-                .append(f.getFileName())
-                .append("</a>\t")
-                .append(Files.getLastModifiedTime(f))
-                .append("\t")
-                .append(Files.getOwner(f))
-                .append("\t")
-                .append(Files.size(f))
-                .append("</div>\n");
-            }
-            for (String d : data2) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            Path newf = Files.write(Paths.get(OUTDIR,key,DIRECTORYLISTING_FILENAME),sb.toString().getBytes());
-            System.out.println("  Added info for ("+map.size()+") files to "+newf.toAbsolutePath());
-        }
-    }
-    private static boolean isArticleFile(Path f) {
-        return f.getFileName().toString().contains(".article");
-    }
-    private static boolean isHTMLFile(Path f) {
-        return f.getFileName().toString().contains(".html");
-    }
-    private static void ExportCodeFile() {
-        try {
-            Path file = Paths.get("sigServer.java");
-            List<String> data = Files.readAllLines(file);
-            int i=0;
-            while (!data.get(i++).contains("sigServer()")&&i<data.size());
-            if (i<data.size()) {
-                Files.write(Paths.get(OUTDIR,"codeBackground"),data.subList(i, Math.min(i+40,data.size())),Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        
-    }
-}
-
-

-
3 May 2022 10:25AM
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/articles/test articles/DIRECTORY_LISTING b/out/articles/test articles/DIRECTORY_LISTING deleted file mode 100644 index a3323e2..0000000 --- a/out/articles/test articles/DIRECTORY_LISTING +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - -

Directory Listing for /articles/test articles/

📁.. (Previous Directory)
🗎test1.article 2022-08-03T19:48:45.106844Z gitpod 1085
-
🗎test2.article 2022-08-03T19:48:45.106844Z gitpod 781
-
🗎test3.article 2022-08-03T19:48:45.106844Z gitpod 994
-
🗎test1.article.html 2022-08-03T19:48:45.162844Z gitpod 10972
-
🗎test2.article.html 2022-08-03T19:48:45.166844Z gitpod 10668
-
🗎test3.article.html 2022-08-03T19:48:45.166844Z gitpod 10881
- - -
-
- - - diff --git a/out/articles/test articles/test1.article b/out/articles/test articles/test1.article deleted file mode 100644 index 19ef4fd..0000000 --- a/out/articles/test articles/test1.article +++ /dev/null @@ -1,5 +0,0 @@ -

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
%CONDITIONAL_EXPAND%
diff --git a/out/articles/test articles/test1.article.html b/out/articles/test articles/test1.article.html deleted file mode 100644 index 7a7dc27..0000000 --- a/out/articles/test articles/test1.article.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - -
-

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
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/articles/test articles/test2.article b/out/articles/test articles/test2.article deleted file mode 100644 index 521b977..0000000 --- a/out/articles/test articles/test2.article +++ /dev/null @@ -1,5 +0,0 @@ -

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
%CONDITIONAL_EXPAND%
diff --git a/out/articles/test articles/test2.article.html b/out/articles/test articles/test2.article.html deleted file mode 100644 index e2e2ee5..0000000 --- a/out/articles/test articles/test2.article.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - -
-

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
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/articles/test articles/test3.article b/out/articles/test articles/test3.article deleted file mode 100644 index cf77fc7..0000000 --- a/out/articles/test articles/test3.article +++ /dev/null @@ -1,5 +0,0 @@ -

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
%CONDITIONAL_EXPAND%
diff --git a/out/articles/test articles/test3.article.html b/out/articles/test articles/test3.article.html deleted file mode 100644 index bf33e75..0000000 --- a/out/articles/test articles/test3.article.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - -
-

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
-
- -
- Leave a comment!

-

-

- -
-
-  B  -  I  -  U  -  <code>  -  <http://>  -  ๐Ÿ˜Š  -  ๐Ÿ˜”  -  ๐Ÿ‘  -  โค๏ธ  -  ๐Ÿ˜ก  -
- -


- -


- - - -
-
-
- - - diff --git a/out/codeBackground b/out/codeBackground deleted file mode 100644 index b01356b..0000000 --- a/out/codeBackground +++ /dev/null @@ -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;i0) { - if (line.equals(boundary)) { diff --git a/out/error.html b/out/error.html deleted file mode 100644 index e2a8e36..0000000 --- a/out/error.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - -
-We're Sorry! Your webpage is in another castle! -=== -

-

Go Back

-
-
-
- - - diff --git a/out/images/DIRECTORY_LISTING b/out/images/DIRECTORY_LISTING deleted file mode 100644 index a4616bb..0000000 --- a/out/images/DIRECTORY_LISTING +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - -

Directory Listing for /images/

📁.. (Previous Directory)
🗎Love_Live!_Logo.png 2022-08-01T14:45:39Z gitpod 12167
-
🗎github.webp 2022-08-01T14:58:45Z gitpod 7270
- - -
-
- - - diff --git a/out/images/Love_Live!_Logo.png b/out/images/Love_Live!_Logo.png deleted file mode 100644 index 4cd1d5c..0000000 Binary files a/out/images/Love_Live!_Logo.png and /dev/null differ diff --git a/out/images/github.webp b/out/images/github.webp deleted file mode 100644 index a80b292..0000000 Binary files a/out/images/github.webp and /dev/null differ diff --git a/out/otherpage.html b/out/otherpage.html deleted file mode 100644 index 0709100..0000000 --- a/out/otherpage.html +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - - - - - - -
-This is a different webpage.
- -

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. -

-

- 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. -

-

- 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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-

-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. -

-
-
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!
-

-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. -

-
-

-

-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.CopyOption;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.StandardOpenOption;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-public class sigPlace {
-    /* 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;
-    */
-    static double COLOR_ROTATION = 0;
-    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"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_START", "<div class=\"contentWrapper\"><h1>"),
-        new AbstractMap.SimpleEntry<>("$TITLE_CONTENT_END", "</h1><div class=\"content\" %ID%>"),
-        new AbstractMap.SimpleEntry<>("$CONTENT_END", "</div>"),
-        new AbstractMap.SimpleEntry<>("$DATE_CONTENT_START", "<div class=\"datebar\"></div><div class=\"date\">")
-    ));
-    final static HashMap<String,Path> ops = new HashMap<>(Map.ofEntries(
-        new AbstractMap.SimpleEntry<>(
-            "%DEFAULT", Paths.get(REFDIR,"DEFAULT.html")),
-        new AbstractMap.SimpleEntry<>(
-            "%FOOTER", Paths.get(REFDIR,"FOOTER.html"))
-    ));
-    public static void main(String[] args) {
-        if (args.length>0&&args.length%2==0) {
-            int i=0;
-            while (i<args.length) {
-                String arg1=args[i];
-                String arg2=args[i+1];
-                i+=2;
-                if (arg1.equals("-p")) {
-                    PORT=Integer.parseInt(arg2);
-                    System.out.println("Port set to "+PORT+".");
-                } else {
-                    System.err.println("Invalid argument \""+arg1+"\".");
-                    return;
-                }
-            }
-        }
-        System.out.println("Copying files over to output directory...");
-        try {
-            copyDirectory("sitefiles","out");
-            Iterator<Path> items = Files.walk(Paths.get("out")).filter((p)->!p.toAbsolutePath().toString().contains("images/")).iterator();
-            ParseArticleFiles(items);
-            items = Files.walk(Paths.get("out")).iterator();
-            ConvertArticleReferences(items);
-            items = Files.walk(Paths.get("out","articles")).iterator();
-            GenerateArticleFiles(items);
-        }catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Copying files over failed!");
-            return;
-        }
-        System.out.println("Building directory listings...");
-        try {
-            buildDirectoryListings();
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.err.println("Failed to build directory listings!");
-            return;
-        }
-        System.out.println("Site has been built into the "+OUTDIR+" directory.");
-        ExportCodeFile();
-        System.out.println("\nStarting web server...");
-        new sigServer();
-    }
-    private static void ParseArticleFiles(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Found "+f.getFileName());
-            if (Files.isRegularFile(f)) {
-                try {
-                    System.out.println("  Preparing "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    if (isHTMLFile(f)) {
-                        content.addAll(0,Files.readAllLines(ops.get("%DEFAULT")));
-                        content.addAll(Files.readAllLines(ops.get("%FOOTER")));
-                    }
-                    System.out.println("  Parsing "+f.getFileName());
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        //System.out.println(s);
-                        if (s.length()>0&&(isHTMLFile(f)||isArticleFile(f))) {
-                            if (!inCodeBlock) {
-                                if (s.contains("<pre>")) {
-                                    //System.out.println("Inside <pre>");
-                                    inCodeBlock=true;
-                                    storedCodeBlock="";
-                                    s=s.substring(0,s.indexOf("<pre>"));
-                                }
-                            }
-                            if (inCodeBlock&&s.contains("</pre>")) {
-                                inCodeBlock=false;
-                                boolean keyword=false;
-                                boolean inString=false;
-                                boolean inChar=false;
-                                boolean canBeNumericalConstant=false;
-                                int lengthOfConstant=0;
-                                storedCodeBlock+=s.substring(0,s.indexOf("</pre>"));
-                                storedCodeBlock=storedCodeBlock.replaceAll(Pattern.quote("<"),"<");
-                                s+="</pre>";
-                                storedCodeBlock="<pre>"+storedCodeBlock;
-                                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)=='"') {
-                                        inString=!inString;
-                                        if (inString) {
-                                            s+=SPAN("string")+"\"";
-                                        } else {
-                                            s+="\"</span>";
-                                            startPos=j+1;
-                                        }
-                                    } else
-                                    if (!inString&&!inChar) {
-                                        if (canBeNumericalConstant&&validNumericalConstantCharacters(lengthOfConstant, j)) {
-                                            lengthOfConstant++;
-                                            System.out.println("Length of Constant now "+lengthOfConstant);
-                                        }
-                                        if (canBeNumericalConstant&&lengthOfConstant>0&&!(validNumericalConstantCharacters(lengthOfConstant, j))) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            //System.out.println("Setting "+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j));
-                                            lengthOfConstant=0;
-                                            canBeNumericalConstant=false;
-                                            startPos=j+1;
-                                        } else
-                                        if (!canBeNumericalConstant&&storedCodeBlock.charAt(j)=='.') {
-                                            //Previous section was a member.
-                                            s+=SPAN("class")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>3&&storedCodeBlock.substring(j-3,j+1).equals("true")&&!isAlphanumeric(j-4)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>4&&storedCodeBlock.substring(j-4,j+1).equals("false")&&!isAlphanumeric(j-5)&&!isAlphanumeric(j+1)) {
-                                            s+=SPAN("number")+storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j)+"</span>";
-                                            startPos=j+1;
-                                        } else 
-                                        if (storedCodeBlock.charAt(j)=='(') {
-                                            s+=SPAN("function")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && storedCodeBlock.charAt(j)==' '&&storedCodeBlock.charAt(j-1)!=' ') {
-                                            //Previous section was a keyword.
-                                            keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (j>0&&isAlphanumeric(j-1) && (storedCodeBlock.charAt(j)==';'||storedCodeBlock.charAt(j)==':')) {
-                                            //Previous section was a keyword.
-                                            //keyword=true;
-                                            s+=SPAN("keyword")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else 
-                                        if (keyword&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z'||storedCodeBlock.charAt(j)==' ')) {
-                                            keyword=false;
-                                            s+=SPAN("variable")+storedCodeBlock.substring(startPos,j)+"</span>"+storedCodeBlock.charAt(j);
-                                            startPos=j+1;
-                                        } else
-                                        if (!isAlphanumeric(j)){
-                                            if (startPos<j) {
-                                                s+=storedCodeBlock.substring(startPos,j)+storedCodeBlock.charAt(j);
-                                            } else {
-                                                s+=storedCodeBlock.charAt(j);
-                                            }
-                                            startPos=j+1;
-                                        }
-                                    } else {
-                                        s+=storedCodeBlock.charAt(j);
-                                        startPos=j+1;
-                                    }
-                                    if (canBeNumericalConstant&&lengthOfConstant==0&&!(storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9')) {
-                                        canBeNumericalConstant=false;
-                                    }
-                                    if (!canBeNumericalConstant&&!isAlphanumeric(j)) {
-                                        canBeNumericalConstant=true;
-                                        lengthOfConstant=0;
-                                        System.out.println("Found "+storedCodeBlock.charAt(j)+", can be numeric...");
-                                    }
-                                }
-                                s+=endText;
-                                //System.out.println("Stored code block: "+storedCodeBlock);
-                            } else 
-                            if (inCodeBlock) {
-                                storedCodeBlock+=s+"\n";
-                                s=" ";
-                            }
-                        }
-                        if (s.length()>0&&isArticleFile(f)) {
-                            //Check for markdown pieces.
-                            if (s.charAt(0)=='-') {
-                                //Start of a title piece.
-                                s=s.replace("-",map.get("$TITLE_CONTENT_START"));
-                                s=s+map.get("$TITLE_CONTENT_END").replace("%ID%","id=\"content_"+f+"\"");
-                                //Use โคˆ if there's more text to be shown than can fit.
-                            } else
-                            if (s.contains("===")) {
-                                s=map.get("$CONTENT_END")+map.get("$DATE_CONTENT_START")+s.replace("===","")+map.get("$CONTENT_END")+"%CONDITIONAL_EXPAND%"+map.get("$CONTENT_END");
-                            } else 
-                            if (s.charAt(0)==':') {
-                                //Image with caption.
-                                //Format:
-                                //:<url>,<left|right|center>,<width>,<caption>
-                                String[] splitter = s.split(Pattern.quote(","));
-                                StringBuilder captionText = new StringBuilder(splitter[3]);
-                                for (int j=4;j<splitter.length;j++) {
-                                    captionText.append(",").append(splitter[j]);
-                                }
-                                s="<div><figure style=\"text-align:center;"+((splitter[1].equals("left")||splitter[1].equals("right"))?"width:"+splitter[2]+"%;float:"+splitter[1]+";":"")+"\"><img src=\"/"+splitter[0].substring(1)+"\" style=\"margin:auto;width:100%;\"><figcaption>"+captionText.toString()+"</figcaption></figure></div>";
-                            } else {
-                                //It's regular content, so add paragraphs.
-                                s="<p class=\"color"+(((int)(COLOR_ROTATION=(COLOR_ROTATION+0.4)%6))+1)+"\">"+s+"</p>";
-                            }
-                        } else 
-                        if (s.length()==0&&isArticleFile(f)) {
-                            s="<br/>"; //Setup a line break here.
-                        }
-                        for (String key : map.keySet()) {
-                            s=s.replaceAll(Pattern.quote(key),map.get(key));
-                        }
-                        content.set(i,s);
-                    }
-                    System.out.println("  Writing to "+f.toAbsolutePath());
-                    Files.write(f, content, Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-                    
-                    System.out.println(" "+f.getFileName() + " conversion complete!");
-                } catch (IOException e) {
-                    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';
-    }
-    private static boolean isAlphanumeric(int j) {
-        return storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||storedCodeBlock.charAt(j)>='A'&&storedCodeBlock.charAt(j)<='Z'||storedCodeBlock.charAt(j)>='a'&&storedCodeBlock.charAt(j)<='z';
-    }
-    /**
-     * 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()) {
-            Path f = items.next();
-            try {
-                if (Files.isRegularFile(f)&&isArticleFile(f)) {
-                    System.out.println("  Creating article for "+f.getFileName());
-                    List<String> content = Files.readAllLines(f);
-                    List<String> preContent = Files.readAllLines(ops.get("%DEFAULT"));
-                    List<String> postContent = Files.readAllLines(ops.get("%FOOTER"));
-                    StringBuilder sb = new StringBuilder();
-                    for (String d : preContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : content) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        d=d.replaceFirst("div class=\"content\"","div class=\"expandedContent\"");
-                        d=d.replaceFirst("%CONDITIONAL_EXPAND%","");
-                        sb.append(d).append("\n");
-                    }
-                    for (String d : postContent) {
-                        for (String k : sigPlace.map.keySet()) {
-                            d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                        }
-                        sb.append(d).append("\n");
-                    }
-                    Files.write(Paths.get(f.getParent().toString(),f.getFileName()+".html"),sb.toString().getBytes());
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    private static void ConvertArticleReferences(Iterator<Path> items) {
-        while (items.hasNext()) {
-            Path f = items.next();
-            System.out.println(" Looking for Article References..."+f.getFileName());
-            boolean articleJavascriptIncluded=false;
-            if (Files.isRegularFile(f)&&isHTMLFile(f)) {
-                System.out.println("  Searching "+f.getFileName());
-                try {
-                    List<String> content = Files.readAllLines(f);
-                    for (int i=0;i<content.size();i++) {
-                        String s = content.get(i);
-                        if (s.length()>0&&s.contains("$ARTICLE_PREVIEW")) {
-                            String article = ARTICLESDIR+"/"+s.replace("$ARTICLE_PREVIEW ","")+".article";
-                            System.out.println("   Found article preview request in "+f.getFileName()+" for article "+article+".");
-                            Path file = Paths.get(OUTDIR,article);
-                            List<String> newData = Files.readAllLines(file);
-                            if (newData.size()>0) {
-                                content.set(i,newData.get(0));
-                                for (int j=1;j<newData.size();j++) {
-                                    content.add(i+j, newData.get(j));
-                                }
-                                String lastline=content.get(i+newData.size()-1);
-                                lastline=lastline.replace("%CONDITIONAL_EXPAND%","<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand(this,'"+Paths.get(OUTDIR,article.toString())+"')\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                                content.set(i+newData.size()-1,lastline);//<div class=\"unexpanded\" id=\"expand_"+i+"\" onClick=\"expand("+i+")\"><br/><br/><br/><br/>⤈ Click to expand.</div>");
-                            } else {
-                                content.set(i,"");
-                            }
-                            if (!articleJavascriptIncluded) {
-                                List<String> articlejs = Files.readAllLines(Paths.get(REFDIR,"article.js"));
-                                for (int j=articlejs.size()-1;j>=0;j--) {
-                                    content.add(i,articlejs.get(j));
-                                }
-                                articleJavascriptIncluded=true;
-                            }
-                        }
-                    }
-                    Files.write(f,content);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-    static void copyDirectory(String sourceDirectoryLocation, String destinationDirectoryLocation) 
-    throws IOException {
-        Files.walk(Paths.get(sourceDirectoryLocation))
-        .forEach(source -> {
-            Path destination = Paths.get(destinationDirectoryLocation, source.toString()
-                .substring(sourceDirectoryLocation.length()));
-            try {
-                if (Files.isDirectory(destination)) {
-                    Files.createDirectories(destination);
-                } else {
-                    Files.copy(source, destination, new CopyOption[]{StandardCopyOption.COPY_ATTRIBUTES,StandardCopyOption.REPLACE_EXISTING});
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        });
-    }
-    static void buildDirectoryListings() 
-    throws IOException {
-        String startingPath=Paths.get(sigPlace.OUTDIR).toAbsolutePath().toString();
-        HashMap<String,List<Path>> map = new HashMap<>();
-        Iterator<Path> it = Files.walk(Paths.get(sigPlace.OUTDIR)).iterator();
-        map.put("/",new ArrayList<Path>());
-        while (it.hasNext()) {
-            Path f = it.next();
-            if (!f.getFileName().toString().equals(OUTDIR)) {
-                String myKey = f.toAbsolutePath().toString().replace(startingPath,"").replace(f.getFileName().toString(),"");
-                //System.out.println(myKey+","+f);
-                map.putIfAbsent(myKey,new ArrayList<Path>());
-                map.get(myKey).add(f);
-            }
-        }
-        System.out.println("Directory structure determined:");
-        System.out.println("    "+map);
-        for (String key : map.keySet()) {
-            System.out.println("Creating directory listing for "+key+"...");
-            StringBuilder sb = new StringBuilder("");
-            List<String> data = Files.readAllLines(ops.get("%DEFAULT"));
-            List<String> data2 = Files.readAllLines(ops.get("%FOOTER"));
-            for (String d : data) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            sb.append("<h2>Directory Listing for "+key+"</h2>");
-            sb.append("<div class=\"folderlisting\"><a href=\"")
-            .append(key)
-            .append("..\" class=\"icon\">📁</a><a href=\"")
-            .append(key)
-            .append("..\">.. </a><a href=\"")
-            .append(key)
-            .append("..\" class=\"nounderline\">(Previous Directory)</a></div>");
-            for (Path f : map.get(key)) {
-                sb.append("<div class=\"").append((Files.isDirectory(f)?"folderlisting":"filelisting")).append("\">")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\" class=\"icon\">")
-                .append((Files.isDirectory(f)?"📁":"🗎"))
-                .append("</a>")
-                .append("<a href=\""+(f.toAbsolutePath().toString().replace(Paths.get(OUTDIR).toAbsolutePath().toString(),""))+"\">")
-                .append(f.getFileName())
-                .append("</a>\t")
-                .append(Files.getLastModifiedTime(f))
-                .append("\t")
-                .append(Files.getOwner(f))
-                .append("\t")
-                .append(Files.size(f))
-                .append("</div>\n");
-            }
-            for (String d : data2) {
-                for (String k : sigPlace.map.keySet()) {
-                    d=d.replaceAll(Pattern.quote(k),sigPlace.map.get(k));
-                }
-                sb.append(d).append("\n");
-            }
-            Path newf = Files.write(Paths.get(OUTDIR,key,DIRECTORYLISTING_FILENAME),sb.toString().getBytes());
-            System.out.println("  Added info for ("+map.size()+") files to "+newf.toAbsolutePath());
-        }
-    }
-    private static boolean isArticleFile(Path f) {
-        return f.getFileName().toString().contains(".article");
-    }
-    private static boolean isHTMLFile(Path f) {
-        return f.getFileName().toString().contains(".html");
-    }
-    private static void ExportCodeFile() {
-        try {
-            Path file = Paths.get("sigServer.java");
-            List<String> data = Files.readAllLines(file);
-            int i=0;
-            while (!data.get(i++).contains("sigServer()")&&i<data.size());
-            if (i<data.size()) {
-                Files.write(Paths.get(OUTDIR,"codeBackground"),data.subList(i, Math.min(i+40,data.size())),Charset.defaultCharset(),StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        
-    }
-}
-
-

-
3 May 2022 10:25AM




⤈ Click to expand.
-

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




⤈ Click to expand.
-

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




⤈ Click to expand.
-

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




⤈ Click to expand.
-

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. -

-
-

-

-<><Test>"</test></test2><test3>"
-            
-

-
29 Apr 2022 7:37PM




⤈ Click to expand.
-
-
-
- - - diff --git a/out/reset.css b/out/reset.css deleted file mode 100644 index 73614e1..0000000 --- a/out/reset.css +++ /dev/null @@ -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; -} diff --git a/out/sig.css b/out/sig.css deleted file mode 100644 index c0f6dcc..0000000 --- a/out/sig.css +++ /dev/null @@ -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); -} diff --git a/out/testfile.html b/out/testfile.html deleted file mode 100644 index 59adf19..0000000 --- a/out/testfile.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - -
-SigPlace --SigPlace -=== -

-Other Page! -
-
-
- - - diff --git a/out/uploadform.html b/out/uploadform.html deleted file mode 100644 index 275c159..0000000 --- a/out/uploadform.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - -
-SigPlace -
- - -
-
-
-
- - - diff --git a/sigPlace.java b/sigPlace.java index 54ddd94..6a2aef8 100644 --- a/sigPlace.java +++ b/sigPlace.java @@ -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 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';