Skip to content

Commit

Permalink
0.3.8.2 (2022-02-10)
Browse files Browse the repository at this point in the history
+ Added no comments configuration for Markdown handlers
  • Loading branch information
daneeldeveloper committed Feb 10, 2022
1 parent 41b3dd1 commit 3a13e95
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 24 deletions.
4 changes: 2 additions & 2 deletions docgen/parameters.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title" : "Venus (Fugerit Document Generation Framework)",
"name": "Venus",
"version" : "0.3.8.1",
"date" : "09/02/2022",
"version" : "0.3.8.2",
"date" : "10/02/2022",
"organization" : {
"name" : "Fugerit Org",
"url" : "https://www.fugerit.org"
Expand Down
6 changes: 5 additions & 1 deletion docgen/release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
0.3.8.1 (2022-02-09)
0.3.8.2 (2022-02-10)
--------------------
+ Added no comments configuration for Markdown handlers

0.3.8.1 (2022-02-09)
--------------------
+ Added constant for type markdown (md)

Expand Down
2 changes: 1 addition & 1 deletion fj-doc-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-base</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@ public abstract class AbstractCustomMarkdownTypeHandler extends DocTypeHandlerDe

public static final String MIME = "text/x-markdown";

public AbstractCustomMarkdownTypeHandler() {
public AbstractCustomMarkdownTypeHandler( boolean printComments ) {
super(TYPE, MODULE, MIME);
this.printComments = printComments;
}

public AbstractCustomMarkdownTypeHandler() {
this( MarkdownBasicDocFacade.DEFAULT_PRINT_COMMENTS );
}

/**
*
*/
private static final long serialVersionUID = -739451608L;

private boolean printComments;

public boolean isPrintComments() {
return printComments;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,36 @@ public class MarkdownBasicDocFacade extends DocTypeFacadeDefault {

private PrintWriter writer;

private boolean printComments;

public static final boolean DEFAULT_PRINT_COMMENTS = true;

protected PrintWriter getWriter() {
return writer;
}

public MarkdownBasicDocFacade(PrintWriter writer) {
this( writer, DEFAULT_PRINT_COMMENTS );
}

public MarkdownBasicDocFacade(PrintWriter writer, boolean printComments) {
super();
this.writer = writer;
this.printComments = printComments;
}

@Override
public void handleDoc(DocBase docBase) throws Exception {
// just comment to the generated output :
this.getWriter().print( "[//]: # (generator : " );
this.getWriter().print( this.getClass().getName() );
this.getWriter().println( " )" );
this.getWriter().print( "[//]: # (generated on " );
this.getWriter().print( new Date() );
this.getWriter().println( " ) " );
this.getWriter().println();
if ( this.printComments ) {
// just comment to the generated output :
this.getWriter().print( "[//]: # (generator : " );
this.getWriter().print( this.getClass().getName() );
this.getWriter().println( " )" );
this.getWriter().print( "[//]: # (generated on " );
this.getWriter().print( new Date() );
this.getWriter().println( " ) " );
this.getWriter().println();
}
// actual document handling :we will treat only the body
DocTypeFacadeHelper helper = new DocTypeFacadeHelper( docBase );
this.handleElements( docBase.getDocBody(), helper );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public MarkdownExtDocFacade(PrintWriter writer) {
super(writer);
}

public MarkdownExtDocFacade(PrintWriter writer, boolean printComments) {
super(writer, printComments);
}

@Override
public void handleTable(DocTable docTable, DocContainer parent, DocTypeFacadeHelper helper) throws Exception {
this.getWriter().println();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,25 @@ public class SimpleMarkdownBasicTypeHandler extends AbstractCustomMarkdownTypeHa

public static final DocTypeHandler HANDLER = new SimpleMarkdownBasicTypeHandler();

public static final DocTypeHandler HANDLER_NOCOMMENTS = new SimpleMarkdownBasicTypeHandler( false );

/**
*
*/
private static final long serialVersionUID = -73945133608L;



public SimpleMarkdownBasicTypeHandler() {
super();
}



public SimpleMarkdownBasicTypeHandler(boolean printComments) {
super(printComments);
}

@Override
public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
PrintWriter writer = new PrintWriter( new OutputStreamWriter( docOutput.getOs() ) );
Expand All @@ -36,7 +50,7 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
* the DocBase model in the desired output (DocPara, DocTable, DocList etc).
* Here we created a facade to do so :
*/
MarkdownBasicDocFacade facade = new MarkdownBasicDocFacade( writer );
MarkdownBasicDocFacade facade = new MarkdownBasicDocFacade( writer, this.isPrintComments() );
facade.handleDoc( docBase );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ public class SimpleMarkdownExtTypeHandler extends AbstractCustomMarkdownTypeHand

public static final DocTypeHandler HANDLER = new SimpleMarkdownExtTypeHandler();

public static final DocTypeHandler HANDLER_NOCOMMENTS = new SimpleMarkdownExtTypeHandler( false );

/**
*
*/
private static final long serialVersionUID = -7394541608L;

public SimpleMarkdownExtTypeHandler() {
super();
}

public SimpleMarkdownExtTypeHandler(boolean printComments) {
super(printComments);
// TODO Auto-generated constructor stub
}

@Override
public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
PrintWriter writer = new PrintWriter( new OutputStreamWriter( docOutput.getOs() ) );
Expand All @@ -36,7 +47,7 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
* the DocBase model in the desired output (DocPara, DocTable, DocList etc).
* Here we created a facade to do so :
*/
MarkdownExtDocFacade facade = new MarkdownExtDocFacade( writer );
MarkdownExtDocFacade facade = new MarkdownExtDocFacade( writer, this.isPrintComments() );
facade.handleDoc( docBase );
}

Expand Down
2 changes: 1 addition & 1 deletion fj-doc-ent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-ent</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-freemarker</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-mod-fop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-mod-fop</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-mod-itext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-mod-itext</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-mod-jxl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-mod-jxl</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-mod-pdfbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-mod-pdfbox</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-mod-poi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-mod-poi</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-doc-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.8.1</version>
<version>0.3.8.2</version>
</parent>

<name>fj-doc-sample</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>

<version>0.3.8.1</version>
<version>0.3.8.2</version>
<packaging>pom</packaging>

<name>fj-doc</name>
Expand Down

0 comments on commit 3a13e95

Please sign in to comment.