Introduction | Existing Macros |
Advantages | Quotations |
Disadvantages | Caching |
How to Proceed | Costs |
How It Works | Set Variables |
HTML (Hypertext Markup Language) static macros are a way of generating boilerplate HTML for your website, without the complexity or cost of JSP (Java Server Pages) or other server-side technologies. You embed terse commands called macros, e.g. <!-- macro Foot --> in your HTML text and run the macro preprocessor to expand the boilerplate, e.g. a page footer. Once you have your expanded HTML decided all is as you want it, you upload the expanded HTML to your website, where it is served statically.
The basic idea is this. You embed magic comments in your HTML that look like something like this:
<!-- macro Measure 20 cm -->
Then you run htmlmacros.exe and it expands those comments to boilerplate that looks like this:
<!-- macro JDisplay Measure 20 cm -->
and renders for your viewers like this:
This also means you can’t, in a perfectly straightforward way, slip new versions of HTML static macros into yours the way you could with JSP. To make that update/merging process easier, when you modify code, create new replacement classes with new names and discard the old, rather than simply modifying code. Over the coming months I will work to split the code more cleanly in two, the stuff peculiar to my website and the code of general interest. That will make it easier for you to ignore my specific code and to incorporate revisions in the general purpose code into your own application.
Packages Included | |
---|---|
Package | Purpose |
com.mindprod.htmlmacros | The macro expansion engine and a large set of macros, some of which you might use unmodified, some you will find useless and can be discarded and some you can cannibalise to create your own variants e.g. page header and footer macros. com.mindprod.htmlmacros.macro contains the macros themselves. They extend abstract class com.mindprod.htmlmacros.macro.Macro. com.mindprod.htmlmacros.support contains utility code to make writing macros easier. |
com.mindprod.stores | Code for generating references to a multitude of Amazon and other bookstores with embedded affiliate codes, so I get a commission if somebody clicks and buys a recommended book. If you don’t want to use this feature, you can discard com.mindprod.htmlmacros.macro.Book.java and com.mindprod.htmlmacros.macro. Amazon.java and the com.mindprod.aws packages. |
com.mindprod.common18 | Various utility classes, mainly for string manipulations. |
com.mindprod.compactor | Compacts out unnecessary whitespace from the finished HTML for faster up and downloading. |
com.mindprod.comparators | Comparators for sorting. |
com.mindprod.csv | Reads and writes Comma-separated value fields. |
com.mindprod.currcon | Displays prices in the local currency, works in conjunction with the CurrCon Applet. If you don’t want to use this feature you can discard com.mindprod.htmlmacros.CurrCon.java and the com.mindprod.currcon package. |
com.mindprod.entities | converts HTML entities ⇒ unicode. |
com.mindprod.filter | Used to control which files to process. |
com.mindprod.fourtidy | Tidies DESCRIPT.ION files used in tcc/Take Command to track what all the various files are for. |
com.mindprod.hunkio | Utility class for rapidly reading entire files in one i/o. |
com.mindprod.http | Utility class doing HTTP (Hypertext Transfer Protocol), mainly screen-scraping information off the web. Not used directly by any macros but some of the auxiliary programs use it for batch gathering information, e.g. information about books. |
com.mindprod.isbn | Used if you handle book ISBN (International Standard Book Number) numbers in your macros. If you don’t handle books on your website, you can delete this package, com.mindprod.htmlmacro.Book.java and com.mindprod.htmlmacros.macro. Amazon.java and the com.mindprod.amazon packages. |
com.mindprod.jdisplay com.mindprod.jdisplayaux com.mindprod.jtokens com.mindprod.jprep | JPrep manual. It generates program and other listings colourised using a variety of fonts and sizes to highlight. If you don’t want to use this feature, you can discard com.mindprod.htmlmacros.macro. JDisplay . java and the com.mindprod.jdisplay, com.mindprod.jdisplayaux, com.mindprod.jdisplayorphans, com.mindprod.jprep and com.mindprod.jtokens packages. |
com.mindprod.ledatastream | Used to read little-endian binary data, such as the fields inside a GIF (Graphic Interchange Format) image. |
com.mindprod.prices | Used for generating such as price lists of software. |
com.mindprod.qf | Used to automatically build glossary indexes, such as the Java glossary, the Computer buyers’ glossary, the gay and black slang glossary and the environment glossary. Unless you have glossaries on your website, you can discard this package. It is fairly integrated into my headers, so you probably should just keep it around until you have removed all indexing style headers. It allows you to embellish entries with various icons to warn users of large web pages, particularly important items etc. |
com.mindprod.seesort | Used to sort lists of references to other pages in alphabetical order. Also to automatically insert links, using the glossary indexes. |
com.mindprod.sitemap | Builds a list of all files on the website, when it was last modified and how often it should be spidered. Used by Google to speed up spidering of your website. |
com.mindprod.untouch | Backdates files to their original dates if they contain no net changes since the last upload. This saves pointless uploads and Google respidering. |
Various Existing Macros | |||
---|---|---|---|
Class | Purpose | Syntax | Example |
Acronym | Displays an acronym and its expansion with embedded styles to highlight the capital letters in the expansion. There are a number of built-in acronyms for which specifying the expansion is optional. | <!-- macro Acronym [plain] [means] [td] {acronym} {expansion} --> | <!-- macro Acronym
DU (Depleted Uranium)
{Depleted Uranium} -->
<!-- macro Acronym DU-->. The plain option displays just the acronym, suitably highlighted. The means option displays just the meaning, without the acronym. By default both are displayed the first occurrence on the page and just the acronym thereafter. The td option encloses the acronym and meaning in <td>…</td> tags to arrange acronyms and meanings in table columns. |
Age | calculates age in years, months, days, e. g. supply birthdate and it expands to current age in years as of the time the macro was expanded. | <!-- macro Age date yyyy-mm-dd [on yyyy-mm-dd] [years/months/days] --> | <!-- macro Age 1948-02-04 years --> |
AllPosters | Generates a thumbnail affiliate link to AllPosters.com. | <!-- macro AllPosters title productID prunedProductLink prunedthumbnailImageName width height --> | <!-- AllPosters macro AllPosters Morning Textures 923499 Morning-Textures 10/1020/IUUW000Z 160 160 --> |
Art | Generates a thumbnail affiliate link to Art.com. | <!--macro Art title productid width height --> | <!--macro Art Victoria Falls, Zimbabwe 12870686 115 86 --> |
Audio | Generates an iconic link to an audio file. | <!--macro Audio soundfile format --> | <!--macro Audio {http://www.radio4all.net/index.php/program/6824} mp3 --> |
BestBrowsers | Generates a list of recommended browsers and versions. | <!-- macro BestBrowsers context, [trouble] --> | <!-- macro BestBrowsers glossary Your current browser cannot deal with frames --> |
Book | Generates book referral link to an Amazon, Powell’s, Barnes & Noble, Chapters etc bookstores. | <!-- macro Book isbn, [paperback] [hardcover] [kindle] title, author, [notes], [publisher], [published], [class], [bookcoversdir] --> | <!-- macro Book isbn=9780960068883 paperback=9780960068883 hardcover=9780960068890 title="Handbook to Higher Consciousness author=Ken Keyes Jr. publisher=Love Line" published=1984-08 notes={Ken’s classic. This is by far his best selling book.} --> |
Button | Generates a clickable or decorative button | <!-- macro Button buttonname [webroot-relativeURL] --> | <!-- macro Button launch webstart/setclock.html --> The image used to render the button is image/button/launch.png. The lettering on the button is launch. |
ColourScheme | Displays a row of colour swatches | <!-- macro ColourScheme list of hex colours --> | <!-- macro ColourScheme #000000 #808080 #ffffff --> |
CurrCon | Displays currency/price converted to the user’s home currency. | See CurrCon Manual. There are many variants. | <!-- macro CurrCon c$AN USD 10.00 --> |
DailySpecial | Random link to something on the website. Changes daily. You need to follow it with some text, or an image and a </a> tag. | <!-- macro DailySpecial list of relative-url-possibilities --> text/image </a> | <!-- macro DailySpecial
../animalrights/freerange.html ../animalrights/intel.html ../applet/canadiantax.html ../applet/converter.html ../applet/fileio.html unmain.html -->Take a chance</a> |
Degrees | Computes and displays temperatures in both degrees Celsius and Fahrenheit. | <!-- macro Degrees temperature then F or C [delta] --> | <!-- macro Degrees 5 F delta --> |
Dim | Displays length, width × height or width × height × depth dimensions in both metric and imperial measure. The td option generates code for a pair of table columns. | <!-- macro Dim width x height unitsOfMeasure td --> | <!-- macro Dim 40 x 20 cm --> |
Donates | Generates link to PayPal to let a visitor donate. | <!-- macro Donate cause buttoncode --> | <!-- macro Donate Computer Buyers’ glossary T9GKBKG8XPBA4 --> |
DVD (Digital Video Disc) | Affiliate referral link to a DVD. | <!-- macro DVD asin=, [upc=], title=, author=, [type=] [notes=], [class=] --> | <!-- macro DVD asin=B00179CXIK title=The Truth About Climate Change author={David Attenborough} notes={Britain’s most famous naturalist holds forth. Only available in Britain. Make sure to get the version you buy has a region that can be handled by your player.} --> |
Electronic | Generates referral link to Amazon, Tiger Direct and NewEgg. Usually electronic sales. | <!-- macro Electronic many keyword=value pairs --> | <!-- macro Electronic asin=B00006LIQL title=TiVo Digital Recorder notes={Magnetic tape-style vcrs will not longer work with digital TV. Instead you use a digital recorder. This one from TiVo will record your favourite programs for you without you having to explicitly tell it when they are on since it consults an online TV guide it accesses via a telephone call. Further, it will let you pause and rewind a show you are watching live. It can record 80 hours digitally. Some TVs come bundled with a digital recorder.} --> |
FileInJDK | Generate a reference to the local copy of some file in the current JDK (Java Development Kit). | <!-- macro JDKLocation reference description --> | <!-- macro JDK Location bin\native2ascii.exe native2ascii.exe --> |
Env | Expands to the value of some variable in the set environment. | <!-- macro Env {var} --> | <!-- macro Env JAVA_HOME --> |
FileInJRE | Generate a reference to the local copy of some file in the current JRE (Java Runtime Environment). | <!-- macro JRELocation reference description --> | <!-- macro JRELocation {lib/security/C:\Users\} {cacerts list of trusted certificate authorities} --> |
FileSize | Expands to the current size of a given file. | <!--macro FileSize webRoot-relative local file name--> | <!--macro FileSize zips/amper15.zip --> |
Foot | Standard footer. Quite elaborate with rotating ads, navigation and various icons. | <!--macro Foot [ad] [noad] [nonmil] [nextpage]--> | <!--macro Foot nonmil --> |
Image | Displays an image in the image directory tree, finds the dimensions itself. | <!-- macro Image image file, [caption/link] altText [link url] [align] --> | <!-- macro Image animal/browneggs.jpg caption Rhode Island Red free range brown eggs right --> Possible alignments include: none bottom center floatleft floatright left middle right top. |
Include | raw include text from a local file on disk. Use webroot relative filename. (Originally absolute names were used, but this was changed in preparation for converting to JSP .) May be nested. i.e. the included text might possibly containing embedded macros that need to be expanded/refreshed, including Include macros. | <!--macro Include webroot-relative-filename to include. --> | <!--macro Include include/primeminister.htmlfrag--> Include does not adjust relative links or link classes. You must prepare your includes with relative links constructed as if they were already included in place or use macro Link style self-adjusting links. Included text may contain macros, expanded or unexpanded. They may even include Include macros. |
EE (Enterprise Edition) | Link to Oracle’s EE documentation. | <!-- macro EE {reference.} {description} --> | <!-- macro EE {javax/servlet/http/HttpServletResponse.html} {Server HTTP response codes} --> |
JavaAPI | Link to Oracle’s Java classes Javadoc both locally and on Oracle website. | <!-- macro JavaAPI reference description --> | <!-- macro JavaAPI {java/util/zip/Adler32.html} {Adler32} --> |
JavaFXAPI | Link to Oracle’s JavaFX classes Javadoc both locally and on the Oracle website. | <!-- macro JavaFXAPI reference description --> | <!-- macro JavaFXAPI javafx/scene/control/DatePicker.html DatePicker --> |
JDisplay | Display a colourised program, bat, csv etc listing using a variety of automatically fonts and sizes based on parsing the file in corresponding snippet directories, preparsed by JPrep. | <!-- macro JDisplay snippetName [maxwidth] [maxheight] --> | <!-- macro JDisplay Get.java --> |
JavaCC | Generate a reference to a JavaCC parser. | <!-- macro JavaCC parserName url email author releaseDate notes --> | <!-- macro JavaCC Oberon {http://www.cs.may.ie/~jpower/Oberon/} oberon.jj jpower@cs.may.ie "James Power" 1998-11-17 -{A parser for the programming language Oberon-2. Oberon is the latest generation in the Wirth family of languages, an heir to the Pascal and Modula tradition.} --> |
JDK | Generate a reference the current or previous JDK or some part of it. | <!-- macro JDK flavour --> where flavour is one of defaultpath, dir, fullversion, macro, micro, path, path32, recommendedversion, url, url32 version. | <!-- macro
JDK
fullversion -->
defaultpath : C:\Program Files\java\jdk1.8.0_131\ dir : jdk1.8.0_131 fullversion : 1.8.0_131 macro : 1.8 micro : 0 path : J:\Program Files\java\jdk1.8.0_131\ path32 : J:\Program Files (x86)\java\jdk1.8.0_131\ recommendedversion : 1.8.0_131 url : file:///J:/Program%20Files/Java/jdk1.8.0_131 url : file:///J:/Program%20Files%20(x86)/Java/jdk1.8.0_131 version : 1.8.0 There are still more like oldfullversion, jetprofileversion, jetversion, jetfullversion, intellijversion, intellijfullversion. |
FileInJDK | Generate a reference to the local copy of some file in the current JDK. | <!-- macro JDKLocation reference description --> | <!-- macro JDKLocation bin\native2ascii.exe native2ascii.exe --> |
JRE | Generate a reference the current JRE or some part of it. | <!-- macro JRE flavour --> where flavour is one of defaultpath, dir, fullversion, macro, micro, path, path32, recommendedversion, url, url32, version. | <!-- macro
JRE
path -->
defaultpath : C:\Program Files\java\jre1.8.0_131\ dir : jre1.8.0_131 fullversion : 1.8.0_131 macroversion : 1.8 microversion : 0 path : C:\Program Files\java\jre1.8.0_131\ path32 : C:\Program Files (x86)\java\jre1.8.0_131\ recommendedversion : 1.8.0_131 url : file:///C:/Program%20Files/Java/jre1.8.0_131 url32 : file:///C:/Program%20Files%20(x86)/Java/jre1.8.0_131 version : 1.8.0 There are still more like oldfullversion, jetprofileversion, jetversion, jetfullversion, intellijversion, intellijfullversion. |
KJV | Generate a labeled link into the online version of the King James Bible. | <!-- macro KJV (! = display or ~ = suppress) book fromChapter:fromVerse [toChapter:toVerse] --> | <!-- macro KJV ! Leviticus 15:29 15:30 --> |
Link | A generic href usually for use in included text that is adjusted to account for which page the text is included, in other words converts from upPath to relative link and css class for in the context of the the text is inserted. | <!-- macro Link a webroot-relative-URL description cssclass. --> | <!--- macro Link contact/roedy.html#NONMIL Non-military use only. plain --> |
LL | Describes one person for a database of people | <!-- macro LL 15 fields: nickname name attended photo homephone workphone noLongerUsed emailpng website address city prov postal country notes --> | <!-- macro LL Roedy Roedy Green + people/roedy200805.jpg
"(250) 361-9093 workPhone dummy roedy
mindprod.com XXXX YYYY Street" Victoria BC V8T
4G8 Canada {Single, gay, HIV (Human Immuno-deficiency Virus)
+, born <span class=date>1948-02-04</span>.
Been attending workshops since <span class=date>1977-06</span> in Berkeley. Lead a Living Love <a
href=workshop.html>workshop</a> in England in
<span class=date>2002-09</span> and at Quadra
Island in <span class=date>2001-08</span>. If
you visit Victoria, — you are welcome to sleep on my floor. Hosts a
<a href=livinglove.html>Living Love
Website</a>. See my <a href=llbio.html>living
love biography</a>. See <a href=../contact/roedy.html>resume</a>. Knows Angela Wensley,
Geneva Hagen and Marty Bunch.} -->
This example shows how you can embed HTML including entities and tags inside parameter values. |
MailTo | Generates a munged email reference using a Masker-created png file in the image/mailto directory. This foil spam harvesters looking for email references on your website. | <!-- macro MailTo mungedEmailImageName(name of masker file without .png) personName [email/name/both] --> | <!-- macro MailTo nicfulton Nic Fulton both --> |
Measure | Ddiscontiued. Replaced by the more general Dim macro. | ||
Moved | Generates a stub page to indicate a page that formerly had the stub’s name and location has moved, that automatically redirects to the new location. | <!-- macro Moved webroot-relative-newName --> | <!-- macro Moved applet/applets.html --> |
NeedsJava | Spells out in great detail just why and how Java is needed for a given task and what do it if it is not working. | <!-- macro NeedsJava javaVersion(e.g. 1.1) (signed/unsigned) (jni/nojni) Applet className projectDesc [why signed] --> | <!-- macro NeedsJava 1.1 unsigned nojni hybrid Bio Biorhythms Calculator --> |
NeedsJWS | Spells out in great detail just why and how Java Web Start is needed for a given task and what do it if it is not working. | <!-- macro NeedsJWS takes no parameters --> | <!-- macro NeedsJWS --> |
Newsgroup | Generates a reference to a newsgroup. | <!-- macro Newsgroup newsgroupName --> | <!-- macro Newsgroup comp.lang.java.programmer --> |
NoJava | Generates text that appears when Java is not available. | <!-- macro NoJava (Applet/JWS) --> | <!-- macro NoJava Applet --> |
OnOracle | Link to Oracle’s documentation both locally and on their website. Use JavaAPI or JavaFXAPI for class Javadoc. | <!-- macro OnOracle reference description --> | <!-- macro OnOracle {https://docs.oracle.com/javase/specs/jls/se8/html/index.html} {online specification} --> |
OS (Operating System)es | Generates a list of operating systems that have some property in common. | <!-- macro OS es list or ranges with colon e.g. W95:XP, or W2K: or XP- etc. --> | <!-- macro OS es W2K:VISTA --> |
Photo | Displays a camera icon. When the user clicks it, he sees a photo, not necessarily of a person. The image is in the image directory tree. | <!-- macro Photo imageFile(without lead mindprod/image/) --> | <!-- macro Photo environment/electricbikebig.jpg --> |
Qualified | Displays a fully qualified method name with package, class and method with different styles for each piece. | <!-- macro Qualified [package].[Class].[var].[method] {class/interface} --> | <!-- macro Qualified com.mindprod.common18.ST.beep class --> |
Quotation | Generates a random quotation. Changes randomly every half hour, if the expansion is rerun using the Windows Task Scheduler. The quotations themselves live in the quote directory animalrights, Christian, environment, evolution, livinglove, misc, patriotism, politics, religion. These collections are combined in various ways to form the categories used on the Quotation macro. | <!--macro Quotation takes a category parameter, e.g. animalrights. environment, general, livinglove, misc, politics, religion --> | <!--macro Quotation religion --> |
Reunion | Generated a record about one person coming to a reunion. | <!-- macro Reunion oldFirst oldLast newFirst newLast significantOther birthdate photo coming excuse homePhone workPhone emailHint emailMungImage website address city prov postal country bringing --> | <!-- macro Reunion Munroe Green Roedy Green Geneva 1948-02-04 people/roedy200805.jpg + excuse (250) 361-9093 (250) 361-9093 roedy gee mindprod com roedy mindprod.com #101 — xxx YYYYk Street Victoria BC V8T 4G8 Canada pomegranate cider --> |
Revised | When something was last revised and when that fact was last verified. c.f. Updated | <!-- macro Revised asofDate [revisedDate] [why] --> | <!-- macro Revised 2008-07-25 2005-10-20 --> |
RFC (Request For Comment) | link to the text of a RFC document. | <!-- macro RFC RFC number --> | <!-- macro RFC 2781 --> |
RSS | generate an RSS feed item and display the item as HTML as well. | <!-- macro RSS feedName YYYY-MM-DD webroot-relative-link/url title description --> | <!-- macro RSS ethics 2008-08--03 new version of HTML Macros Realeasd {The new version makes it much easier to configure the icons…} --> |
RSSBegin | Marks the beginning of a group of RSS macros you want collected, grouped by feed and sorted in descending order by date. If you don’t use RSSBegin, the items will appear in the same order on each page that they appear embedded in your files. | <!-- macro RSSBegin (no parms) --> | <!-- macro RSSBegin --> |
RSSEnd | Marks the end of a group of RSS macros you want collected, grouped by feed and sorted in descending order by date. | <!-- macro RSSEnd (no parms) --> | <!-- macro RSSENd --> |
Signed | Generates instructions to deal with code signed with a phony certificate. Obsolete. | <!-- macro Signed mainClass (Applet/weblet) --> | <!-- macro Signed Wassup Applet/weblet --> |
Bug | Link to a bug in the Sun bug parade. | <!-- macro Bug bugNumber description --> | <!-- macro Bug 4809366 {The Bea JVM (Java Virtual Machine) fails to give permission for <span class=jmethod>getClassLoader</span> even when you ask for <span class=ini>AllPermissions</span>.} --> |
RFE (Request For Enhancement) | Link to a RFE in the Sun requests for enhancement. | <!-- macro RFE rfeNumber description --> | <!-- macro RFE 4449383 JSR (Java Specification Request) to add Design By Contract to Java --> |
Updated | displays the date some file was last substantially modified. c.f. Revised | <!-- macro Updated webRoot-relative-file-name [plain/decorated] --> | <!-- macro Updated jgloss/bali.html --> |
Video | Displays an iconic link to video file. | <!-- macro Video mediaURL format(e.g.bittorrent divx dvd flash google mp3 mp4 ms pp qt real shockwave unknown vhs transcript youtube --> | <!-- macro Video {https://www.youtube.com/watch?v=daNr_TrBw6E} youtube {Albert Stubblebine} --> |
WebRing | Displays a WebRing nav bar. | <!-- macro WebRing just a numeric u, the WebRing id --> | <!-- macro WebRing 10002305 --> |
Various Page Header Macros | |
---|---|
Macro | Purpose |
AmanuensisHead | header for Applet |
AnimalRightsHead | header for Animal rights essay |
ApplicationHead | header for Application docs |
BglossHead | header for the buyer glossary |
BibleHead | header for chapter of the bible |
Bush911Head | header for Bush essay |
BushBooksHead | header for Bush books |
BushismsHead | header for Bushisms essay |
ContactHead | header for Contact essay |
DeepThoughtsHead | header for Deep thoughts |
EnvirHead | header for environment essay |
EthicsHead | header for Ethics essay |
FeedbackAnimalsHead | header for feedback on animals |
FeedbackGodHead | header for feedback on religion |
FeedbackPeaceHead | header for feedback essay |
FeedbackPornHead | header for porn essay feedback |
FeedbackSectionHead | header for feedback section |
Head | generic header |
HomeHead | header for home page |
HumanRightsHead | header for human rights essay |
IraqHead | header for Iraq essay |
JglossHead | header for the Java glossary |
JglossLetterHead | header for the Java glossary index |
LaserHead | header for laser talks |
LivingLoveHead | header for living love essay |
MenuFrameHead | header for page that uses frames |
MethodsHead | header for Living Love methods essay |
MoneyHead | header for money essay |
PhoneHead | header for the phone list |
PoliticsHead | header for politics essay |
ReligionHead | header for religion essay |
ReunionHead | header for Reunion essay |
SectionHead | header for section |
WebStartHead | header for Java Web Start |
Various Menu-generating Macros | |
---|---|
Macro | Purpose |
AmanuensisMenuItem | menu item for an Applet |
ApplicationMenuItem | menu item for an application |
ColourMenu | a menu of colour charts |
MenuItem | menu item |
Quilt | generate an n x m list of links |
QuiltPair | generate an n x m list of cell pairs |
WebStartMenuItem | generate a description for a JWS (Java Web Start) app |
Utility classes, not macros | |
---|---|
Class | Purpose |
AudioFormat | enum of the various type of Audio format. |
BibleBook | enum of all the books of the King James bible |
BuildImage | Building <image links. Examines image files to find out the dimensions. |
Configure | Customising constants, e.g. affiliate ids, where you put various files, the name of your website, how often to rotate the ads, how long to hold onto RSS feed items… |
CountryFlag | generates flags of different countries. Used by Amazon macro. |
GoogleAdSense | enum for various sizes of ad chosen by Google to suit the page. |
HTMLMacros | Main routine. Will expand an arbitrary set of HTML files. |
Indexing | Used to generate glossary indexes. |
ImageAlignment | enum for all the ways to align an Image. |
LoadCodeToProcessMacro | dynamically load and cache class to process a macro |
Macro | The interface that all macro classes must implement. The Macro. expandMacro method is the key. |
OS | enum for the various possible operating systems. |
ParmParser | parses the parameters and cleans them up to present to the macro for expansion. |
PayPalProduct | Kludgy enum of PayPal encryptions. |
QuotationCategory | enum of various categories of quote of the day. |
Randomiser | Used by the random quotation generator and the public service ads to rotate the quotations on a predictable but seemingly random basis. Does the math to compute the digests. |
ReplaceMindprod | Main routine. Custom list of files to expand for the mindprod website. |
Replacer | The core macro engine that parser looking for macro commands and invoking the macros. |
StripGenerated | Removes previous expansions before expanding macros afresh. |
SunJDKandJREVersions | Constants to describe Oracle’s various JDKs (Java Development Kits) and JREs (Java Runtime Environments). |
Tools | General purpose tools useful to macros. |
UnitsOfMeasure | Enumeration of various metric and imperial units of measure. |
VersionFlavour | enum of the various type of JDK-JRE version number. |
VideoFormat | enum of the various type of Video format. |
Embedded in the pages and at the foot of each page are pseudo-randomly selected quotations that automatically change frequently. How this works is probably the most complicated thing in the system. The quotations are where I deliver my messages to try to change the world. I consider them the purpose of the website.
The quotations themselves live in the quote directory separated by topics I call flocks. There are defined aggregates such as general that have a defined weighting percentage of the various flocks. For example, the remembrance aggregate I use on Remembrance Day contains contributions from the flocks: war (weight 200), patriotism (10), warbyroedy (1000) and patriotismbyroedy (1). com.mindprod.support.ConfigurationForMindprod specifies which aggregate to use for each page. It also specifies how often to rotate the quotation/PSA. SET resetfooterpercentage=10 further limits just how many quotations/PSAs will be allowed to change in any given run. (This can be useful if you disturb the quotation collections which would otherwise trigger a mass immediate changeover.)
The quotation chosen depends on the current time and the file name, but not the file contents.
The same slot at the foot of a page can be shared by a quotation, a PSA (Public Service Advertisement) or a non-military use only notice. The logic to select the current ad is hairy. See com.mindprod.htmlmacros.support.InlineFooter, com.mindprod.support.PSAType and com.mindprod.support.Randomiser.
The Quotation macro com.mindprod.macro.Quotation can embed a random quotation in the middle of a page.
The quotation flock files are kept sorted by author, with quotes without headings at the top to be corrected.
Quotations can contain embeded macros, most commonly Acronym, Age, Cite and Include.
In addition there are fixed quotation that HTMLMacros leaves undisturbed as ordinary text.
HTMLMacros tracks when various files containing HTML macros were last successfully processed. It can then speed things up by avoiding reprocessing them again until the contents changes. There are various exceptions:
Package | Version | Released | Licence | Language | Notes | ||
---|---|---|---|---|---|---|---|
HTML Static Macros |
2.6 | 2014-07-13 | free | Java |
❘ precis
❘ manual
❘ screenshot
❘ browse source repository
for the current version of HTML Static Macros. Static macros for HTML to generate complex boilerplate.
17.7MB
zip for HTML Static Macros Java source, compiled class files, jar and documentation to run on your own machine as an application.
Runs on any OS that supports Java e.g. W2K, XP, W2003, Vista, W2008, W7-32, W7-64, W8-32, W8-64, W2012, W10-32, W10-64, Linux, LinuxARM, LinuxX86, LinuxX64, Ubuntu, Solaris, SolarisSPARC, SolarisSPARC64, SolarisX86, SolarisX64 and OSX. First install the most recent Java. To install, extract the zip download with WinZip, (or similar unzip utility) into any directory you please, often J:\ — ticking off the use folder names option. To check out the corresponding source from the Subversion repository, use the TortoiseSVN repo-browser to After you have installed the jar, you can run it as an application. Type: java -jar J:\com\mindprod\htmlmacros\htmlmacros.jar parms
adjusting as necessary to account for where the jar file is. download ASP PAD XML program description for the current version of HTML Static Macros. HTML Static Macros is free. Full source included. You may even include the source code, modified or unmodified in free/commercial open source/proprietary programs that you write and distribute. Non-military use only. |
||
You can control HTMLMacros by setting up set Variables before you run. Most of them trigger probing online stores to refresh our inventory of what products they have in stock.
Set Variable | Purpose |
---|---|
Miscellaneous | |
removedeadwood=no | =no
means leave deadwood, =yes means Clear inventories of products we no longer recommend. It should not be used unless have done a resetcache.btm and are processing the entire website. Also clears lookup cache of ISBN to ASIN of any ISBNs (International Standard Book Numbers) without a corresponding ASIN, but which are mentioned in Book macros. =find means find deadwood, but don’t remove it yet. |
Aggregates | |
checkstores=yes | check all book, dvd and electronics stores |
checkbookstores=yes | check all bookstores |
checkamazonbookstores=yes | check all Amazon bookstores including Junglee |
checkabebookstores=yes | check all Abe bookstores |
checkotherbookstores=yes | check all no-Amazon non-Abe bookstores |
checkdvdstores=yes | check all DVD stores |
checkamazondvdstores=yes | check all Amazon DVD stores |
checkelectronicsstores=yes | check all electronics stores |
checkamazonelectronicsstores=yes | check alls Amazon electronic stores. |
Individual Bookstores | |
checkabeca=yes | check abe.ca bookstore |
checkabecom=yes | check abe.com bookstore |
checkabede=yes | check abe.de bookstore |
checkabees=yes | check abe.es bookstore |
checkabefr=yes | check abe.fr bookstore |
checkabeit=yes | check abe.it bookstore |
checkabenz=yes | check abe.nz bookstore |
checkabeuk=yes | check abe.uk bookstore |
checkamazonca=yes | check amazon.ca bookstore |
checkamazoncn=yes | check amazon.cn bookstore |
checkamazoncom=yes | check amazon.com bookstore |
checkamazonde=yes | check amazon.de bookstore |
checkamazones=yes | check amazon.es bookstore |
checkamazonfr=yes | check amazon.fr bookstore |
checkamazonit=yes | check amazon.it bookstore |
checkamazonuk=yes | check amazon.uk bookstore |
checkbn=yes | check barnesandnoble.com bookstore |
checkchapters=yes | check chapters.indigo.com bookstore |
checkgoogle=yes | check play.google.com bookstore |
checkjunglee=yes | check junglee.com bookstore |
checkkobo=yes | check kobo.com bookstore |
checkpowells=yes | check powells.com bookstore |
checksafari=yes | check safari.com bookstore |
Individual DVD Stores | |
checkamazoncadvds=yes | check amazon.ca dvd store |
checkamazoncndvds=yes | check amazon.cn dvd store |
checkamazoncomdvds=yes | check amazon.com dvd store |
checkamazondedvds=yes | check amazon.de dvd store |
checkamazonesdvds=yes | check amazon.es dvd store |
checkamazonfrdvds=yes | check amazon.fr dvd store |
checkamazonitdvds=yes | check amazon.it dvd store |
checkamazonukdvds=yes | check amazon.uk dvd store |
checkbndvds=yes | check barensandnoble.cem dvd store |
checkjungleedvds=yes | check junlee.com dvd store |
checkpowellsdvds=yes | check powells.cem dvd store |
Individual Electronics Stores | |
checkamazoncaelectronics=yes | check amazon.ca electronics store |
checkamazoncnelectronics=yes | check amazon.cn electronics store |
checkamazoncomelectronics=yes | check amazon.com electronics store |
checkamazondeelectronics=yes | check amazon.de electronics store |
checkamazoneselectronics=yes | check amazon.es electronics store |
checkamazonfrelectronics=yes | check amazon.fr electronics store |
checkamazonitelectronics=yes | check amazon.it electronics store |
checkamazonukelectronics=yes | check amazon.uk electronics store |
checkbestbuycaelectronics=yes | check bestbuy.ca electronics store |
checkbestbuyelectronics=yes | check bestbuy.com electronics store |
checkcanadacomputerselectronics=yes | check canadacomputers.com electronics store |
checkjungleeelectronics=yes | check junglee.com electronics store |
checkncixcaelectronics=yes | check NCIX.ca electronics store |
checkneweggcaelectronics=yes | check neweggca.ca electronics store |
checkneweggelectronics=yes | check newegg.com electronics store |
checktigercaelectronics=yes | check tigerdirect.ca electronics store |
checktigerelectronics=yes | check tigerdirect.com electronics store |
checknewproducts=yes | Usually new products are probed to find out their status the first time they are encountered. If you set this to no, this is suppressed and new products are treated as not-carried. The next time you do a manual probe of its stores, the status will be updated. The main reason to use this is to turn off probing if it is temporarily not-working, giving you time to fix the problem and do a manual probe to catch up. Default yes. |
Misc | |
-q | quiet mode. supresses macro letters |
-v | verbose mode |
debug=yes | extra debug output |
This page is posted |
http://mindprod.com/application/htmlmacros.manual.html | |
Optional Replicator mirror
|
J:\mindprod\application\htmlmacros.manual.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.16.51.237] |
| |
Feedback |
You are visitor number | |