-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtouchipynb.sh
More file actions
executable file
·46 lines (40 loc) · 873 Bytes
/
touchipynb.sh
File metadata and controls
executable file
·46 lines (40 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# USAGE:
# jupynote.sh [TITLE]
# DESCRIPTION: quickly create .qmd notebook for jupyter lab like work
# take first command line argument
TITLE=$1
# set filename
FILENAME="${TITLE:-Untitled}-$(date -u +%Y%m%d).ipynb"
# create new file
touch "${FILENAME}"
echo "{
\"cells\": [
{
\"cell_type\": \"markdown\",
\"metadata\": {},
\"source\": [
\"\"
]
}
],
\"metadata\": {
\"kernelspec\": {
\"display_name\": \"Python 3\",
\"language\": \"python\",
\"name\": \"python3\"
},
\"language_info\": {
\"codemirror_mode\": {
\"name\": \"ipython\"
},
\"file_extension\": \".py\",
\"mimetype\": \"text/x-python\",
\"name\": \"python\",
\"nbconvert_exporter\": \"python\",
\"pygments_lexer\": \"ipython3\"
}
},
\"nbformat\": 4,
\"nbformat_minor\": 5
}" >>${FILENAME}