Skip to content

Instantly share code, notes, and snippets.

@tommct
Last active December 23, 2020 17:27
Show Gist options
  • Save tommct/69111d4661a64466f07c95c07a3f6536 to your computer and use it in GitHub Desktop.
Save tommct/69111d4661a64466f07c95c07a3f6536 to your computer and use it in GitHub Desktop.
Jupyter Themes
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook allows us to see different jupyter themes.\n",
"\n",
"See\n",
" * https://github.com/dunovank/jupyter-themes\n",
" * https://towardsdatascience.com/bringing-the-best-out-of-jupyter-notebooks-for-data-science-f0871519ca29\n",
"\n",
"The following command lists the available named themes."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Available Themes: \r\n",
" chesterish\r\n",
" grade3\r\n",
" gruvboxd\r\n",
" gruvboxl\r\n",
" monokai\r\n",
" oceans16\r\n",
" onedork\r\n",
" solarizedd\r\n",
" solarizedl\r\n"
]
}
],
"source": [
"!jt -l"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Modify the cell below to play with different options.\n",
"\n",
"Set to one of the themes and other options, save the notebook, and then hit the `RELOAD` button in the browser."
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"!jt -t onedork -fs 11 -altp -tfs 11 -nfs 115 -ofs 10 -cellw 97% -T"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"!jt -t onedork -dfonts -cellw 97% -T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Hard reset\n",
"\n",
"To go back to the original defaults, execute the line below."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reset css and font defaults in:\r\n",
"/Users/tom/.jupyter/custom &\r\n",
"/Users/tom/Library/Jupyter/nbextensions\r\n"
]
}
],
"source": [
"!jt -r"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example\n",
"\n",
"The following is a code example."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Val was \"2\"\n"
]
},
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def add_int(val: int, x: int=2) -> int:\n",
" \"\"\"\n",
" This is how docstrings look.\n",
" \"\"\"\n",
" print(f'Val was \"{val}\"')\n",
" return val + x\n",
"\n",
"add_int(2, 3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment