aQute.lib.markdown.MarkdownFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bnd Show documentation
Show all versions of biz.aQute.bnd Show documentation
This command line utility is the Swiss army knife of OSGi. It provides you with a breadth of tools to understand and manage OSGi based systems. This project basically uses bndlib.
package aQute.lib.markdown;
import java.util.Formatter;
public class MarkdownFormatter {
private Formatter f;
public MarkdownFormatter(Appendable out) {
f = new Formatter(out);
}
public MarkdownFormatter format(String format, Object... args) {
f = f.format(format, args);
return this;
}
public MarkdownFormatter h1(String format, Object... args) {
f = f.format("# " + format + " #%n", args);
return this;
}
public MarkdownFormatter h2(String format, Object... args) {
f = f.format("## " + format + " ##%n", args);
return this;
}
public MarkdownFormatter h3(String format, Object... args) {
f = f.format("### " + format + " ###%n", args);
return this;
}
public MarkdownFormatter list(String format, Object... args) {
f = f.format("+ " + format + "%n", args);
return this;
}
@Override
public String toString() {
return f.toString();
}
public MarkdownFormatter code(String format, Object... args) {
f = f.format("\t" + format + "%n", args);
return this;
}
public MarkdownFormatter inlineCode(String format, Object... args) {
f = f.format("`" + format + "`", args);
return this;
}
public MarkdownFormatter endP() {
f = f.format("%n%n");
return this;
}
public MarkdownFormatter flush() {
f.flush();
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy