Introduced new commands : anchor(anchor), crossReference(anchor, text)
Refactored writeToFile for robustness Cleanups and fixes
This commit is contained in:
@@ -38,27 +38,27 @@ public abstract class AbstractMarkupDocBuilder implements MarkupDocBuilder {
|
||||
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected void documentTitle(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine).append(newLine);
|
||||
}
|
||||
|
||||
protected void documentTitleWithAttributes(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
protected void sectionTitleLevel1(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
protected void sectionTitleLevel2(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
protected void sectionTitleLevel3(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
protected void sectionTitleLevel4(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
documentBuilder.append(newLine).append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +103,12 @@ public abstract class AbstractMarkupDocBuilder implements MarkupDocBuilder {
|
||||
documentBuilder.append(newLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder crossReference(String anchor) {
|
||||
crossReference(anchor, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder newLine(){
|
||||
documentBuilder.append(newLine);
|
||||
@@ -114,8 +120,7 @@ public abstract class AbstractMarkupDocBuilder implements MarkupDocBuilder {
|
||||
return documentBuilder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToFile(String directory, String fileNameWithExtension, Charset charset) throws IOException {
|
||||
protected void writeToFileWithExtension(String directory, String fileNameWithExtension, Charset charset) throws IOException {
|
||||
Files.createDirectories(Paths.get(directory));
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(directory, fileNameWithExtension), charset)){
|
||||
writer.write(documentBuilder.toString());
|
||||
|
||||
Reference in New Issue
Block a user