Mantid
|
#include <NotebookWriter.h>
Public Member Functions | |
std::string | codeCell (const std::string &string_code) |
Add a code cell to the buffer of cells to write to the notebook. More... | |
std::string | markdownCell (const std::string &string_text) |
Add a markdown cell to the buffer of cells to write to the notebook. More... | |
NotebookWriter () | |
std::string | writeNotebook () |
Create a formatted string of Json which describes a notebook. More... | |
virtual | ~NotebookWriter ()=default |
Private Member Functions | |
Json::Value | buildNotebook () |
Create a Json value containing the whole notebook. More... | |
void | codeCell (Json::Value array_code) |
Add a code cell to the buffer of cells to write to the notebook. More... | |
void | headerCode () |
Add code cells to the buffer of cells to write to the notebook These are to import Mantid and matplotlib, and to warn the user if the version of Mantid being used does not match the version which generated the notebook. More... | |
void | headerComment () |
Add a markdown cell of information for the user to the buffer of cells to write to the notebook. More... | |
void | markdownCell (Json::Value string_array) |
Add a markdown cell to the buffer of cells to write to the notebook. More... | |
Private Attributes | |
Json::Value | m_cell_buffer |
Definition at line 22 of file NotebookWriter.h.
NotebookWriter::NotebookWriter | ( | ) |
Definition at line 20 of file NotebookWriter.cpp.
References headerCode(), and headerComment().
|
virtualdefault |
|
private |
Create a Json value containing the whole notebook.
Definition at line 147 of file NotebookWriter.cpp.
References m_cell_buffer.
Referenced by writeNotebook().
std::string NotebookWriter::codeCell | ( | const std::string & | string_code | ) |
Add a code cell to the buffer of cells to write to the notebook.
string_code | :: string containing the python for the code cell |
Definition at line 51 of file NotebookWriter.cpp.
References m_cell_buffer.
Referenced by headerCode().
|
private |
Add a code cell to the buffer of cells to write to the notebook.
array_code | :: Json array of strings containing python code for the code cell |
Definition at line 32 of file NotebookWriter.cpp.
References m_cell_buffer.
|
private |
Add code cells to the buffer of cells to write to the notebook These are to import Mantid and matplotlib, and to warn the user if the version of Mantid being used does not match the version which generated the notebook.
Definition at line 129 of file NotebookWriter.cpp.
References codeCell().
Referenced by NotebookWriter().
|
private |
Add a markdown cell of information for the user to the buffer of cells to write to the notebook.
Definition at line 104 of file NotebookWriter.cpp.
References markdownCell(), Mantid::Kernel::MantidVersion::releaseNotes(), and Mantid::Kernel::MantidVersion::version().
Referenced by NotebookWriter().
std::string NotebookWriter::markdownCell | ( | const std::string & | string_text | ) |
Add a markdown cell to the buffer of cells to write to the notebook.
string_text | :: string containing the python code for the code cell |
Definition at line 88 of file NotebookWriter.cpp.
References m_cell_buffer.
Referenced by headerComment().
|
private |
Add a markdown cell to the buffer of cells to write to the notebook.
string_array | :: json array of strings containing the python code for the code cell |
Definition at line 72 of file NotebookWriter.cpp.
References m_cell_buffer.
std::string NotebookWriter::writeNotebook | ( | ) |
Create a formatted string of Json which describes a notebook.
Definition at line 173 of file NotebookWriter.cpp.
References buildNotebook().
|
private |
Definition at line 40 of file NotebookWriter.h.
Referenced by buildNotebook(), codeCell(), and markdownCell().