-
Notifications
You must be signed in to change notification settings - Fork 18
New tool to rename notebooks #57
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
Hey @mbektas |
new_name: New name for the notebook | ||
""" | ||
response = args["response"] | ||
ui_cmd_response = await response.run_ui_command('notebook-intelligence:rename-notebook-from-py', {'newName': new_name}) |
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.
can you remove -from-py
suffix from the command names
src/index.ts
Outdated
@@ -87,6 +87,8 @@ namespace CommandIDs { | |||
export const createNewFile = 'notebook-intelligence:create-new-file'; | |||
export const createNewNotebookFromPython = | |||
'notebook-intelligence:create-new-notebook-from-py'; | |||
export const renameNotebookFromPython = |
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.
FromPython
in name is not necessary
src/index.ts
Outdated
const activeWidget = app.shell.currentWidget; | ||
if (activeWidget instanceof NotebookPanel) { | ||
const oldPath = activeWidget.context.path; | ||
const newPath = args.newName as string; |
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.
I think the new name should be input as just file name and it shouldn't change the parent directory of a notebook. example:
- oldPath: 'test/untitled.ipynb'
- newName: 'hello-world'
- newPath: 'test/hello-world.ipynb'
done with the changes, please have a look. @mbektas |
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.
LGTM! thanks @kuugu .
A simple tool addition to rename notebooks