QuickWeb
| Home | An Example | Another Example | Download | About |

A Java Example

The following Java code has been used in the main method of the released Jar file :

public class Main {

    /**
     * API usage example.
     * The main method create a simple website that contains two pages. Every page contains a title and 3 paragraphs.
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Site monSite = new SimpleSite("My first website", "./firstSite/", SimpleSite.LEFT_PANEL);
        
        monSite.addPages(
        
                PageBuilder.createPage("Home", "./index.html", monSite).addElements(
                        new H1("Welcome to my first website"),
                        new P("Welcome to this small and really simple web site. I would, rather, call it skeleton because"
                                + " it doesn't really hold a big amount of information but the basics of a simple web site"
                                + " are here."),
                        new P("As you can see, this web site contains a navigation bar and doesn't have left or right panels."
                                + " As mentioned, this tool is to create quicly an (almost) empty site to begin with the content"
                                + " of the real web site."),
                        new P("The web site creation is more fun when it's not any more about hatml tags and error and"
                                + " forgotten letters. Using QuickWeb, the devloper can  focus on the content and let opening"
                                + " and closing the tags to the tool.")
                ),
                PageBuilder.createPage("One last thing", "./page1.html", monSite).addElements(
                        new H1("A second page"),
                        new P("QuickWeb can handle more than one page and it can generate navigation bars in a very simple way."),
                        new P("The developper can, also, create several layouts of the exacte simple way by changing one and only"
                                + " one value which is the type of the site. Removing or adding a new page has never been as simple"
                                + " as QuickWeb."),
                        new P("Enjoy!")
                )
                
        );
        
        monSite.save();
        
    }
    
}

You can see the created project by running the Jar file using the command line :

java -jar QuickWeb.jar

HTML generated using hilite.me