/*
* [FFRF.java]
*
* Summary: Generate a reference to FFRF "tweetable" atheist quote banner.
*
* Copyright: (c) 2012-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 2012-06-28 initial version
*/
package com.mindprod.htmlmacros.macro;
import com.mindprod.htmlmacros.support.Tools;
import static java.lang.System.*;
/**
* Generate a reference to FFRF "tweetable" atheist quote banner.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2012-06-28 initial version.
* @since 2012-06-28
*/
public final class FFRF extends Macro
{
/**
* how to use the macro
*/
private static final String USAGE = "\nFFRF macro needs imageNumber";
/**
* typical use:
*
* @param parms RFC# as a string
* @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( "F" );
}
if ( parms.length != 1 )
{
throw new IllegalArgumentException( USAGE );
}
try
{
final int imageNumber = Integer.parseInt( parms[ 0 ] );
// generate
//
return Tools.completeLink( "https://ffrf.org/out/vbillboard/?billboard/" + imageNumber,
"",
"org"
/* link style */,
fileBeingDistributed
) + "
\n";
}
catch ( NumberFormatException e )
{
throw new IllegalArgumentException( USAGE );
}
}
}