Cadabra
Computer algebra system for field theory problems
Classes | Namespaces | Typedefs | Functions
DataCell.hh File Reference
#include <string>
#include <mutex>
#include "tree.hh"
#include "nlohmann/json.hpp"

Go to the source code of this file.

Classes

class  cadabra::DataCell
 DataCells are the basic building blocks for a document. More...
 
class  cadabra::DataCell::id_t
 Each cell is identified by a serial number 'id' which is used to keep track of it across network calls, and a bool indicating whether the client or the server has created this cell. More...
 

Namespaces

 cadabra
 Functions to handle the exchange properties of two or more symbols in a product.
 

Typedefs

typedef tree< DataCell > cadabra::DTree
 

Functions

std::string cadabra::JSON_serialise (const DTree &)
 Serialise a document into .cj format, which is a JSON version of the document tree. More...
 
void cadabra::JSON_recurse (const DTree &, DTree::iterator, nlohmann::json &)
 
void cadabra::JSON_deserialise (const std::string &, DTree &)
 Load a document from .cnb format, i.e. the inverse of the above. More...
 
void cadabra::JSON_in_recurse (DTree &doc, DTree::iterator loc, const nlohmann::json &cells)
 
std::string cadabra::export_as_HTML (const DTree &doc, bool for_embedding=false, bool strip_code=false, std::string title="")
 Export a document to a single self-contained HTML file containing inline CSS. More...
 
void cadabra::HTML_recurse (const DTree &doc, DTree::iterator it, std::ostringstream &str, const std::string &preamble_string, bool for_embedding=false, bool strip_code=false, std::string title="")
 
std::string cadabra::latex_to_html (const std::string &)
 Convert various LaTeX constructions to HTML-with-Mathjax, e.g. More...
 
std::string cadabra::export_as_LaTeX (const DTree &doc, const std::string &image_file_base, bool for_embedding=false)
 Export a document to a single self-contained LaTeX file, with the exception of images which get saved as separate numbered files. More...
 
void cadabra::LaTeX_recurse (const DTree &doc, DTree::iterator it, std::ostringstream &str, const std::string &preamble_string, const std::string &image_file_base, int &image_num, bool for_embedding)
 
std::string cadabra::export_as_python (const DTree &doc)
 Export a document to a python-like file (converting text cells to comments and python cells to python code, dropping output cells). More...
 
void cadabra::python_recurse (const DTree &doc, DTree::iterator it, std::ostringstream &str)
 
nlohmann::json cadabra::ipynb2cnb (const nlohmann::json &)
 Replace all occurrences of a substring in the original string. More...
 
nlohmann::json cadabra::cnb2ipynb (const nlohmann::json &)
 Convert the JSON of a Cadabra notebook to a Jupyter notebook. More...