Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@DonJayamanne
Copy link

For #12868

  • Ensure we have file extensions for the source ipynb
  • Ensure we have file extensions for the target html/pdf files
  • Misc cleanup

@DonJayamanne DonJayamanne changed the title Fixes to exporting to html Fixes to exporting of notebook to html Jul 10, 2020
@DonJayamanne DonJayamanne added the no-changelog No news entry required label Jul 10, 2020
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);
Copy link
Author

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));
Copy link
Author

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);
Copy link
Author

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() : '';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model cannot be undefined.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@DonJayamanne DonJayamanne merged commit 9e4e356 into microsoft:master Jul 10, 2020
@DonJayamanne DonJayamanne deleted the fixExport branch July 10, 2020 17:36
DonJayamanne added a commit that referenced this pull request Jul 10, 2020
Ensure we have file extensions for the source ipynb
Ensure we have file extensions for the target html/pdf files
Misc cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.