/* * [CoChapter.java] * * Summary: Produce the header for a Cherokee Obama Chapter. * * Copyright: (c) 2010-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 2010-01-23 initial version, cloned from Living Love Head.. */ package com.mindprod.htmlmacros.macro; import com.mindprod.common18.EIO; import com.mindprod.common18.ST; import com.mindprod.fastcat.FastCat; import com.mindprod.htmlmacros.support.ConfigurationForCherokeeObama; import com.mindprod.htmlmacros.support.GoogleAdSense; import com.mindprod.htmlmacros.support.Indexing; import static com.mindprod.entities.DeEntifyStrings.stripHTMLTags; import static com.mindprod.htmlmacros.macro.Global.configuration; import static java.lang.System.*; /** * Produce the header for a Cherokee Obama Chapter. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2010-01-23 initial version, cloned from Living Love Head. * @since 2010-01-23 */ public final class CoChapter extends Head { // declarations private static final String SYNOPSIS = ConfigurationForCherokeeObama.getSynopsis(); /** * how to use the macro */ private static final String USAGE = "\nCoChapter macro needs {chapter#} {chapterName} [keywords]"; // /declarations // methods /** * build a simplified header used by kindle * * @param description long description, (might contain entities and tags). not null. for head meta Description. * @param chapterNumber chapter number * @param chapterName title for chapter * @param keywords indexing keywords. * @param icon16 for title bar * * @return HTML for header and simplified title. */ private String buildKindleHead( final int chapterNumber, final String chapterName, final String keywords, final String description, final String icon16 ) { final String title = "Chapter " + chapterNumber + " : " + chapterName; final int firstCopyrightYear = configuration.getFirstCopyrightYear( fileBeingDistributed ); final String copyrightHolderForPage = configuration.getCopyrightHolderForPage( fileBeingDistributed ); final FastCat sb = new FastCat( 8 ); // header sb.append( configuration.getDoctypeDefault( fileBeingDistributed ) ); sb.append( buildInvisHead( title, chapterNumber + " : " + chapterName, stripHTMLTags( description ), keywords, icon16, firstCopyrightYear, copyrightHolderForPage ) ); // append body, TOP anchor, CONFIG sb.append( "