jupyter notebook更換面板主題的實現
阿新 • • 發佈:2021-01-11
jupyter notebook更換面板主題
視訊地址:https://www.bilibili.com/video/BV1Et4y1D7ru/
您是否厭倦了jupyter notebook的預設主題呢?
您是否想過能不能讓jupyter notebook的介面更加高大上一點呢?
您是否想一天換一個jupyter notebook的主題呢?
有了jupyterthemes,我可以!
下載jupyterthemes
我們可以通過pip來安裝jupyterthemes
pip install jupyterthemes
也可以通過下列命令來更新jupyterthemes到最新版本
pip install --upgrade jupyterthemes
使用jupyterthemes
那麼下載完成後,我們可以在終端使用jupyter-theme命令來更改notebook主題
jupyter-theme -h # 檢視jupyter-theme的幫助手冊
您也可以通過jupyter-theme的命令簡寫jt來使用
jt -h # 檢視jupyter-theme的幫助手冊
強烈推薦第二種方式,因為懶惰是程式設計師的基本美德
jupyter-theme引數詳解
功能介紹 | 選項引數 | 預設值 |
---|---|---|
檢視幫助文件 | -h | -- |
展示所有的面板主題 | -l | -- |
設定安裝的主題 | -t | -- |
設定程式碼字型樣式 | -f | -- |
設定程式碼字型大小 | -fs | 11 |
設定notebook的字型樣式 | -nf | -- |
設定notebook的字型大小 | -nfs | 13 |
設定text/md的cell字型樣式 | -tf | -- |
設定text/md的cell字型大小 | -tfs | 13 |
設定Pandas的DataFrame字型大小 | -dfs | 9 |
設定輸出區域的字型大小 | -ofs | 8.5 |
設定Mathjax的字型大小(%) | -mathfs | 100 |
設定頁面的margin外邊距 | -m | auto |
設定Cell的寬度 | -cellw | 980 |
設定行高 | -lineh | 170 |
設定游標的寬度 | -cursw | 2 |
設定游標的顏色 | -cursc | -- |
Alt Prompt Layout | -altp | -- |
Alt Markdown BG Color | -altmd | -- |
Alt Output BG Color | -altout | -- |
Style Vim NBExt* | -vim | -- |
Toolbar是否可見 | -T | -- |
檔名和Logo是否可見 | -N | -- |
核心的Logo是否可見 | -kl | -- |
重置為預設的notebook主題 | -r | -- |
重置為預設的字型 | -dfonts | -- |
code cells的可選字型樣式
-f arg | Monospace Font |
---|---|
anka | Anka/Coder |
anonymous | Anonymous Pro |
aurulent | Aurulent Sans Mono |
bitstream | Bitstream Vera Sans Mono |
bpmono | BPmono |
code | Code New Roman |
consolamono | Consolamono |
cousine | Cousine |
dejavu | DejaVu Sans Mono |
droidmono | Droid Sans Mono |
fira | Fira Mono |
firacode | Fira Code |
generic | Generic Mono |
hack | Hack |
hasklig | Hasklig |
inconsolata | Inconsolata-g |
inputmono | Input Mono |
iosevka | Iosevka |
liberation | Liberation Mono |
meslo | Meslo |
office | Office Code Pro |
oxygen | Oxygen Mono |
roboto | Roboto Mono |
saxmono | saxMono |
source | Source Code Pro |
sourcemed | Source Code Pro Medium |
ptmono | PT Mono |
ubuntu | Ubuntu Mono |
notebook與text/md cells的可選字型樣式
Sans-Serif Fonts
-nf/-tf arg | Sans-Serif Font |
---|---|
opensans | Open Sans |
droidsans | Droid Sans |
exosans | Exo_2 |
latosans | Lato |
ptsans | PT Sans |
robotosans | Roboto |
sourcesans | Source Sans Pro |
Serif Fonts
-nf/-tf arg | Serif Font |
---|---|
loraserif | Lora |
ptserif | PT Serif |
georgiaserif | Georgia |
cardoserif | Cardo |
crimsonserif | Crimson Text |
ebserif | EB Garamond |
merriserif | Merriweather |
neutonserif | Neuton |
goudyserif | Sorts Mill Goudy |
jupyter-theme使用示例
# 檢視所有可選主題 # chesterish | grade3 | gruvboxd | gruvboxl | monokai | oceans16 | onedork | solarizedd | solarizedl jt -l # 切換使用grade3主題 # 一般重新整理notebook頁面就可以看到效果,如果沒起作用的話,可能需要刪除一下瀏覽器的快取 jt -t grade3 # 重置notebook的主題,回到解放前 jt -r # 預設展示工具箱以及檔名 jt -t monokai -T -N # 設定notebook介面和text/md cells的字型樣式,並且設定字型大小 # 字型大小的單位為pt jt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13 # 設定cell的寬度與行高 # 可以通過百分比來設定寬度 jt -t chesterish -cellw 90% -lineh 170 # 通過畫素px來設定cell的寬度,設定為860px jt -t solarizedd -cellw 860 # 設定游標變成紅色,並且將其大小變為5px # 可選的顏色 b (blue),o (orange),r (red),p (purple),g (green),x (font color) jt -t solarizedl -cursc r -cursw 5
jupyter-theme可用主題一覽
預設主題
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
到此這篇關於jupyter notebook更換面板主題的實現的文章就介紹到這了,更多相關jupyter notebook更換面板內容請搜尋我們以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援我們!