Skip to content

Commit 3a13e95

Browse files
0.3.8.2 (2022-02-10)
+ Added no comments configuration for Markdown handlers
1 parent 41b3dd1 commit 3a13e95

File tree

17 files changed

+79
-24
lines changed

17 files changed

+79
-24
lines changed

docgen/parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"title" : "Venus (Fugerit Document Generation Framework)",
33
"name": "Venus",
4-
"version" : "0.3.8.1",
5-
"date" : "09/02/2022",
4+
"version" : "0.3.8.2",
5+
"date" : "10/02/2022",
66
"organization" : {
77
"name" : "Fugerit Org",
88
"url" : "https://www.fugerit.org"

docgen/release-notes.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
0.3.8.1 (2022-02-09)
1+
0.3.8.2 (2022-02-10)
2+
--------------------
3+
+ Added no comments configuration for Markdown handlers
4+
5+
0.3.8.1 (2022-02-09)
26
--------------------
37
+ Added constant for type markdown (md)
48

fj-doc-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-doc</artifactId>
10-
<version>0.3.8.1</version>
10+
<version>0.3.8.2</version>
1111
</parent>
1212

1313
<name>fj-doc-base</name>

fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehandler/markdown/AbstractCustomMarkdownTypeHandler.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,24 @@ public abstract class AbstractCustomMarkdownTypeHandler extends DocTypeHandlerDe
1111

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

14-
public AbstractCustomMarkdownTypeHandler() {
14+
public AbstractCustomMarkdownTypeHandler( boolean printComments ) {
1515
super(TYPE, MODULE, MIME);
16+
this.printComments = printComments;
17+
}
18+
19+
public AbstractCustomMarkdownTypeHandler() {
20+
this( MarkdownBasicDocFacade.DEFAULT_PRINT_COMMENTS );
1621
}
1722

1823
/**
1924
*
2025
*/
2126
private static final long serialVersionUID = -739451608L;
2227

28+
private boolean printComments;
29+
30+
public boolean isPrintComments() {
31+
return printComments;
32+
}
33+
2334
}

fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehandler/markdown/MarkdownBasicDocFacade.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,36 @@ public class MarkdownBasicDocFacade extends DocTypeFacadeDefault {
4141

4242
private PrintWriter writer;
4343

44+
private boolean printComments;
45+
46+
public static final boolean DEFAULT_PRINT_COMMENTS = true;
47+
4448
protected PrintWriter getWriter() {
4549
return writer;
4650
}
4751

4852
public MarkdownBasicDocFacade(PrintWriter writer) {
53+
this( writer, DEFAULT_PRINT_COMMENTS );
54+
}
55+
56+
public MarkdownBasicDocFacade(PrintWriter writer, boolean printComments) {
4957
super();
5058
this.writer = writer;
59+
this.printComments = printComments;
5160
}
5261

5362
@Override
5463
public void handleDoc(DocBase docBase) throws Exception {
55-
// just comment to the generated output :
56-
this.getWriter().print( "[//]: # (generator : " );
57-
this.getWriter().print( this.getClass().getName() );
58-
this.getWriter().println( " )" );
59-
this.getWriter().print( "[//]: # (generated on " );
60-
this.getWriter().print( new Date() );
61-
this.getWriter().println( " ) " );
62-
this.getWriter().println();
64+
if ( this.printComments ) {
65+
// just comment to the generated output :
66+
this.getWriter().print( "[//]: # (generator : " );
67+
this.getWriter().print( this.getClass().getName() );
68+
this.getWriter().println( " )" );
69+
this.getWriter().print( "[//]: # (generated on " );
70+
this.getWriter().print( new Date() );
71+
this.getWriter().println( " ) " );
72+
this.getWriter().println();
73+
}
6374
// actual document handling :we will treat only the body
6475
DocTypeFacadeHelper helper = new DocTypeFacadeHelper( docBase );
6576
this.handleElements( docBase.getDocBody(), helper );

fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehandler/markdown/MarkdownExtDocFacade.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public MarkdownExtDocFacade(PrintWriter writer) {
3333
super(writer);
3434
}
3535

36+
public MarkdownExtDocFacade(PrintWriter writer, boolean printComments) {
37+
super(writer, printComments);
38+
}
39+
3640
@Override
3741
public void handleTable(DocTable docTable, DocContainer parent, DocTypeFacadeHelper helper) throws Exception {
3842
this.getWriter().println();

fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehandler/markdown/SimpleMarkdownBasicTypeHandler.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,25 @@ public class SimpleMarkdownBasicTypeHandler extends AbstractCustomMarkdownTypeHa
2222

2323
public static final DocTypeHandler HANDLER = new SimpleMarkdownBasicTypeHandler();
2424

25+
public static final DocTypeHandler HANDLER_NOCOMMENTS = new SimpleMarkdownBasicTypeHandler( false );
26+
2527
/**
2628
*
2729
*/
2830
private static final long serialVersionUID = -73945133608L;
2931

32+
33+
34+
public SimpleMarkdownBasicTypeHandler() {
35+
super();
36+
}
37+
38+
39+
40+
public SimpleMarkdownBasicTypeHandler(boolean printComments) {
41+
super(printComments);
42+
}
43+
3044
@Override
3145
public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
3246
PrintWriter writer = new PrintWriter( new OutputStreamWriter( docOutput.getOs() ) );
@@ -36,7 +50,7 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
3650
* the DocBase model in the desired output (DocPara, DocTable, DocList etc).
3751
* Here we created a facade to do so :
3852
*/
39-
MarkdownBasicDocFacade facade = new MarkdownBasicDocFacade( writer );
53+
MarkdownBasicDocFacade facade = new MarkdownBasicDocFacade( writer, this.isPrintComments() );
4054
facade.handleDoc( docBase );
4155
}
4256

fj-doc-base/src/main/java/org/fugerit/java/doc/base/typehandler/markdown/SimpleMarkdownExtTypeHandler.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,22 @@ public class SimpleMarkdownExtTypeHandler extends AbstractCustomMarkdownTypeHand
2222

2323
public static final DocTypeHandler HANDLER = new SimpleMarkdownExtTypeHandler();
2424

25+
public static final DocTypeHandler HANDLER_NOCOMMENTS = new SimpleMarkdownExtTypeHandler( false );
26+
2527
/**
2628
*
2729
*/
2830
private static final long serialVersionUID = -7394541608L;
2931

32+
public SimpleMarkdownExtTypeHandler() {
33+
super();
34+
}
35+
36+
public SimpleMarkdownExtTypeHandler(boolean printComments) {
37+
super(printComments);
38+
// TODO Auto-generated constructor stub
39+
}
40+
3041
@Override
3142
public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
3243
PrintWriter writer = new PrintWriter( new OutputStreamWriter( docOutput.getOs() ) );
@@ -36,7 +47,7 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
3647
* the DocBase model in the desired output (DocPara, DocTable, DocList etc).
3748
* Here we created a facade to do so :
3849
*/
39-
MarkdownExtDocFacade facade = new MarkdownExtDocFacade( writer );
50+
MarkdownExtDocFacade facade = new MarkdownExtDocFacade( writer, this.isPrintComments() );
4051
facade.handleDoc( docBase );
4152
}
4253

fj-doc-ent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-doc</artifactId>
10-
<version>0.3.8.1</version>
10+
<version>0.3.8.2</version>
1111
</parent>
1212

1313
<name>fj-doc-ent</name>

fj-doc-freemarker/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-doc</artifactId>
10-
<version>0.3.8.1</version>
10+
<version>0.3.8.2</version>
1111
</parent>
1212

1313
<name>fj-doc-freemarker</name>

0 commit comments

Comments
 (0)