23

This question has to do with getting Jupyter Notebook docstring functionality to work in Atom. I appreciate any and all advisement.

Jupyter Notebook

In the Jupyter Notebook you are able to access the docstring via shift-tab and expand and scroll through the docstring as well as select and copy-paste from it into the cells.

Atom Editor running IPykernel

In the Atom Editor running the IPykernel I can see part of the docstring via autocomplete-python package, but I am unable to scroll through the docstring's full length, nor am I able to select from it for copy-pasting.

I cannot find a hotkey to make Atom open a browsable and selectable docstring as in Jupyter Notebook. Anybody have any ideas?

My keycap.cson file contains the following:

 'atom-text-editor': 'enter':
         'editor:newline' 'shift-tab': 'language-python: toggle-all-docstrings' 

But this does nothing....

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
reka18
  • 7,440
  • 5
  • 16
  • 37
  • 1
    My keycap.cson file contains the following: 'atom-text-editor': 'enter': 'editor:newline' 'shift-tab': 'language-python: toggle-all-docstrings' But this does nothing.... – reka18 Sep 14 '17 at 04:09
  • That comment should be an edit to the question; as you can see, pasting CSON into a common makes it difficult to read. – Dan Lowe Sep 15 '17 at 15:32
  • 1
    Advise take and applied. – reka18 Sep 15 '17 at 15:36
  • Well I suppose this is irrelevant now since I have been happily using VS Code for the last 3 months. – reka18 Jun 08 '18 at 15:06
  • I would like to add that if you want to use shift+tab like in Jupyter Notebook, you need to add this line to keymap.cson 'atom-text-editor:not([mini])': 'shift-tab': 'hydrogen:toggle-inspector' (shift-tab is on new line) – Biarys Aug 17 '18 at 12:33

1 Answers1

19

I added the bounty but I actually managed to figure out the answer.

1) Download a package called hydrogen from the packages in atom.
2) Go to your .py file in atom and hold ctrl-shift-p. A search bar will pop up
3) type hydrogen: toggle inspector and a window will pop at the bottom
4) go to the variable where you want to view the strings and simply press alt-i. That is the equivalent of tab in the Jupiter notebook

  • 1
    I would like to add that if you want to use shift+tab like in Jupyter Notebook, you need to add this line to keymap.cson `'atom-text-editor:not([mini])': 'shift-tab': 'hydrogen:toggle-inspector'` (shift-tab is on new line) – Biarys Aug 13 '18 at 18:09
  • @Biarys please included in the edit in the same answer above so other users can see it –  Aug 16 '18 at 07:43
  • you mean create a separate answer or add comment on the op? – Biarys Aug 17 '18 at 14:18
  • 3
    `toggle inspector` doesn't show up in my hydrogen drop down... – DanGoodrick Jan 13 '20 at 19:47