Skip to content

Commit

Permalink
Improve console plugin (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Feb 23, 2024
1 parent ea3be08 commit 942f57e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/plugins/console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Key bindings

The console allows typing code and executing it. When you type code, hiting `Enter` doesn't execute it but instead creates a new line, so that you can continue typing and have a multi-line block of code. To execute the code, just hit `Ctrl-R`.
1 change: 1 addition & 0 deletions docs/usage/key_bindings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Depending on the context, some commands can be triggered using key bindings. For instance, when editing a notebook, cells can be executed, created or deleted using special keys. The following are links to key bindings for various plugins:

- [Notebook editor](../plugins/notebook_editor.md#key-bindings)
- [Console](../plugins/console.md#key-bindings)
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nav:
- usage/key_bindings.md
- Plugins:
- plugins/Cell.md
- plugins/Console.md
- plugins/console.md
- plugins/Editors.md
- plugins/File_browser.md
- plugins/Image_viewer.md
Expand Down
2 changes: 2 additions & 0 deletions plugins/cell/txl_cell/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __init__(self, ycell, show_border: bool = True, *args, **kwargs):
self._selected = False
self.set_styles(css="height: auto; max-height: 100%;")
self.is_code = ycell["cell_type"] == "code"
if not show_border:
self.set_styles(css="border: none;")
if self.is_code and show_border:
self.set_styles(css="border: round yellow;")

Expand Down
4 changes: 2 additions & 2 deletions plugins/console/txl_console/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def on_select_kernel(self):
ycell=self.ynb.ycells[self.cell_i],
language=self.language,
kernel=self.kernel,
show_execution_count=False,
show_execution_count=True,
show_border=False,
)
self.mount(cell)
Expand All @@ -82,7 +82,7 @@ def on_change(self, target, events):
ycell=c,
language=self.language,
kernel=self.kernel,
show_execution_count=False,
show_execution_count=True,
show_border=False,
)
if not self.cells:
Expand Down

0 comments on commit 942f57e

Please sign in to comment.