/* * [CarolFoot.java] * * Summary: Generate the footer for a Christmas carol, stripped down from usual footer. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2009-11-28 initial version. */ package com.mindprod.htmlmacros.macro; import com.mindprod.fastcat.FastCat; import static com.mindprod.htmlmacros.macro.Global.configuration; import static java.lang.System.*; /** * Generate the footer for a Christmas carol, stripped down from usual footer. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2009-11-28 initial version. * @since 2009 */ public final class CarolFoot extends Macro { /** * how to use the macro */ private static final String USAGE = "\nCarolFoot macro takes no parms"; /** * build markup to display visitor number * * @return html to display visitor count */ private static String buildVisitor() { // old Perl style that did not work // return "You are visitor number\n" // + "."; return "\n" + "You are visitor number
\n" // generate count as image + "\n" + "\n"; } /** * guts to Generate the footer for a Christmas carol document. * * @return expanded footer */ private static String expand() { final FastCat sb = new FastCat( 4 ); sb.append( "\n" ); sb.append( configuration.getHr() ); sb.append( buildVisitor() ); sb.append( "\n\n" ); return sb.toString(); } /** * Generate the footer for an amanuensis html document. * * @param parms not used. * @param quiet true if want output suppressed. * @param verbose @return expanded macro HTML */ public String expandMacro( String[] parms, final boolean quiet, final boolean verbose ) { if ( !quiet ) { out.print( "C" ); } if ( parms.length != 0 ) { throw new IllegalArgumentException( USAGE ); } return expand(); } }