Add abillity to open to specific item within a Jupyter book (#7155)

* Add abillity to open to specific item within a Jupyter book

* Move helper method into BookTreeItem class

* Fix default URL path

* Add typing to Jupyter book code

* Update comment and typings

* Fix compile error and cleanup
This commit is contained in:
Charles Gagnon
2019-09-13 11:51:15 -07:00
committed by GitHub
parent 3ac096b3b1
commit 888755e842
6 changed files with 133 additions and 47 deletions

View File

@@ -124,8 +124,8 @@ class AzdataExtensionBookContributionProvider extends Disposable implements Book
this.contributions.map(book => {
let bookName: string = path.basename(book.path);
vscode.commands.executeCommand('setContext', bookName, true);
vscode.commands.registerCommand('books.' + bookName, async (context) => {
vscode.commands.executeCommand('bookTreeView.openBook', book.path, true);
vscode.commands.registerCommand('books.' + bookName, async (urlToOpen?: string) => {
vscode.commands.executeCommand('bookTreeView.openBook', book.path, true, urlToOpen);
});
});
}