From e26a4e2a5ea5d720af2c5c7df66b1bb779f44285 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 18 Jan 2025 01:51:53 +0100 Subject: [PATCH] Added muffin table on first few pages of cake slices --- .../cake2/fcdoc/FCDocPageWriterBaklava.java | 3 +- .../cake2/fcdoc/FCDocPageWriterCakeTower.java | 7 +- .../cake2/fcdoc/FCDocPageWriterMuffin.java | 71 +--------- ...ageWriter.java => FCDocSegmentWriter.java} | 70 +++++++++- ...rCake.java => FCDocSegmentWriterCake.java} | 2 +- .../fcdoc/FCDocSegmentWriterCakeSlice.java | 129 ++++++++++++++++++ ...d.java => FCDocSegmentWriterCakeWord.java} | 2 +- .../org/x4o/fc18/cake2/fcdoc/FCDocWriter.java | 18 +-- 8 files changed, 217 insertions(+), 85 deletions(-) rename nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/{FCDocPageWriter.java => FCDocSegmentWriter.java} (61%) rename nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/{FCDocWriterCake.java => FCDocSegmentWriterCake.java} (97%) create mode 100644 nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java rename nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/{FCDocWriterCakeWord.java => FCDocSegmentWriterCakeWord.java} (97%) diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterBaklava.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterBaklava.java index a758427..8fde392 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterBaklava.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterBaklava.java @@ -42,6 +42,7 @@ import org.x4o.o2o.io.sax3.ContentCloseable; import org.x4o.o2o.tdoc.ApiDocContentCss; import org.x4o.o2o.tdoc.ApiDocContentWriter; import org.x4o.o2o.tdoc.dom.ApiDocPage; +import org.x4o.o2o.tdoc.dom.ApiDocPageWriter; import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; /** @@ -50,7 +51,7 @@ import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; * @author Willem Cazander * @version 1.0 Jan 17, 2025 */ -public class FCDocPageWriterBaklava implements FCDocPageWriter { +public class FCDocPageWriterBaklava implements ApiDocPageWriter, FCDocSegmentWriter { public static ApiDocPage createDocPage() { return new ApiDocPage("overview-baklave","Baklava","Overview of all 6 bit baklava NCR1632 fractions.",new FCDocPageWriterBaklava()); diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterCakeTower.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterCakeTower.java index b38c4c9..f5dc72c 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterCakeTower.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterCakeTower.java @@ -30,6 +30,7 @@ import org.x4o.o2o.io.sax3.ContentCloseable; import org.x4o.o2o.tdoc.ApiDocContentCss; import org.x4o.o2o.tdoc.ApiDocContentWriter; import org.x4o.o2o.tdoc.dom.ApiDocPage; +import org.x4o.o2o.tdoc.dom.ApiDocPageWriter; import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; /** @@ -38,7 +39,7 @@ import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; * @author Willem Cazander * @version 1.0 Jan 17, 2025 */ -public class FCDocPageWriterCakeTower implements FCDocPageWriter { +public class FCDocPageWriterCakeTower implements ApiDocPageWriter, FCDocSegmentWriter { public static ApiDocPage createDocPage() { return new ApiDocPage("overview-tower","Tower","Overview of the cake tower.",new FCDocPageWriterCakeTower()); @@ -77,10 +78,10 @@ public class FCDocPageWriterCakeTower implements FCDocPageWriter { try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colOne)) { writer.printCharacters(String.format("0x%06X", slice.getStart())); } - try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colOne)) { + try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) { writer.printCharacters(String.format("0x%06X", slice.getStop())); } - try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colOne)) { + try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) { writer.printCharacters(String.format("%d", slice.getLength())); } } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterMuffin.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterMuffin.java index 60ad070..9822821 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterMuffin.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriterMuffin.java @@ -23,9 +23,7 @@ package org.x4o.fc18.cake2.fcdoc; import java.io.IOException; -import java.util.ArrayList; import java.util.List; -import java.util.function.Function; import org.x4o.fc18.FourCornerUnicodeDisplay; import org.x4o.fc18.cake2.FourCornerDotCake; @@ -35,13 +33,12 @@ import org.x4o.fc18.cake2.zero33.FCDotAPL0127DashP7C; import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7D; import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7E; import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7F; -import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; -import org.x4o.fc18.cake2.zero33.FCDotDEC0127DashPX0; import org.x4o.o2o.io.ContentWriterHtml.Tag; import org.x4o.o2o.io.sax3.ContentCloseable; import org.x4o.o2o.tdoc.ApiDocContentCss; import org.x4o.o2o.tdoc.ApiDocContentWriter; import org.x4o.o2o.tdoc.dom.ApiDocPage; +import org.x4o.o2o.tdoc.dom.ApiDocPageWriter; import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; /** @@ -50,7 +47,7 @@ import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; * @author Willem Cazander * @version 1.0 Jan 17, 2025 */ -public class FCDocPageWriterMuffin implements FCDocPageWriter { +public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWriter { public static ApiDocPage createDocPage() { return new ApiDocPage("overview-muffin","Muffins","Overview of all muffin symbols.",new FCDocPageWriterMuffin()); @@ -190,68 +187,4 @@ public class FCDocPageWriterMuffin implements FCDocPageWriter { } } } - - private void writeP7x(ApiDocContentWriter writer, FourCornerDotCake slice, Function conv) throws IOException { - String prefixHex = String.format("0x%06X", slice.getStart()); - try (ContentCloseable tableRow = writer.docTableRow()) { - writer.printTagStart(Tag.td, ApiDocContentCss.colFirst); - writer.printCharacters(prefixHex); - writer.printTagEnd(Tag.td); - writer.printTagStart(Tag.td, ApiDocContentCss.colOne); - writer.printCharacters(slice.nameSpec()); - writer.printTagEnd(Tag.td); - for (int i = 0; i < 27; i++) { - int codePoint = conv.apply(i); - if (i + 1 < 27) { - writer.printTagStart(Tag.td); - } else { - writer.printTagStart(Tag.td, ApiDocContentCss.colLast); - } - StringBuilder buf = new StringBuilder(); - if (codePoint == '\u0000') { - buf.append("␀"); - } else { - buf.appendCodePoint(codePoint); - } - writer.printCharacters(buf.toString()); - writer.printTagEnd(Tag.td); - } - } - } - - private void writeCDC(ApiDocContentWriter writer, int off) throws IOException { - String prefixHex = String.format("0x%05X0", off >> 4); - try (ContentCloseable tableRow = writer.docTableRow()) { - writer.printTagStart(Tag.td, ApiDocContentCss.colOne); - writer.printCharacters(prefixHex); - writer.printTagEnd(Tag.td); - for (int i = off; i < 16 + off; i++) { - FCDotCDC1604DashP6 cdc = FCDotCDC1604DashP6.valueOf(i); - int codePoint = cdc.codePoints()[0]; - if (i + 1 < 16 + off) { - writer.printTagStart(Tag.td); - } else { - writer.printTagStart(Tag.td, ApiDocContentCss.colLast); - } - StringBuilder buf = new StringBuilder(); - if (codePoint == '\u0000') { - buf.append("␀"); - } else if (codePoint == '\u0001') { - buf.append("␁"); - } else if (codePoint == '\u0002') { - buf.append("␂"); - } else if (codePoint == '\u0003') { - buf.append("␃"); - } else if (codePoint == ' ') { - buf.append("␠"); - } else if (codePoint == '\n') { - buf.append("␊"); - } else { - buf.appendCodePoint(codePoint); - } - writer.printCharacters(buf.toString()); - writer.printTagEnd(Tag.td); - } - } - } } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriter.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriter.java similarity index 61% rename from nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriter.java rename to nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriter.java index 6531122..6d1aaea 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocPageWriter.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriter.java @@ -23,12 +23,14 @@ package org.x4o.fc18.cake2.fcdoc; import java.io.IOException; +import java.util.function.Function; +import org.x4o.fc18.cake2.FourCornerDotCake; +import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; import org.x4o.o2o.io.ContentWriterHtml.Tag; import org.x4o.o2o.io.sax3.ContentCloseable; import org.x4o.o2o.tdoc.ApiDocContentCss; import org.x4o.o2o.tdoc.ApiDocContentWriter; -import org.x4o.o2o.tdoc.dom.ApiDocPageWriter; import org.xml.sax.helpers.AttributesImpl; /** @@ -37,7 +39,71 @@ import org.xml.sax.helpers.AttributesImpl; * @author Willem Cazander * @version 1.0 Jan 18, 2025 */ -public interface FCDocPageWriter extends ApiDocPageWriter { +public interface FCDocSegmentWriter { + + default void writeP7x(ApiDocContentWriter writer, FourCornerDotCake slice, Function conv) throws IOException { + String prefixHex = String.format("0x%06X", slice.getStart()); + try (ContentCloseable tableRow = writer.docTableRow()) { + writer.printTagStart(Tag.td, ApiDocContentCss.colFirst); + writer.printCharacters(prefixHex); + writer.printTagEnd(Tag.td); + writer.printTagStart(Tag.td, ApiDocContentCss.colOne); + writer.printCharacters(slice.nameSpec()); + writer.printTagEnd(Tag.td); + for (int i = 0; i < 27; i++) { + int codePoint = conv.apply(i); + if (i + 1 < 27) { + writer.printTagStart(Tag.td); + } else { + writer.printTagStart(Tag.td, ApiDocContentCss.colLast); + } + StringBuilder buf = new StringBuilder(); + if (codePoint == '\u0000') { + buf.append("␀"); + } else { + buf.appendCodePoint(codePoint); + } + writer.printCharacters(buf.toString()); + writer.printTagEnd(Tag.td); + } + } + } + + default void writeCDC(ApiDocContentWriter writer, int off) throws IOException { + String prefixHex = String.format("0x%05X0", off >> 4); + try (ContentCloseable tableRow = writer.docTableRow()) { + writer.printTagStart(Tag.td, ApiDocContentCss.colOne); + writer.printCharacters(prefixHex); + writer.printTagEnd(Tag.td); + for (int i = off; i < 16 + off; i++) { + FCDotCDC1604DashP6 cdc = FCDotCDC1604DashP6.valueOf(i); + int codePoint = cdc.codePoints()[0]; + if (i + 1 < 16 + off) { + writer.printTagStart(Tag.td); + } else { + writer.printTagStart(Tag.td, ApiDocContentCss.colLast); + } + StringBuilder buf = new StringBuilder(); + if (codePoint == '\u0000') { + buf.append("␀"); + } else if (codePoint == '\u0001') { + buf.append("␁"); + } else if (codePoint == '\u0002') { + buf.append("␂"); + } else if (codePoint == '\u0003') { + buf.append("␃"); + } else if (codePoint == ' ') { + buf.append("␠"); + } else if (codePoint == '\n') { + buf.append("␊"); + } else { + buf.appendCodePoint(codePoint); + } + writer.printCharacters(buf.toString()); + writer.printTagEnd(Tag.td); + } + } + } default void writeTableBoxHeader(ApiDocContentWriter writer, String[] headers) throws IOException { try (ContentCloseable td = writer.printTag(Tag.tr)) { diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCake.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java similarity index 97% rename from nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCake.java rename to nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java index d7d40f8..8f6443e 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCake.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java @@ -39,7 +39,7 @@ import org.xml.sax.SAXException; * @author Willem Cazander * @version 1.0 Jan 17, 2025 */ -public class FCDocWriterCake { +public class FCDocSegmentWriterCake implements FCDocSegmentWriter { private final String[] FC_FEATURES = new String[] { "VT-06 terminal control for CDC1604(1960) 6 bit main frames", diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java new file mode 100644 index 0000000..509eeb9 --- /dev/null +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2004-2014, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.x4o.fc18.cake2.fcdoc; + +import java.io.IOException; +import java.util.List; +import java.util.function.Function; + +import org.x4o.fc18.cake2.FourCornerDotCake; +import org.x4o.fc18.cake2.zero33.FCDotAPL0127DashP7A; +import org.x4o.fc18.cake2.zero33.FCDotAPL0127DashP7B; +import org.x4o.fc18.cake2.zero33.FCDotAPL0127DashP7C; +import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7D; +import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7E; +import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7F; +import org.x4o.o2o.io.sax3.ContentCloseable; +import org.x4o.o2o.tdoc.ApiDocContentCss; +import org.x4o.o2o.tdoc.ApiDocContentWriter; +import org.x4o.o2o.tdoc.ApiDocNodeWriterMethod; +import org.x4o.o2o.tdoc.dom.ApiDocConcept; +import org.x4o.o2o.tdoc.dom.ApiDocNode; +import org.x4o.o2o.tdoc.dom.ApiDocNodeBody; +import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; +import org.xml.sax.SAXException; + +/** + * Cake doc segment slice writer. + * + * @author Willem Cazander + * @version 1.0 Jan 17, 2025 + */ +public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter { + + @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=20) + public void writeDefaultSummary(ApiDocWriteEvent event) throws SAXException, IOException { + // NOTE: copyed from defaultWriteSummary as that only called with zero summaries + ApiDocContentWriter writer = event.getWriter(); + ApiDocNode parent = event.getEventObject(); + ApiDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass()); + List nodes = parent.getNodes(); + if (nodes.isEmpty()) { + return; + } + String name = concept.getName()+" Summary"; + writer.docTableStart(name, "All childeren in "+name,ApiDocContentCss.overviewSummary); + writer.docTableHeader("Name", "Description"); + for (ApiDocNode child : nodes) { + String link = ApiDocContentWriter.toSafeUri(child.getId())+"/index.html"; + if (parent.getParent()==null) { + link = ApiDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node + } + writer.docTableRowLink(link,child.getName(),child.getDescription()); + } + writer.docTableEnd(); + } + + @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=10) + public void writeSchemaViewSummary(ApiDocWriteEvent event) throws SAXException, IOException { + ApiDocContentWriter writer = event.getWriter(); + FourCornerDotCake slice = (FourCornerDotCake)event.getEventObject().getUserData(); + if (slice.getStart() >= FourCornerDotCake.__MIND_THE_GAP8.getStart()) { + return; + } + if (FourCornerDotCake.FC_DEC0127_PX0.equals(slice)) { + return; + } + if (FourCornerDotCake.FC_APL0127_P7A.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotAPL0127DashP7A.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_APL0127_P7B.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotAPL0127DashP7B.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_APL0127_P7C.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotAPL0127DashP7C.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_BYD0127_P7D.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotBYD0127DashP7D.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_BYD0127_P7E.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotBYD0127DashP7E.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_BYD0127_P7F.equals(slice)) { + writeP7xSlice(writer, slice, v -> FCDotBYD0127DashP7F.valueOf(v).codePoints()[0]); + return; + } + if (FourCornerDotCake.FC_CDC1604_P6.equals(slice)) { + try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_CDC1604_P6.nameSpec(), null, ApiDocContentCss.overviewSummary)) { + writeTableBoxHeaderNumeric(writer, 17); + writeCDC(writer, 0x00); + writeCDC(writer, 0x10); + writeCDC(writer, 0x20); + writeCDC(writer, 0x30); + } + return; + } + } + + private void writeP7xSlice(ApiDocContentWriter writer, FourCornerDotCake slice, Function conv) throws IOException { + try (ContentCloseable table = writer.docTable(slice.nameSpec(), null, ApiDocContentCss.overviewSummary)) { + writeTableBoxHeaderNumeric(writer, 28, true); + writeP7x(writer, slice, conv); + } + } +} diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCakeWord.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java similarity index 97% rename from nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCakeWord.java rename to nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java index 754d86c..9776034 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriterCakeWord.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java @@ -39,7 +39,7 @@ import org.xml.sax.SAXException; * @author Willem Cazander * @version 1.0 Jan 17, 2025 */ -public class FCDocWriterCakeWord { +public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class}) public void writeSchemaViewSummary(ApiDocWriteEvent event) throws SAXException, IOException { diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriter.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriter.java index 510714b..be4c450 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriter.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocWriter.java @@ -114,10 +114,10 @@ public class FCDocWriter { ApiDoc doc = new ApiDoc(); doc.setName("FourCorner"); doc.setDescription("FourCorner 18 bit text encoding format."); - doc.setDocAbout("FourCorner Indexes\nThe World Of Words."); - doc.createDocCopyright(System.getProperty("user.name"), "תשפ״ה"); // use hebrew quotation mark, the interweb uses latin which break unicode rendering + doc.setDocAbout("FourCorner Indexes\nThe World Of Words™"); + doc.createDocCopyright("𑀳𑁂𑀮𑀺𑀉𑁄𑀤𑁄𑀭𑁂𑀡𑀪𑀸𑀕", "תשפ״ה"); // use hebrew quotation mark, the interweb uses latin which break unicode rendering doc.setDocPageSubTitle("FC18-Alpha1"); - doc.addMetaKeywordAll(List.of("FC18", "documentation", "four-corner", "china", "MSX")); + doc.addMetaKeywordAll(List.of("FC18", "documentation", "four-corner", "china", "MSX4")); doc.setNoFrameAllName("All cake slices"); doc.setFrameNavOverviewPrintParent(true); doc.setFrameNavPrintParent(true); @@ -131,8 +131,9 @@ public class FCDocWriter { doc.addTreeNodePageModeClass(TDocCake.class); doc.addTreeNodePageModeClass(FourCornerDotCake.class); - doc.addAnnotatedClasses(FCDocWriterCake.class); - doc.addAnnotatedClasses(FCDocWriterCakeWord.class); + doc.addAnnotatedClasses(FCDocSegmentWriterCake.class); + doc.addAnnotatedClasses(FCDocSegmentWriterCakeWord.class); + doc.addAnnotatedClasses(FCDocSegmentWriterCakeSlice.class); ApiDocConcept adc1 = doc.addConcept(new ApiDocConcept(null,C_FC_ROOT,TDocCake.class)); ApiDocConcept adc2 = doc.addConcept(new ApiDocConcept(adc1,C_FC_SLICE,FourCornerDotCake.class)); @@ -172,13 +173,14 @@ public class FCDocWriter { } return doc; } - + private ApiDocNode createNodeCakeSlice(FourCornerDotCake dotCake) { - return new ApiDocNode(dotCake,dotCake.name(),dotCake.nameSpec(),dotCake.description()); + return new ApiDocNode(dotCake, dotCake.name(), dotCake.nameSpec(), dotCake.description()); } + private ApiDocNode createNodeCakeWord(FourCornerDotCake dotCake, int offset) { int cakePoint = dotCake.getStart() + offset; String name = String.format("%s.0x%06X", dotCake.name(), cakePoint); - return new ApiDocNode(new TDocCakeWord(dotCake, offset),name,name,name); + return new ApiDocNode(new TDocCakeWord(dotCake, offset), name, name, name); } }