Skip to content

Commit 3d48fbb

Browse files
committed
add missing frontmatter
1 parent 582a536 commit 3d48fbb

File tree

4 files changed

+25
-44
lines changed

4 files changed

+25
-44
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11
name: Deploy to GitHub Pages
2-
32
on:
43
push:
5-
branches:
6-
- master
4+
branches: [master]
75
workflow_dispatch:
8-
96
jobs:
107
deploy:
11-
name: Deploy to GitHub Pages
128
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v3
16-
with:
17-
python-version: "3.10"
18-
architecture: "x64"
19-
- name: Install Dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install -U fastcore
23-
pip install -U execnb
24-
pip install -e ".[dev]"
25-
- name: Build website
26-
run: nbdev_docs
27-
- name: Deploy to GitHub Pages
28-
uses: peaceiris/actions-gh-pages@v3
29-
with:
30-
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
force_orphan: true
32-
publish_dir: ./_docs
33-
# The following lines assign commit authorship to the official
34-
# GH-Actions bot for deploys to `gh-pages` branch:
35-
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
36-
# The GH actions bot is used by default if you didn't specify the two fields.
37-
# You can swap them out with your own user credentials.
38-
user_name: github-actions[bot]
39-
user_email: 41898282+github-actions[bot]@users.noreply.github.com
9+
steps: [uses: fastai/workflows/quarto-ghp@master]

nbdev/cli.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def nbdev_sidebar(
7878
yml_path.write_text(yml)
7979
if returnit: return files
8080

81-
# %% ../nbs/10_cli.ipynb 9
81+
# %% ../nbs/10_cli.ipynb 10
8282
class FilterDefaults:
8383
"Override `FilterDefaults` to change which notebook processors are used"
8484
def _nothing(self): return []
@@ -107,7 +107,7 @@ def nb_proc(self, nb):
107107
"Get an `NBProcessor` with these processors"
108108
return NBProcessor(nb=nb, procs=self.procs(), preprocs=self.preprocs(), postprocs=self.postprocs())
109109

110-
# %% ../nbs/10_cli.ipynb 10
110+
# %% ../nbs/10_cli.ipynb 11
111111
@call_parse
112112
def nbdev_filter(
113113
nb_txt:str=None, # Notebook text (uses stdin if not provided)
@@ -129,7 +129,7 @@ def nbdev_filter(
129129
if printit: print(res, flush=True)
130130
else: return res
131131

132-
# %% ../nbs/10_cli.ipynb 13
132+
# %% ../nbs/10_cli.ipynb 14
133133
_re_version = re.compile('^__version__\s*=.*$', re.MULTILINE)
134134

135135
def update_version():
@@ -161,12 +161,12 @@ def nbdev_bump_version(
161161
update_version()
162162
print(f'New version: {cfg.version}')
163163

164-
# %% ../nbs/10_cli.ipynb 15
164+
# %% ../nbs/10_cli.ipynb 16
165165
def extract_tgz(url, dest='.'):
166166
from fastcore.net import urlopen
167167
with urlopen(url) as u: tarfile.open(mode='r:gz', fileobj=u).extractall(dest)
168168

169-
# %% ../nbs/10_cli.ipynb 16
169+
# %% ../nbs/10_cli.ipynb 17
170170
def _get_info(owner, repo, default_branch='main', default_kw='nbdev'):
171171
try: from ghapi.all import GhApi
172172
except:
@@ -189,7 +189,7 @@ def _get_info(owner, repo, default_branch='main', default_kw='nbdev'):
189189

190190
return r.default_branch, default_kw if not r.topics else ' '.join(r.topics), r.description
191191

192-
# %% ../nbs/10_cli.ipynb 18
192+
# %% ../nbs/10_cli.ipynb 19
193193
def prompt_user(**kwargs):
194194
config_vals = kwargs
195195
print('================ nbdev Configuration ================\n')
@@ -202,7 +202,7 @@ def prompt_user(**kwargs):
202202
print(f"\n`settings.ini` updated with configuration values.")
203203
return config_vals
204204

205-
# %% ../nbs/10_cli.ipynb 19
205+
# %% ../nbs/10_cli.ipynb 20
206206
def _fetch_from_git(raise_err=False):
207207
"Get information for settings.ini from the user."
208208
try:
@@ -217,7 +217,7 @@ def _fetch_from_git(raise_err=False):
217217
return dict(lib_name=repo.replace('-', '_'), user=owner, branch=branch, author=author,
218218
author_email=email, keywords=keywords, description=descrip, repo=repo)
219219

220-
# %% ../nbs/10_cli.ipynb 21
220+
# %% ../nbs/10_cli.ipynb 22
221221
_quarto_yml="""ipynb-filters: [nbdev_filter]
222222
223223
project:
@@ -267,7 +267,7 @@ def refresh_quarto_yml():
267267
yml=_quarto_yml.format(**vals)
268268
p.write_text(yml)
269269

270-
# %% ../nbs/10_cli.ipynb 22
270+
# %% ../nbs/10_cli.ipynb 23
271271
@call_parse
272272
def nbdev_new():
273273
"Create a new project from the current git repo"
@@ -295,12 +295,12 @@ def nbdev_new():
295295
settings_path.write_text(settings)
296296
refresh_quarto_yml()
297297

298-
# %% ../nbs/10_cli.ipynb 24
298+
# %% ../nbs/10_cli.ipynb 25
299299
def _sprun(cmd):
300300
try: subprocess.check_output(cmd, shell=True)
301301
except subprocess.CalledProcessError as cpe: sys.exit(cpe.returncode)
302302

303-
# %% ../nbs/10_cli.ipynb 25
303+
# %% ../nbs/10_cli.ipynb 26
304304
@call_parse
305305
def nbdev_quarto(
306306
path:str=None, # Path to notebooks

nbs/10_cli.ipynb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@
136136
" if returnit: return files"
137137
]
138138
},
139+
{
140+
"cell_type": "code",
141+
"execution_count": null,
142+
"id": "7b04052d",
143+
"metadata": {},
144+
"outputs": [],
145+
"source": [
146+
"# nbdev_sidebar(printit=True, force=True)"
147+
]
148+
},
139149
{
140150
"cell_type": "markdown",
141151
"id": "e9fc60a8",

nbs/11_clean.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"source": [
77
"---\n",
88
"title: clean\n",
9+
"output-file: clean.html\n",
910
"description: Strip superfluous metadata from notebooks\n",
1011
"---"
1112
]
@@ -388,7 +389,7 @@
388389
"split_at_heading": true
389390
},
390391
"kernelspec": {
391-
"display_name": "Python 3.9.13 64-bit",
392+
"display_name": "Python 3 (ipykernel)",
392393
"language": "python",
393394
"name": "python3"
394395
}

0 commit comments

Comments
 (0)