mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
@@ -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);
|
||||
|
||||
@@ -63,13 +63,20 @@ export class CreateBookDialog {
|
||||
}
|
||||
|
||||
public async createDialog(): Promise<void> {
|
||||
this.dialog = azdata.window.createModelViewDialog(loc.newGroup);
|
||||
this.dialog = azdata.window.createModelViewDialog(loc.newBook);
|
||||
this.dialog.registerContent(async view => {
|
||||
this.view = view;
|
||||
|
||||
const groupLabel = this.view.modelBuilder.text()
|
||||
const jupyterBookDocumentation = this.view.modelBuilder.hyperlink()
|
||||
.withProperties<azdata.HyperlinkComponentProperties>({
|
||||
label: loc.learnMore,
|
||||
url: 'https://jupyterbook.org/intro.html',
|
||||
CSSStyles: { 'margin-bottom': '0px', 'margin-top': '0px', 'font-size': 'small' }
|
||||
}).component();
|
||||
|
||||
const bookLabel = this.view.modelBuilder.text()
|
||||
.withProperties({
|
||||
value: loc.groupDescription,
|
||||
value: loc.bookDescription,
|
||||
CSSStyles: { 'margin-bottom': '0px', 'margin-top': '0px', 'font-size': 'small' }
|
||||
}).component();
|
||||
|
||||
@@ -120,8 +127,8 @@ export class CreateBookDialog {
|
||||
.withFormItems([{
|
||||
components: [
|
||||
{
|
||||
component: groupLabel,
|
||||
required: false
|
||||
required: false,
|
||||
component: this.createHorizontalContainer(view, [bookLabel, jupyterBookDocumentation])
|
||||
},
|
||||
{
|
||||
component: this.bookNameInputBox,
|
||||
|
||||
Reference in New Issue
Block a user