Add documentation and fix paths (#14948)

* use posix relative path

* add doc link in dialog

* rename book to Jupyter book
This commit is contained in:
Barbara Valdez
2021-04-02 15:44:25 -07:00
committed by GitHub
parent 0d3112ef35
commit fde5caa9a4
5 changed files with 60 additions and 46 deletions

View File

@@ -94,8 +94,8 @@ export class AddFileDialog {
private async createFile(): Promise<boolean> {
try {
const dirPath = this._bookItem.contextValue === BookTreeItemType.savedBook ? this._bookItem.rootContentPath : path.dirname(this._bookItem.resourceUri.fsPath);
const filePath = path.join(dirPath, this._fileNameInputBox.value).concat(this._extension);
const dirPath = this._bookItem.contextValue === BookTreeItemType.savedBook ? this._bookItem.rootContentPath : path.dirname(this._bookItem.book.contentPath);
const filePath = path.posix.join(dirPath, this._fileNameInputBox.value).concat(this._extension);
await this.validatePath(dirPath, this._fileNameInputBox.value.concat(this._extension));
const pathDetails = new TocEntryPathHandler(filePath, this._bookItem.rootContentPath, this._titleInputBox.value);
await this._tocManager.addNewFile(pathDetails, this._bookItem);