diff --git a/src/main/java/com/github/jlangch/venice/impl/docgen/cheatsheet/DocGenerator.java b/src/main/java/com/github/jlangch/venice/impl/docgen/cheatsheet/DocGenerator.java index 7df6cdd68..29f475a9a 100644 --- a/src/main/java/com/github/jlangch/venice/impl/docgen/cheatsheet/DocGenerator.java +++ b/src/main/java/com/github/jlangch/venice/impl/docgen/cheatsheet/DocGenerator.java @@ -112,6 +112,7 @@ import com.github.jlangch.venice.impl.util.io.IOStreamUtil; import com.github.jlangch.venice.impl.util.markdown.Markdown; import com.github.jlangch.venice.impl.util.markdown.renderer.html.HtmlRenderer; +import com.github.jlangch.venice.impl.util.markdown.renderer.text.TextRenderer; import com.github.jlangch.venice.javainterop.AcceptAllInterceptor; import com.lowagie.text.pdf.PdfReader; @@ -375,21 +376,25 @@ private List getMarkdownTopics() { topics.add(new MarkdownDoc( "Recursion", + new TextRenderer().softWrap(120).render(loadVeniceDocMarkdown("recursion-doc.md")), new HtmlRenderer().render(loadVeniceDocMarkdown("recursion-doc.md")), "concepts.recursion")); topics.add(new MarkdownDoc( "Destructuring", + new TextRenderer().softWrap(120).render(loadVeniceDocMarkdown("destructuring-doc.md")), new HtmlRenderer().render(loadVeniceDocMarkdown("destructuring-doc.md")), "concepts.destructuring")); topics.add(new MarkdownDoc( "VeniceDoc", + new TextRenderer().softWrap(120).render(loadVeniceDocMarkdown("venice-doc.md")), new HtmlRenderer().render(loadVeniceDocMarkdown("venice-doc.md")), "venicedoc")); topics.add(new MarkdownDoc( "Markdown", + new TextRenderer().softWrap(120).render(loadVeniceDocMarkdown("markdown-doc.md")), new HtmlRenderer().render(loadVeniceDocMarkdown("markdown-doc.md")), "markdown")); diff --git a/src/main/java/com/github/jlangch/venice/impl/docgen/util/MarkdownDoc.java b/src/main/java/com/github/jlangch/venice/impl/docgen/util/MarkdownDoc.java index 8269ac3ca..522222dd4 100644 --- a/src/main/java/com/github/jlangch/venice/impl/docgen/util/MarkdownDoc.java +++ b/src/main/java/com/github/jlangch/venice/impl/docgen/util/MarkdownDoc.java @@ -26,11 +26,13 @@ public class MarkdownDoc { public MarkdownDoc( final String title, - final String docMarkdown, + final String docMarkdownTextStyled, + final String docMarkdownXmlStyled, final String id ) { this.title = title; - this.docMarkdown = docMarkdown; + this.docMarkdownTextStyled = docMarkdownTextStyled; + this.docMarkdownXmlStyled = docMarkdownXmlStyled; this.id = id; } @@ -39,8 +41,12 @@ public String getTitle() { return title; } - public String getDocMarkdown() { - return docMarkdown; + public String getDocMarkdownTextStyled() { + return docMarkdownTextStyled; + } + + public String getDocMarkdownXmlStyled() { + return docMarkdownXmlStyled; } public String getId() { @@ -75,6 +81,7 @@ public boolean equals(Object obj) { private final String title; - private final String docMarkdown; + private final String docMarkdownTextStyled; + private final String docMarkdownXmlStyled; private final String id; } diff --git a/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.ascii b/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.ascii index b18797a42..076a0e4d1 100644 --- a/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.ascii +++ b/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.ascii @@ -136,42 +136,51 @@ ${ ) }$ -5. Function Details +5. Topics +-------------------------------------------------------------------------------- + +${ (doseq [it topics] }$ +${= (:title it) }$ + +${= (:docMarkdownTextStyled it) }$ + + +${ ) }$ + + + + +6. Function Details -------------------------------------------------------------------------------- - ${ (doseq [it details] }$ ${ (when (:id it) }$ Function name: ${= (:name it) }$ -Argument list: ${ (when (not-empty? (:signatures it)) }$ +Argument list: ${ (doseq [sig (:signatures it)] }$ -${= sig }$ - ${ ) }$ + ${= sig }$ ${ ) }$ ${ ) }$ -Description: - ${ (when (not-empty? (:description it)) }$ -${= (:description it) }$ - ${ ) }$ - + +Description: ${ (when (not-empty? (:description it)) }$ +${= (:description it) }$ ${ ) }$ ${ (when (not-empty? (:descriptionTextStyled it)) }$ -${= (:descriptionTextStyled it) }$ - ${ ) }$ +${= (:descriptionTextStyled it) }$ ${ ) }$ + -Examples: ${ (when (not-empty? (:examples it)) }$ +Examples: ${ (doseq [code (:examples it)] }$ ${= code }$ - ${ ) }$ - ${ ) }$ + ${ ) }$ ${ ) }$ ${ (when (not-empty? (:crossRefs it)) }$ See also: ${ (doseq [{:keys [name]} (:crossRefs it)] }$ - ${= name }$${ ) }$ + ${= name }$ ${ ) }$ ${ ) }$ ${ ) }$ ${ ) }$ diff --git a/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.html b/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.html index 8c4e1e468..5f0ba06a6 100644 --- a/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.html +++ b/src/main/resources/com/github/jlangch/venice/docgen/cheatsheet2.html @@ -724,7 +724,7 @@

${= (kira/escape-xml (:title it)) }$

- ${= (:docMarkdown it) }$ + ${= (:docMarkdownXmlStyled it) }$