1#ifndef NOTEBOOK_CONVERTER_HPP
2#define NOTEBOOK_CONVERTER_HPP
8#include <nlohmann/json.hpp>
10using json = nlohmann::json;
45 void toggleSolution(
const QString &filePath,
const QString &solutionFilePath);
51 void resetNotebook(
const QString ¬ebookPath,
const QString ¬ebookSolutionPath);
74 void removeSolutionFromNotebook(
const QString ¬ebookPath);
76 QByteArray readFile(
const QString ¬ebookPath);
77 json parseJson(
const QByteArray &data,
const QString ¬ebookPath);
78 void processCells(
json ¬ebook,
const QString ¬ebookPath);
79 void processCell(
json &cell,
const QString ¬ebookPath,
int i);
80 void writeFile(
const json ¬ebook,
const QString ¬ebookPath);
81 void copyAndModifyNotebooks(
const QDir &sourceDir,
const QDir &destDir);
83 void removeSolutionCells(
const QString ¬ebookPath);
84 void addSolutionCells(
const QString ¬ebookPath,
const QString &solutionPath);
85 void manipulateSolutionCellContent(
json &solutionCell);
A class for converting Jupyter notebooks to Python scripts and processing task pools.
Definition notebook_converter.hpp:23
NotebookConverter(QObject *parent=nullptr)
Definition notebook_converter.cpp:26
void toggleSolution(const QString &filePath, const QString &solutionFilePath)
Toggles the solution code in a Jupyter notebook.
Definition notebook_converter.cpp:265
void processTaskPool()
Modifies and copies all notebooks from task_pool to users workspace.
Definition notebook_converter.cpp:94
bool convertNotebook(const QString ¬ebookPath)
Converts a Jupyter notebook to a Python script. Ignoring code cells with "solution" tag.
Definition notebook_converter.cpp:28
void resetNotebook(const QString ¬ebookPath, const QString ¬ebookSolutionPath)
Removes solution code from a Jupyter notebook.
Definition notebook_converter.cpp:103
static bool hasSolutionCells(const QString ¬ebookPath)
Checks if the notebook contains any solution cells.
Definition notebook_converter.cpp:427
nlohmann::json json
Definition notebook_converter.cpp:11