Skip to content

Commit a3ba998

Browse files
committed
Add browse_auto_height docs, related tweak
1 parent bc7fc2d commit a3ba998

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

Diff for: nbs/09_magics.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@
459459
"@patch_to(StataMagics)\n",
460460
"def magic(self, code, kernel, cell):\n",
461461
" try:\n",
462-
" if not kernel.ipydatagrid_height_set:\n",
462+
" if kernel.nbstata_config.browse_auto_height and not kernel.ipydatagrid_height_set:\n",
463463
" browse.set_ipydatagrid_height()\n",
464464
" kernel.ipydatagrid_height_set = True\n",
465465
" name, code = self._parse_code_for_magic(code)\n",

Diff for: nbs/15_install.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
"graph_height = 4in\n",
195195
"echo = None\n",
196196
"missing = .\n",
197+
"browse_auto_height = True\n",
197198
"\n"
198199
]
199200
}

Diff for: nbs/images/status example.png

47.7 KB
Loading

Diff for: nbs/user_guide.ipynb

+10
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
" - 'False': the kernel will not echo single-line commands.\n",
124124
" - 'None': the kernel will not echo any command. \n",
125125
"- `missing`: What to display for a missing value in the output of the `%browse`, `%head`, and `%tail` magics. Default is '.', following Stata. To defer to pandas's format for `NaN`, specify 'pandas'.\n",
126+
"- `browse_auto_height`: Whether to set 'height: 100%' for the [%browse](#browse-head-tail-and-frame-equivalents) widget (default: 'True'):\n",
127+
" - 'True': allows browse widget to expand to height of its container, such as when using 'Create New View for Output' in Jupyter Lab.\n",
128+
" - 'False': fixed height of around 22 rows, recommended for NBClassic and VSCode.\n",
126129
"\n",
127130
"Settings must be under the title `[nbstata]`. Not all settings need be included. Example:\n",
128131
"\n",
@@ -361,6 +364,13 @@
361364
"*Display Stata status and configuration values*"
362365
]
363366
},
367+
{
368+
"cell_type": "markdown",
369+
"metadata": {},
370+
"source": [
371+
"<img align=\"center\" width=\"500\" src=\"images/status example.png\" alt=\"%status example\">"
372+
]
373+
},
364374
{
365375
"cell_type": "markdown",
366376
"metadata": {},

Diff for: nbstata/magics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _do_magic(self, name, code, kernel, cell):
166166
@patch_to(StataMagics)
167167
def magic(self, code, kernel, cell):
168168
try:
169-
if not kernel.ipydatagrid_height_set:
169+
if kernel.nbstata_config.browse_auto_height and not kernel.ipydatagrid_height_set:
170170
browse.set_ipydatagrid_height()
171171
kernel.ipydatagrid_height_set = True
172172
name, code = self._parse_code_for_magic(code)

0 commit comments

Comments
 (0)