generated from fastai/fast_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnb_md.sh
executable file
·60 lines (55 loc) · 3 KB
/
nb_md.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Note: Before running this script,
# 1) If you created the notebook locally
# a) format with Ruff by ensuring no cell is selected, then pressing Option+Shift+F on Mac (Alt+Shift+F on Windows)
# b) You can make it into a Google Colab by
# i) creating a new Google Colab on bertiewoostersharing@gmail.com account
# ii) choosing File > Upload notebook
# 2) If you downloaded the notebook from Google Colab, replace file name underscores with hyphens
# 3) If you want to embed an image in the notebook rather than importing it from an external file,
# a) Set up Markdown cell with <img src="" />
# b) Convert image to Base64 at https://www.base64-image.de/ (can be JPG, PNG, GIF, WebP, SVG or BMP, up to 1MB)
# c) Paste the <img> output (starting with data:image/) into the quotes in the img tag
# 4) Change the name of the notebook (input) and markdown (output) files in the non-commented code below
# 5) Save this script
# 6) Use venv in this folder, not conda, in terminal using
# . venv/bin/activate
# Run this script in the terminal using:
# ./nb_md.sh
jupyter nbconvert _notebooks/2025-01-11-Drawing-Molecules-With-Indigo.ipynb --to markdown --output 2025-01-11-Drawing-Molecules-With-Indigo.md
# Note: After running this script, to post a blog post:
# 1) Move the markdown file into the _posts folder
# 2) Move the _files folder (containing the images) into the images folder
# ----- The rest of these instructions are for the markdown file -----
# 3) Fix the image links in the markdown file by converting e.g.
# 
# to
# 
# by replacing
#  If there are any svg images, do likewise-- replace
#  If you have a link to an image in the top-level /images folder, in the markdown file, replace
# ../images
# with
# /images
# 5) Add alt tags to Jupyter images by replacing ![png] or ![svg] with a description, e.g. ![Annotated tree]
# 6) If notebook had molframe graphs, delete from
# <style>*[data-root-id]
# to the </div> after
# float: left'></img>
#
# and from
# <div id='p
# to
# })(window);</script>
# (You can triple-click on the enormous block of text to select it)
# ---If you downloaded the notebook from Google Colab; if not, create the Google Colab version and do the opposite to it---
# 7) Delete the first paragraph:
# *Blog post by [Jeremy Monat](https://bertiewooster.github.io/)*
# 8) Add, to the end of the first section:
# *[Open this notebook in Google Colab](link) so you can run it without installing anything on your computer*