Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachments ¶ added in v0.2.0
type Attachments map[string]MimeBundle
Attachments store mime-bundles keyed by filename.
func (Attachments) MimeBundle ¶ added in v0.2.0
func (att Attachments) MimeBundle(filename string) schema.MimeBundle
type Code ¶
type Code struct {
Source common.MultilineString `json:"source"`
TimesExecuted int `json:"execution_count"`
Out []Output `json:"outputs"`
Lang string `json:"-"`
}
Code defines the schema for a "code" cell.
func (*Code) ExecutionCount ¶
type DisplayDataOutput ¶
type DisplayDataOutput struct {
MimeBundle `json:"data"`
Metadata map[string]interface{} `json:"metadata"`
}
DisplayDataOutput are rich-format outputs generated by running the code in the parent cell.
func (*DisplayDataOutput) Type ¶ added in v0.2.0
func (dd *DisplayDataOutput) Type() schema.CellType
type ErrorOutput ¶
type ErrorOutput struct {
ExceptionName string `json:"ename"`
ExceptionValue string `json:"evalue"`
Traceback []string `json:"traceback"`
}
ErrorOutput stores the output of a failed code execution.
func (*ErrorOutput) MimeType ¶
func (err *ErrorOutput) MimeType() string
func (*ErrorOutput) Text ¶
func (err *ErrorOutput) Text() (txt []byte)
func (*ErrorOutput) Type ¶
func (err *ErrorOutput) Type() schema.CellType
type ExecuteResultOutput ¶
type ExecuteResultOutput struct {
DisplayDataOutput
TimesExecuted int `json:"execution_count"`
}
ExecuteResultOutput is the result of executing the code in the cell. Its contents are identical to those of DisplayDataOutput with the addition of the execution count.
func (*ExecuteResultOutput) ExecutionCount ¶
func (ex *ExecuteResultOutput) ExecutionCount() int
func (*ExecuteResultOutput) Type ¶ added in v0.2.0
func (ex *ExecuteResultOutput) Type() schema.CellType
type Markdown ¶
type Markdown struct {
Att Attachments `json:"attachments,omitempty"`
Source common.MultilineString `json:"source"`
}
Markdown defines the schema for a "markdown" cell.
func (*Markdown) Attachments ¶ added in v0.2.0
func (md *Markdown) Attachments() schema.Attachments
type MimeBundle ¶
type MimeBundle map[string]interface{}
MimeBundle contains rich output data keyed by mime-type.
func (MimeBundle) Data ¶
func (mb MimeBundle) Data(mime string) []byte
Data returns mime-type-specific content if present and a nil slice otherwise.
func (MimeBundle) MimeType ¶
func (mb MimeBundle) MimeType() string
MimeType returns the richer of the mime-types present in the bundle, and falls back to "text/plain" otherwise.
func (MimeBundle) PlainText ¶
func (mb MimeBundle) PlainText() []byte
RawText returns data for "text/plain" mime-type and a nil slice otherwise.
func (MimeBundle) Text ¶
func (mb MimeBundle) Text() []byte
Text returns data with the richer mime-type.
type NotebookMetadata ¶
type NotebookMetadata struct {
Lang struct {
Name string `json:"name"`
Version string `json:"version"`
} `json:"language_info"`
}
func (*NotebookMetadata) Language ¶
func (nm *NotebookMetadata) Language() string
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Outputs unmarshals cell outputs into schema.Cell based on their type.
func (*Output) UnmarshalJSON ¶
type Raw ¶
type Raw struct {
Att Attachments `json:"attachments,omitempty"`
Source common.MultilineString `json:"source"`
Metadata RawCellMetadata `json:"metadata"`
}
Raw defines the schema for a "raw" cell.
func (*Raw) Attachments ¶ added in v0.2.0
func (raw *Raw) Attachments() schema.Attachments
type RawCellMetadata ¶
type RawCellMetadata struct {
Format *string `json:"format"`
RawMimeType *string `json:"raw_mimetype"`
}
RawCellMetadata may specify a target conversion format.
func (*RawCellMetadata) MimeType ¶
func (raw *RawCellMetadata) MimeType() string
MimeType returns a more specific mime-type if one is provided and "text/plain" otherwise.
type StreamOutput ¶
type StreamOutput struct {
// Target can be stdout or stderr.
Target string `json:"name"`
Source common.MultilineString `json:"text"`
}
StreamOutput is a plain, text-based output of the executed code. Depending on the stream "target", Type() can report "text/plain" (stdout) or "error" (stderr). The output is often decorated with ANSI-color sequences, which should be handled separately.
func (*StreamOutput) MimeType ¶
func (stream *StreamOutput) MimeType() string
func (*StreamOutput) Text ¶
func (stream *StreamOutput) Text() []byte
func (*StreamOutput) Type ¶
func (stream *StreamOutput) Type() schema.CellType