Skip to content

Commit 9345da7

Browse files
committed
Add another example notebook
1 parent e4d5c10 commit 9345da7

8 files changed

Lines changed: 7603 additions & 6 deletions

File tree

frontend/public/notebooks/example_2.html

Lines changed: 7543 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# AnothereExample notebook with metadata section"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"# Example metadata that can be parsed for display in the SWOTVIZ app\n",
17+
"META_TITLE = \"Another Example metadata tile\"\n",
18+
"META_SUBTITLE = \"Subtitle extracted from the notebook\"\n",
19+
"META_DESCRIPTION = \"This will get synced to https://www.hydroshare.org/resource/ff48614339034212bb7b31cb719c0aa0/data/contents/example_metadata_parsing2.ipynb\""
20+
]
21+
}
22+
],
23+
"metadata": {
24+
"kernelspec": {
25+
"display_name": "venv",
26+
"language": "python",
27+
"name": "python3"
28+
},
29+
"language_info": {
30+
"codemirror_mode": {
31+
"name": "ipython",
32+
"version": 3
33+
},
34+
"file_extension": ".py",
35+
"mimetype": "text/x-python",
36+
"name": "python",
37+
"nbconvert_exporter": "python",
38+
"pygments_lexer": "ipython3",
39+
"version": "3.12.3"
40+
}
41+
},
42+
"nbformat": 4,
43+
"nbformat_minor": 4
44+
}

frontend/public/notebooks/example_metadata_parsing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7531,7 +7531,7 @@ <h1 id="Example-notebook-with-metadata-section">Example notebook with metadata s
75317531
<div class="highlight hl-ipython3"><pre><span></span><span class="c1"># Example metadata that can be parsed for display in the SWOTVIZ app</span>
75327532
<span class="n">META_TITLE</span> <span class="o">=</span> <span class="s2">"Example metadata tile"</span>
75337533
<span class="n">META_SUBTITLE</span> <span class="o">=</span> <span class="s2">"This is a subtitle"</span>
7534-
<span class="n">META_DESCRIPTION</span> <span class="o">=</span> <span class="s2">"This is a description of the metadata tile. It can be as long as you want it to be."</span>
7534+
<span class="n">META_DESCRIPTION</span> <span class="o">=</span> <span class="s2">"This is a description of the notebook. This notebook will be synced to https://www.hydroshare.org/resource/ff48614339034212bb7b31cb719c0aa0/data/contents/example_metadata_parsing.ipynb"</span>
75357535
</pre></div>
75367536
</div>
75377537
</div>

frontend/public/notebooks/example_metadata_parsing.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"# Example metadata that can be parsed for display in the SWOTVIZ app\n",
1717
"META_TITLE = \"Example metadata tile\"\n",
1818
"META_SUBTITLE = \"This is a subtitle\"\n",
19-
"META_DESCRIPTION = \"This is a description of the notebook.\""
19+
"META_DESCRIPTION = \"This is a description of the notebook. This notebook will be synced to https://www.hydroshare.org/resource/ff48614339034212bb7b31cb719c0aa0/data/contents/example_metadata_parsing.ipynb\""
2020
]
2121
}
2222
],

frontend/src/notebooks.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@ export const notebooks = [
22
{
33
filename: 'SWOT_GISshapefiles.ipynb'
44
},
5+
{
6+
filename: 'example_2.ipynb',
7+
META_TITLE: 'Another Example metadata tile',
8+
META_SUBTITLE: 'Subtitle extracted from the notebook',
9+
META_DESCRIPTION:
10+
'This will get synced to https://www.hydroshare.org/resource/ff48614339034212bb7b31cb719c0aa0/data/contents/example_metadata_parsing2.ipynb'
11+
},
512
{
613
filename: 'example_metadata_parsing.ipynb',
714
META_TITLE: 'Example metadata tile',
815
META_SUBTITLE: 'This is a subtitle',
9-
META_DESCRIPTION: 'This is a description of the notebook.'
16+
META_DESCRIPTION:
17+
'This is a description of the notebook. This notebook will be synced to https://www.hydroshare.org/resource/ff48614339034212bb7b31cb719c0aa0/data/contents/example_metadata_parsing.ipynb'
1018
}
1119
]

nbconvert/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM quay.io/jupyter/base-notebook:python-3.11.10
2-
COPY ./notebooks /notebooks
32
COPY requirements.txt /
43

54
WORKDIR /
65

76
RUN pip install --upgrade pip \
87
&& pip install -r requirements.txt
98

10-
RUN jupyter nbconvert --to html /notebooks/*.ipynb --output-dir=/home/jovyan/dist
9+
CMD ["/bin/bash", "-c", "tail -f /dev/null"]
10+

nbconvert/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ services:
66
dockerfile: Dockerfile
77
context: ./
88
container_name: nbconvert
9-
# override the default command with simple bash command to keep the container running
9+
volumes:
10+
- ./notebooks:/notebooks
1011
entrypoint: ["/bin/bash", "-c", "tail -f /dev/null"]

nbconvert/nbconvert.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cp $NOTEBOOK_DIR/*.ipynb notebooks/
1111

1212
# run nbconvert on the notebooks
1313
docker-compose up nbconvert -d
14+
docker-compose exec nbconvert jupyter nbconvert --to html /notebooks/*.ipynb --output-dir=/home/jovyan/dist/
1415
docker cp nbconvert:/home/jovyan/dist/. $NOTEBOOK_DIR
1516
docker-compose down
1617

0 commit comments

Comments
 (0)