Skip to content

Commit

Permalink
코랩/런팟 노트북 출력창에 표시되는 줄 수 제한, 기본값 40줄
Browse files Browse the repository at this point in the history
  • Loading branch information
sumof2primes committed Apr 8, 2023
1 parent 25841f6 commit 25fcaf4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 20 deletions.
38 changes: 28 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2645,16 +2645,16 @@ def setup(self):
display(
HTML(
f"""
<style>
.jp-OutputArea-child {{
max-height: {DISPLAY_OUTPUT_LINES}em;
}}
.jp-OutputArea-child .jp-OutputArea-output {{
overflow: auto;
}}
</style>
"""
<style>
.jp-OutputArea-child {{
max-height: {DISPLAY_OUTPUT_LINES}em;
}}
.jp-OutputArea-child .jp-OutputArea-output {{
overflow: auto;
}}
</style>
"""
)
)

Expand Down Expand Up @@ -2757,6 +2757,24 @@ def force_virtualenv():

class JupyterLauncher(WindowsPlatform):
def setup(self):
# 주피터 출력창 스크롤 높이 조정
from IPython.display import display, HTML

display(
HTML(
f"""
<style>
.jp-OutputArea-child {{
max-height: {DISPLAY_OUTPUT_LINES}em;
}}
.jp-OutputArea-child .jp-OutputArea-output {{
overflow: auto;
}}
</style>
"""
)
)
super().setup()

def start(self, inbrowser=False):
Expand Down
38 changes: 28 additions & 10 deletions notebooks/SD-Web-UI-Launcher.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2761,16 +2761,16 @@
" display(\n",
" HTML(\n",
" f\"\"\"\n",
" <style>\n",
" .jp-OutputArea-child {{\n",
" max-height: {DISPLAY_OUTPUT_LINES}em;\n",
" }}\n",
"\n",
" .jp-OutputArea-child .jp-OutputArea-output {{\n",
" overflow: auto;\n",
" }}\n",
" </style>\n",
" \"\"\"\n",
" <style>\n",
" .jp-OutputArea-child {{\n",
" max-height: {DISPLAY_OUTPUT_LINES}em;\n",
" }}\n",
"\n",
" .jp-OutputArea-child .jp-OutputArea-output {{\n",
" overflow: auto;\n",
" }}\n",
" </style>\n",
" \"\"\"\n",
" )\n",
" )\n",
"\n",
Expand Down Expand Up @@ -2873,6 +2873,24 @@
"\n",
"class JupyterLauncher(WindowsPlatform):\n",
" def setup(self):\n",
" # 주피터 출력창 스크롤 높이 조정\n",
" from IPython.display import display, HTML\n",
"\n",
" display(\n",
" HTML(\n",
" f\"\"\"\n",
" <style>\n",
" .jp-OutputArea-child {{\n",
" max-height: {DISPLAY_OUTPUT_LINES}em;\n",
" }}\n",
"\n",
" .jp-OutputArea-child .jp-OutputArea-output {{\n",
" overflow: auto;\n",
" }}\n",
" </style>\n",
" \"\"\"\n",
" )\n",
" )\n",
" super().setup()\n",
"\n",
" def start(self, inbrowser=False):\n",
Expand Down

0 comments on commit 25fcaf4

Please sign in to comment.