Pretty HTML Processor for NetLogo Applets, version 2
written by Teresa Carrigan
- What is it?
- How it works
- How to use it
- Things to notice
- Extending the model
- NetLogo features
- WHAT'S NEW?
- Credits and References
- Download the model
- Download sample files
WHAT IS IT?
This NetLogo program will take the HTML file produced by NetLogo when you "Save as Applet" and turn it into a nicer webpage. Please note that this will not run from an applet.
HOW IT WORKS
First, a settings file is read to initialize variables. The sample settings file that comes with this program is named "settings.txt" but you can use any text file for your settings.Next, a template file is read. The sample template file that comes with this program is named "Template.html" but you can use any text file for a template.
The program then opens an HTML file that has been produced by NetLogo's "Save as Applet" command. This file is scanned for Information tab headings (which are always on the line above a line with "---").
The template file is now processed, line by line. Any line that does not have a "?" first is copied exactly into the pretty-HTML list. If there is a "?" first, then the program runs "proc-" plus the rest of the "?" line. Usually this entails looking for certain sections of the original HTML file, and copying those lines to the pretty-HTML list.
Finally, the pretty-HTML list is saved to a file.
HOW TO USE IT
First, look at the settings file. Blank lines and lines that start with a ";" are ignored. Don't change the first word on any of the other lines (unless you delete the line entirely). Do modify the rest of the line to fit your needs. For example, you will need to edit the background line, either specifying the path to the background image you will use, or "" for no background image.Now go to the Interface tab for the Pretty HTML program, and click the setup button. You will be asked to browse to find the settings file and the template file.
Next click the go button. You will be asked to browse to find the HTML file you want processed.
Finally, you will be asked where you want to store the HTML file. After you are comfortable using Pretty HTML with your NetLogo HTML files, you can just save the new version on top of the old one. Until you know you have the settings and template the way you want them, it is better to save to a new name. Make sure you use an extension of .html or .htm, and some webservers do not like spaces in filenames.
Open the new HTML file in a web browser to see how it looks. If you like the results and have many HTML files to convert, just click the go button again. Pressing setup a second time is not needed if there are no changes made in the settings or template file.
THINGS TO NOTICE
You can change the NetLogo standard section headings, such as the "THINGS TO NOTICE" directly above here. You don't have to use all capitals either, but you do have to have the "---" line below the heading.You do not need to keep all the standard section headings, and you can make your own section headings if you like.
Only in the "HOW TO USE IT" section, any word right before a word in the bold-list (from the settings file) will be bold. If you want a word in another section bolded, you can use bold HTML tags around it.
EXTENDING THE MODEL
Have the program produce multiple HTML files, with each Information tab section on its own webpage, and all of them linked to each other.
NETLOGO FEATURES
Extensive use is made of various file- commands as well as run, member?, item, position, remove-item, and substring.
WHAT'S NEW?
Version 2 added Cascading Style Sheets as an option, and also fixed a minor glitch that would sometimes cause problems if a user pressed the go button a second time without clicking setup again.
CREDITS AND REFERENCES
This model was written by Teresa W. Carrigan, 2004.Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:
Contact Teresa Carrigan for appropriate licenses for redistribution for profit.
- this copyright notice is included.
- this model will not be redistributed for profit without permission from Teresa Carrigan .
To refer to this model in academic publications, please use:
Carrigan, T. (2004). Pretty HTML Processor for NetLogo Applets, version 2
Blackburn College, Carlinville, IL.In other publications, please use:
Copyright 2004 by Teresa W. Carrigan. All rights reserved.
HomeApplets on this website were written by Teresa Carrigan in 2004, for use in computer science courses at Blackburn College, with the exception of the Fireworks applet. The applets made with NetLogo require Java 1.4.1 or higher to run. The applets made with NetBeans require Java 1.4.2 or higher to run. Applets might not run on Windows 95 or Mac OS 8 or 9. You may obtain the latest Java plugin from Sun's Java site.