-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes to exporting of notebook to html #12882
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
Conversation
const fileName = path.basename(target.fsPath, path.extname(target.fsPath)); | ||
const tempDir = await this.exportUtil.generateTempDir(); | ||
const sourceFilePath = await this.exportUtil.makeFileInDirectory(model, fileName, tempDir.path); | ||
const sourceFilePath = await this.exportUtil.makeFileInDirectory(model, `${fileName}.ipynb`, tempDir.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was required on mac
: `${path.basename(source.fsPath, path.extname(source.fsPath))}${extension}`; | ||
|
||
const dialogUri = Uri.file(path.join(this.getLastFileSaveLocation().fsPath, notebookFileName)); | ||
const dialogUri = Uri.file(path.join(this.getLastFileSaveLocation().fsPath, targetFileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were looking for *.htm
when the *.html
file was created.
E.g. target = abc.htm
, then the file created is abc.htm.html
.
const content = model ? model.getContent() : ''; | ||
await this.fileSystem.writeFile(newFilePath, content, 'utf-8'); | ||
} catch (e) { | ||
await this.errorHandler.handleError(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error handler was not rqeuired
const newFilePath = path.join(dirPath, fileName); | ||
|
||
try { | ||
const content = model ? model.getContent() : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model cannot be undefined.
Kudos, SonarCloud Quality Gate passed!
|
Ensure we have file extensions for the source ipynb Ensure we have file extensions for the target html/pdf files Misc cleanup
For #12868