public class MarkdownNotebookOutput extends Object implements NotebookOutput
Modifier and Type | Field and Description |
---|---|
static int |
MAX_OUTPUT
The constant MAX_OUTPUT.
|
static Random |
random
The constant random.
|
List<CharSequence> |
toc
The Toc.
|
Constructor and Description |
---|
MarkdownNotebookOutput(File reportFile)
Instantiates a new Markdown notebook output.
|
MarkdownNotebookOutput(File reportFile,
boolean autobrowse)
Instantiates a new Markdown notebook output.
|
MarkdownNotebookOutput(File reportFile,
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 |
eval(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 NotebookOutput |
get(File path,
boolean autobrowse)
Get markdown notebook output.
|
static NotebookOutput |
get(String s)
Get notebook output.
|
URI |
getArchiveHome()
Gets archive home.
|
URI |
getCurrentHome()
Gets current home.
|
static CharSequence |
getExceptionString(Throwable e)
Gets exception string.
|
CharSequence |
getFrontMatterProperty(CharSequence key)
Gets front matter property.
|
FileHTTPD |
getHttpd()
Gets httpd.
|
int |
getMaxImageSize()
Gets max image size.
|
int |
getMaxOutSize()
Gets max out size.
|
CharSequence |
getName()
Gets name.
|
File |
getReportFile()
Gets report file.
|
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.
|
boolean |
isAutobrowse()
Is autobrowse boolean.
|
String |
jpg(BufferedImage rawImage,
CharSequence caption)
Jpg string.
|
File |
jpgFile(BufferedImage rawImage,
File file)
Jpg file file.
|
CharSequence |
link(File file,
CharSequence text)
Link string.
|
NotebookOutput |
onComplete(Runnable... tasks)
On complete markdown notebook output.
|
void |
out(CharSequence fmt,
Object... args)
Out.
|
void |
p(CharSequence fmt,
Object... args)
P.
|
CharSequence |
pathTo(File file)
Code file string.
|
String |
png(BufferedImage rawImage,
CharSequence caption)
Image string.
|
File |
pngFile(BufferedImage rawImage,
File file)
Png file file.
|
File |
resolveResource(CharSequence name)
Resolve resource file.
|
NotebookOutput |
setArchiveHome(URI archiveHome)
Sets archive home.
|
NotebookOutput |
setAutobrowse(boolean autobrowse)
Sets autobrowse.
|
NotebookOutput |
setCurrentHome(URI currentHome)
Sets current home.
|
void |
setFrontMatterProperty(CharSequence key,
CharSequence value)
Sets fm prop.
|
NotebookOutput |
setMaxImageSize(int maxImageSize)
Sets max image size.
|
NotebookOutput |
setName(String name)
Sets name.
|
static String |
stripPrefixes(String str,
String... prefixes)
Strip prefixes string.
|
<T> T |
subreport(String subreportName,
Function<NotebookOutput,T> fn)
Subreport t.
|
String |
summarize(String logSrc,
int maxLog)
Summarize string.
|
String |
toString(List<CharSequence> list)
To string string.
|
static Consumer<NotebookOutput> |
wrapFrontmatter(Consumer<NotebookOutput> fn)
Wrap frontmatter consumer.
|
void |
write()
Write.
|
void |
write(PrintWriter out)
Write markdown with frontmatter.
|
File |
writeZip(File root,
String baseName)
Write zip.
|
void |
zipArchive(File root,
File dir,
ZipOutputStream out,
Predicate<? super File> filter)
Write archive.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendFrontMatterProperty, concat, eval, out, run
public static final Random random
public static int MAX_OUTPUT
@Nonnull public List<CharSequence> toc
public MarkdownNotebookOutput(@Nonnull File reportFile, boolean autobrowse) throws FileNotFoundException
reportFile
- the file nameautobrowse
- the autobrowseFileNotFoundException
- the file not found exceptionpublic MarkdownNotebookOutput(@Nonnull File reportFile) throws FileNotFoundException
reportFile
- the report fileFileNotFoundException
- the file not found exceptionpublic MarkdownNotebookOutput(@Nonnull File reportFile, int httpPort, boolean autobrowse) throws FileNotFoundException
reportFile
- the file namehttpPort
- the http portautobrowse
- the autobrowseFileNotFoundException
- the file not found exceptionpublic static Consumer<NotebookOutput> wrapFrontmatter(@Nonnull Consumer<NotebookOutput> fn)
fn
- the fnpublic static NotebookOutput get(File path, boolean autobrowse)
path
- the pathautobrowse
- the autobrowse@Nonnull public static CharSequence getExceptionString(Throwable e)
e
- the epublic static NotebookOutput get(String s)
s
- the spublic static String stripPrefixes(String str, String... prefixes)
str
- the strprefixes
- the prefixespublic void close() throws IOException
close
in interface NotebookOutput
close
in interface Closeable
close
in interface AutoCloseable
IOException
@Nonnull public File getRoot()
getRoot
in interface NotebookOutput
public File writeZip(File root, String baseName) throws IOException
root
- the rootbaseName
- the base nameIOException
- the io exception@Nonnull public NotebookOutput onComplete(Runnable... tasks)
onComplete
in interface NotebookOutput
tasks
- the tasks@Nonnull public String toString(List<CharSequence> list)
list
- the listpublic void zipArchive(File root, File dir, ZipOutputStream out, Predicate<? super File> filter)
root
- the rootdir
- the dirout
- the outfilter
- the filterpublic void write(PrintWriter out)
out
- the outpublic void setFrontMatterProperty(CharSequence key, CharSequence value)
NotebookOutput
setFrontMatterProperty
in interface NotebookOutput
key
- the keyvalue
- the valuepublic CharSequence getFrontMatterProperty(CharSequence key)
NotebookOutput
getFrontMatterProperty
in interface NotebookOutput
key
- the keypublic CharSequence getName()
NotebookOutput
getName
in interface NotebookOutput
public CharSequence anchor(CharSequence anchorId)
anchorId
- the anchor idpublic CharSequence anchorId()
public void write() throws IOException
NotebookOutput
write
in interface NotebookOutput
IOException
- the io exception@Nonnull public OutputStream file(@Nonnull CharSequence name)
NotebookOutput
file
in interface NotebookOutput
name
- the name@Nonnull public File resolveResource(@Nonnull CharSequence name)
name
- the name@Nonnull public String file(CharSequence data, CharSequence caption)
NotebookOutput
file
in interface NotebookOutput
data
- the datacaption
- the caption@Nonnull public CharSequence file(@Nonnull byte[] data, @Nonnull CharSequence filename, CharSequence caption)
NotebookOutput
file
in interface NotebookOutput
data
- the datafilename
- the filenamecaption
- the caption@Nonnull public String file(@Nullable CharSequence data, @Nonnull CharSequence fileName, CharSequence caption)
NotebookOutput
file
in interface NotebookOutput
data
- the datafileName
- the file namecaption
- the caption@Nonnull public File getResourceDir()
getResourceDir
in interface NotebookOutput
public void h1(@Nonnull CharSequence fmt, Object... args)
NotebookOutput
h1
in interface NotebookOutput
fmt
- the fmtargs
- the argspublic void h2(@Nonnull CharSequence fmt, Object... args)
NotebookOutput
h2
in interface NotebookOutput
fmt
- the fmtargs
- the argspublic void h3(@Nonnull CharSequence fmt, Object... args)
NotebookOutput
h3
in interface NotebookOutput
fmt
- the fmtargs
- the args@Nonnull public String png(@Nullable BufferedImage rawImage, CharSequence caption)
NotebookOutput
png
in interface NotebookOutput
rawImage
- the raw pngcaption
- the caption@Nonnull public File pngFile(@Nonnull BufferedImage rawImage, File file)
NotebookOutput
pngFile
in interface NotebookOutput
rawImage
- the raw imagefile
- the file@Nonnull public String jpg(@Nullable BufferedImage rawImage, CharSequence caption)
NotebookOutput
jpg
in interface NotebookOutput
rawImage
- the raw imagecaption
- the caption@Nonnull public File jpgFile(@Nonnull BufferedImage rawImage, File file)
NotebookOutput
jpgFile
in interface NotebookOutput
rawImage
- the raw imagefile
- the filepublic <T> T eval(@Nonnull UncheckedSupplier<T> fn, int maxLog, int framesNo)
NotebookOutput
eval
in interface NotebookOutput
T
- the type parameterfn
- the fnmaxLog
- the max logframesNo
- the frames no@Nonnull public CharSequence link(@Nonnull File file, CharSequence text)
NotebookOutput
link
in interface NotebookOutput
file
- the filetext
- the textpublic CharSequence pathTo(@Nonnull File file)
file
- the filepublic void out(@Nonnull CharSequence fmt, Object... args)
NotebookOutput
out
in interface NotebookOutput
fmt
- 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)
NotebookOutput
p
in interface NotebookOutput
fmt
- the fmtargs
- the args@Nonnull public String summarize(@Nonnull String logSrc, int maxLog)
logSrc
- the log srcmaxLog
- the max logpublic int getMaxOutSize()
NotebookOutput
getMaxOutSize
in interface NotebookOutput
public FileHTTPD getHttpd()
NotebookOutput
getHttpd
in interface NotebookOutput
public <T> T subreport(String subreportName, Function<NotebookOutput,T> fn)
NotebookOutput
subreport
in interface NotebookOutput
T
- the type parametersubreportName
- the report namefn
- the fnpublic boolean isAutobrowse()
public int getMaxImageSize()
public NotebookOutput setMaxImageSize(int maxImageSize)
maxImageSize
- the max image sizepublic URI getCurrentHome()
NotebookOutput
getCurrentHome
in interface NotebookOutput
public NotebookOutput setCurrentHome(URI currentHome)
NotebookOutput
setCurrentHome
in interface NotebookOutput
currentHome
- the current homepublic URI getArchiveHome()
NotebookOutput
getArchiveHome
in interface NotebookOutput
public NotebookOutput setArchiveHome(URI archiveHome)
NotebookOutput
setArchiveHome
in interface NotebookOutput
archiveHome
- the archive homepublic NotebookOutput setName(String name)
NotebookOutput
setName
in interface NotebookOutput
name
- the namepublic NotebookOutput setAutobrowse(boolean autobrowse)
NotebookOutput
setAutobrowse
in interface NotebookOutput
autobrowse
- the autobrowseCopyright © 2019 SimiaCryptus Software. All rights reserved.