public class MarkdownNotebookOutput extends Object implements NotebookOutput
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_OUTPUT
The constant MAX_OUTPUT.
|
List<CharSequence> |
toc
The Toc.
|
| Constructor and Description |
|---|
MarkdownNotebookOutput(File reportFile,
String name,
boolean autobrowse)
Instantiates a new Markdown notebook output.
|
MarkdownNotebookOutput(File reportFile,
String name,
int httpPort,
boolean autobrowse)
Instantiates a new Markdown notebook output.
|
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
anchor(CharSequence anchorId)
Anchor string.
|
CharSequence |
anchorId()
Anchor id string.
|
void |
close() |
<T> T |
code(UncheckedSupplier<T> fn,
int maxLog,
int framesNo)
Code t.
|
CharSequence |
file(byte[] data,
CharSequence filename,
CharSequence caption)
File string.
|
OutputStream |
file(CharSequence name)
File output stream.
|
String |
file(CharSequence data,
CharSequence caption)
File string.
|
String |
file(CharSequence data,
CharSequence fileName,
CharSequence caption)
File string.
|
String |
format(CharSequence fmt,
Object... args)
Format string.
|
static MarkdownNotebookOutput |
get(boolean autobrowse)
Get markdown notebook output.
|
static MarkdownNotebookOutput |
get(Object source,
boolean autobrowse)
Get markdown notebook output.
|
static CharSequence |
getExceptionString(Throwable e)
Gets exception string.
|
CharSequence |
getFrontMatterProperty(CharSequence key)
Gets front matter property.
|
FileNanoHTTPD |
getHttpd()
Gets httpd.
|
int |
getMaxImageSize() |
int |
getMaxOutSize()
Gets max out size.
|
CharSequence |
getName()
Gets name.
|
File |
getResourceDir()
Gets resource dir.
|
File |
getRoot()
Gets root.
|
void |
h1(CharSequence fmt,
Object... args)
H 1.
|
void |
h2(CharSequence fmt,
Object... args)
H 2.
|
void |
h3(CharSequence fmt,
Object... args)
H 3.
|
String |
image(BufferedImage rawImage,
CharSequence caption)
Image string.
|
boolean |
isAutobrowse() |
CharSequence |
link(File file,
CharSequence text)
Link string.
|
MarkdownNotebookOutput |
onComplete(java.util.function.Consumer<File>... tasks)
On complete markdown notebook output.
|
void |
out(String fmt,
Object... args)
Out.
|
void |
p(CharSequence fmt,
Object... args)
P.
|
static Path |
pathToCodeFile(File baseFile,
File file)
Path to code file path.
|
CharSequence |
pathToGitResource(File file) |
CharSequence |
pathToReportResource(File file)
Code file string.
|
void |
setFrontMatterProperty(CharSequence key,
CharSequence value)
Sets fm prop.
|
MarkdownNotebookOutput |
setMaxImageSize(int maxImageSize) |
String |
summarize(String logSrc,
int maxLog)
Summarize string.
|
String |
testName()
Test name string.
|
String |
toString(List<CharSequence> list)
To string string.
|
static java.util.function.Consumer<NotebookOutput> |
wrapFrontmatter(java.util.function.Consumer<NotebookOutput> fn)
Wrap frontmatter consumer.
|
void |
writeArchive(File root,
File dir,
ZipOutputStream out,
java.util.function.Predicate<? super File> filter)
Write archive.
|
void |
writeHtmlAndPdf(File root,
String baseName)
Write html and pdf.
|
void |
writeMarkdownWithFrontmatter(PrintWriter out)
Write markdown with frontmatter.
|
void |
writeZip(File root,
String baseName)
Write zip.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendFrontMatterProperty, code, code, concat, outpublic static int MAX_OUTPUT
@Nonnull public List<CharSequence> toc
public MarkdownNotebookOutput(@Nonnull File reportFile, String name, boolean autobrowse) throws FileNotFoundException
reportFile - the file namename - the nameFileNotFoundException - the file not found exceptionpublic MarkdownNotebookOutput(@Nonnull File reportFile, String name, int httpPort, boolean autobrowse) throws FileNotFoundException
reportFile - the file namename - the namehttpPort - the http portautobrowse - FileNotFoundException - the file not found exceptionpublic static java.util.function.Consumer<NotebookOutput> wrapFrontmatter(@Nonnull java.util.function.Consumer<NotebookOutput> fn)
fn - the fnpublic static MarkdownNotebookOutput get(boolean autobrowse)
autobrowse - public static MarkdownNotebookOutput get(Object source, boolean autobrowse)
source - the sourceautobrowse - @Nonnull public static CharSequence getExceptionString(Throwable e)
e - the e@Nonnull public MarkdownNotebookOutput onComplete(java.util.function.Consumer<File>... tasks)
tasks - the taskspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String testName()
public void writeZip(File root, String baseName) throws IOException
root - the rootbaseName - the base nameIOException - the io exceptionpublic static Path pathToCodeFile(File baseFile, @Nonnull File file) throws IOException
baseFile - file - the fileIOException - the io exception@Nonnull public String toString(List<CharSequence> list)
list - the listpublic void writeArchive(File root, File dir, ZipOutputStream out, java.util.function.Predicate<? super File> filter)
root - the rootdir - the dirout - the outfilter - the filterpublic void writeMarkdownWithFrontmatter(PrintWriter out)
out - the outpublic void setFrontMatterProperty(CharSequence key, CharSequence value)
NotebookOutputsetFrontMatterProperty in interface NotebookOutputkey - the keyvalue - the valuepublic CharSequence getFrontMatterProperty(CharSequence key)
NotebookOutputgetFrontMatterProperty in interface NotebookOutputkey - the keypublic CharSequence getName()
NotebookOutputgetName in interface NotebookOutputpublic CharSequence anchor(CharSequence anchorId)
anchorId - the anchor idpublic CharSequence anchorId()
public void writeHtmlAndPdf(File root, String baseName) throws IOException
root - the rootbaseName - the base nameIOException - the io exception@Nonnull public OutputStream file(@Nonnull CharSequence name)
NotebookOutputfile in interface NotebookOutputname - the name@Nonnull public String file(CharSequence data, CharSequence caption)
NotebookOutputfile in interface NotebookOutputdata - the datacaption - the caption@Nonnull public CharSequence file(@Nonnull byte[] data, @Nonnull CharSequence filename, CharSequence caption)
NotebookOutputfile in interface NotebookOutputdata - the datafilename - the filenamecaption - the caption@Nonnull public String file(@Nullable CharSequence data, @Nonnull CharSequence fileName, CharSequence caption)
NotebookOutputfile in interface NotebookOutputdata - the datafileName - the file namecaption - the caption@Nonnull public File getResourceDir()
getResourceDir in interface NotebookOutputpublic void h1(@Nonnull CharSequence fmt, Object... args)
NotebookOutputh1 in interface NotebookOutputfmt - the fmtargs - the argspublic void h2(@Nonnull CharSequence fmt, Object... args)
NotebookOutputh2 in interface NotebookOutputfmt - the fmtargs - the argspublic void h3(@Nonnull CharSequence fmt, Object... args)
NotebookOutputh3 in interface NotebookOutputfmt - the fmtargs - the args@Nonnull public String image(@Nullable BufferedImage rawImage, CharSequence caption)
NotebookOutputimage in interface NotebookOutputrawImage - the raw imagecaption - the captionpublic <T> T code(@Nonnull UncheckedSupplier<T> fn, int maxLog, int framesNo)
NotebookOutputcode in interface NotebookOutputT - the type parameterfn - the fnmaxLog - the max logframesNo - the frames no@Nonnull public CharSequence link(@Nonnull File file, CharSequence text)
NotebookOutputlink in interface NotebookOutputfile - the filetext - the textpublic CharSequence pathToReportResource(@Nonnull File file) throws IOException
file - the fileIOException - the io exceptionpublic CharSequence pathToGitResource(@Nonnull File file) throws IOException
IOExceptionpublic void out(@Nonnull String fmt, Object... args)
NotebookOutputout in interface NotebookOutputfmt - the fmtargs - the args@Nonnull public String format(@Nonnull CharSequence fmt, @Nonnull Object... args)
fmt - the fmtargs - the argspublic void p(CharSequence fmt, Object... args)
NotebookOutputp in interface NotebookOutputfmt - the fmtargs - the args@Nonnull public String summarize(@Nonnull String logSrc, int maxLog)
logSrc - the log srcmaxLog - the max logpublic int getMaxOutSize()
NotebookOutputgetMaxOutSize in interface NotebookOutputpublic FileNanoHTTPD getHttpd()
NotebookOutputgetHttpd in interface NotebookOutputpublic boolean isAutobrowse()
public int getMaxImageSize()
public MarkdownNotebookOutput setMaxImageSize(int maxImageSize)
Copyright © 2018 SimiaCryptus Software. All rights reserved.