Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme error resolved #87

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ export class ProjectComponent implements OnInit {
this.latestVersion = this.versions[0]; // Default to the latest version
}
// console.log("the loatest version : ", this.latestVersion);
this.projectService.getNotebookFile(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0], this.latestVersion).subscribe(
notebookJson => {
this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson));
// console.log("the notebook content is : ", this.notebookContent);
});
});
// console.log("readme file is : ", result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0]);
this.projectService.getNotebookFile(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0], this.latestVersion).subscribe(
notebookJson => {
this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson));
// console.log("the notebook content is : ", this.notebookContent);
});
}

)
Expand Down Expand Up @@ -182,20 +182,20 @@ export class ProjectComponent implements OnInit {
for (const cell of notebookJson.cells) {
htmlContent += '<div class="notebook-cell">';
if (cell.cell_type === 'markdown') {
htmlContent += marked(cell.source.join(''));
htmlContent += marked(cell.source);
} else if (cell.cell_type === 'code') {
htmlContent += '<pre><code><div>' + hljs.highlight(cell.source.join(''), {language: 'python'}).value + '</div></code></pre>';
htmlContent += '<pre><code><div>' + hljs.highlight(cell.source, {language: 'python'}).value + '</div></code></pre>';
if (cell.outputs) {
for (const output of cell.outputs) {
if (output.data && output.data['text/html']) {
htmlContent += output.data['text/html'].join('');
htmlContent += output.data['text/html'];
} else if (output.data && output.data['image/png']) {
htmlContent += `<img src="data:image/png;base64,${output.data['image/png']}" />`;
} else if (output.data && output.data['text/plain']) {
htmlContent += '<pre>' + output.data['text/plain'].join('') + '</pre>';
htmlContent += '<pre>' + output.data['text/plain'] + '</pre>';
}
else if (output.text) {
htmlContent += '<pre>' + output.text.join('') + '</pre>';
htmlContent += '<pre>' + output.text + '</pre>';
}
}
}
Expand Down
Loading