Skip to content

Commit 8963507

Browse files
committed
docs
1 parent 1e4bd63 commit 8963507

30 files changed

+177
-215
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
meta/
12
dlgs/
23
archived/
34
SOLVEIT.ipynb

README.md

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ Python packaging standards ([PEP
1414
lives in the standard `[project]` section, while nbdev-specific settings
1515
go in `[tool.nbdev]`.
1616

17-
**Migrating from nbdev2:** Run
18-
[`nbdev_migrate_config`](https://nbdev.fast.ai/api/migrate.html#nbdev_migrate_config)
19-
in your project root to automatically convert your `settings.ini` to
20-
`pyproject.toml` and update your GitHub Actions workflows to use
21-
nbdev3-compatible versions. Your existing notebooks and code don’t need
22-
any changes.
17+
**Migrating from nbdev2:** Run `nbdev-migrate-config` in your project
18+
root to automatically convert your `settings.ini` to `pyproject.toml`
19+
and update your GitHub Actions workflows to use nbdev3-compatible
20+
versions. Your existing notebooks and code don’t need any changes.
2321

2422
`nbdev` is a notebook-driven development platform. Simply write
2523
notebooks with lightweight markup and get high-quality documentation,
@@ -42,8 +40,7 @@ practices because tests and documentation are first class.
4240
- **Two-way sync between notebooks and plaintext source code** allowing
4341
you to use your IDE for code navigation or quick edits. Sync is
4442
robust: each exported cell is tagged with its unique notebook cell ID,
45-
so [`nbdev_update`](https://nbdev.fast.ai/api/sync.html#nbdev_update)
46-
always updates the correct cell
43+
so `nbdev-update` always updates the correct cell
4744
- **Tests** written as ordinary notebook cells are run in parallel with
4845
a single command
4946
- **Continuous integration** out-of-the-box with [GitHub
@@ -85,47 +82,47 @@ walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
8582
using the `unsilence` Python library – it’s 27 minutes faster, but a bit
8683
harder to follow.
8784

88-
You can also run `nbdev_help` from the terminal to see the full list of
85+
You can also run `nbdev-help` from the terminal to see the full list of
8986
available commands:
9087

9188
``` python
92-
!nbdev_help
89+
!nbdev-help
9390
```
9491

95-
nb_export Export a single nbdev notebook to a python script.
96-
nbdev_bump_version Increment version in __init__.py by one
97-
nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
98-
nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
99-
nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
100-
nbdev_contributing Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.
101-
nbdev_create_config Create a pyproject.toml config file.
102-
nbdev_docs Create Quarto docs and README.md
103-
nbdev_export Export notebooks in `path` to Python modules
104-
nbdev_filter A notebook filter for Quarto
105-
nbdev_fix Create working notebook from conflicted notebook `nbname`
106-
nbdev_help Show help for all console scripts
107-
nbdev_install Install Quarto and the current library
108-
nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
109-
nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
110-
nbdev_merge Git merge driver for notebooks
111-
nbdev_migrate Convert all markdown and notebook files in `path` from v1 to v2
112-
nbdev_migrate_config Migrate settings.ini to pyproject.toml
113-
nbdev_new Create an nbdev project.
114-
nbdev_prepare Export, test, and clean notebooks, and render README if needed
115-
nbdev_preview Preview docs locally
116-
nbdev_proc_nbs Process notebooks in `path` for docs rendering
117-
nbdev_pypi Create and upload Python package to PyPI
118-
nbdev_readme Create README.md from readme_nb (index.ipynb by default)
119-
nbdev_release_both Release both conda and PyPI packages
120-
nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
121-
nbdev_release_git Tag and create a release in GitHub for the current version
122-
nbdev_requirements Writes a `requirements.txt` file to `directory` based on pyproject.toml.
123-
nbdev_sidebar Create sidebar.yml
124-
nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
125-
nbdev_trust Trust notebooks matching `fname`.
126-
nbdev_update Propagate change in modules matching `fname` to notebooks that created them
127-
nbdev_update_license Allows you to update the license of your project.
128-
watch_export Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available
92+
nb-export Export a single nbdev notebook to a python script.
93+
nbdev-bump-version Increment version in __init__.py by one
94+
nbdev-changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
95+
nbdev-clean Clean all notebooks in `fname` to avoid merge conflicts
96+
nbdev-conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
97+
nbdev-contributing Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.
98+
nbdev-create-config Create a pyproject.toml config file.
99+
nbdev-docs Create Quarto docs and README.md
100+
nbdev-export Export notebooks in `path` to Python modules
101+
nbdev-filter A notebook filter for Quarto
102+
nbdev-fix Create working notebook from conflicted notebook `nbname`
103+
nbdev-help Show help for all console scripts
104+
nbdev-install Install Quarto and the current library
105+
nbdev-install-hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
106+
nbdev-install-quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
107+
nbdev-merge Git merge driver for notebooks
108+
nbdev-migrate Convert all markdown and notebook files in `path` from v1 to v2
109+
nbdev-migrate-config Migrate settings.ini to pyproject.toml
110+
nbdev-new Create an nbdev project.
111+
nbdev-prepare Export, test, and clean notebooks, and render README if needed
112+
nbdev-preview Preview docs locally
113+
nbdev-proc-nbs Process notebooks in `path` for docs rendering
114+
nbdev-pypi Create and upload Python package to PyPI
115+
nbdev-readme Create README.md from readme_nb (index.ipynb by default)
116+
nbdev-release-both Release both conda and PyPI packages
117+
nbdev-release-gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
118+
nbdev-release-git Tag and create a release in GitHub for the current version
119+
nbdev-requirements Writes a `requirements.txt` file to `directory` based on pyproject.toml.
120+
nbdev-sidebar Create sidebar.yml
121+
nbdev-test Test in parallel notebooks matching `path`, passing along `flags`
122+
nbdev-trust Trust notebooks matching `fname`.
123+
nbdev-update Propagate change in modules matching `fname` to notebooks that created them
124+
nbdev-update-license Allows you to update the license of your project.
125+
watch-export Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available
129126

130127
## FAQ
131128

@@ -204,8 +201,7 @@ strive to abide by generally accepted best practices in open-source
204201
software development.
205202

206203
Make sure you have `nbdev`’s git hooks installed by running
207-
[`nbdev_install_hooks`](https://nbdev.fast.ai/api/clean.html#nbdev_install_hooks)
208-
in the cloned repository.
204+
`nbdev-install-hooks` in the cloned repository.
209205

210206
## Copyright
211207

nbdev/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ def _find_nbdev_pyproject(path=None):
163163
if f.exists() and _has_nbdev(f): return f
164164
for d in [p] + list(p.parents):
165165
if (d/'settings.ini').exists():
166-
raise ValueError(f"Found old settings.ini. Migrate to pyproject.toml using `nbdev_migrate_config`. See https://nbdev.fast.ai/getting_started.html")
166+
raise ValueError(f"Found old settings.ini. Migrate to pyproject.toml using `nbdev-migrate-config`. See https://nbdev.fast.ai/getting_started.html")
167167

168168
# %% ../nbs/api/01_config.ipynb #3dac70e0
169169
nbdev_defaults = dict(nbs_path='nbs', doc_path='_docs', tst_flags='notest', recursive=True, readme_nb='index.ipynb',
170-
clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, branch='main',
170+
clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, custom_sidebar=False, branch='main',
171171
doc_procs=[], export_procs=[])
172172

173173
_path_keys = 'lib_path', 'nbs_path', 'doc_path'

nbdev/doclinks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _iter_py_cells(p):
6464
nb = ' '.join(parts[:-1])
6565
else:
6666
raise ValueError(f"Cell ID required but not found in '{p}' at:\n```\n# %% {top}\n```\n"
67-
"Run `nbdev_export` to regenerate .py files with cell IDs.")
67+
"Run `nbdev-export` to regenerate .py files with cell IDs.")
6868
if nb=='auto': continue # Skip auto-generated __all__ cell
6969
nb_path = (p.parent/nb).resolve() # NB paths are stored relative to .py file
7070
if code.endswith('\n'): code=code[:-1]
@@ -147,7 +147,7 @@ def nbdev_export(
147147
**kwargs):
148148
"Export notebooks in `path` to Python modules"
149149
if os.environ.get('IN_TEST',0): return
150-
if not is_nbdev(): raise Exception('`nbdev_export` must be called from a directory within a nbdev project.')
150+
if not is_nbdev(): raise Exception('`nbdev-export` must be called from a directory within a nbdev project.')
151151
cfg = get_config()
152152
procs = procs.split() if procs else cfg.get('export_procs', [])
153153
procs = [import_obj(p) for p in procs] if procs else None

nbdev/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def nb_export(nbname:str, # Filename of notebook
5353
nm = ifnone(name, getattr(exp, 'default_exp', None) if mod=='#' else mod)
5454
if not nm:
5555
warn(f"Notebook '{nbname}' uses `#| export` without `#| default_exp` cell.\n"
56-
"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\n"
56+
"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev-migrate` to upgrade.\n"
5757
"See https://nbdev.fast.ai/getting_started.html for more information.")
5858
return
5959
mm = mod_maker(dest=lib_path, name=nm, nb_path=nbname, is_new=bool(name) or mod=='#', solo_nb=solo_nb)

nbdev/quarto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _doc_mtime_not_older(readme_path, readme_nb_path):
223223

224224
# %% ../nbs/api/14_quarto.ipynb #7b70b5c8
225225
class _SidebarYmlRemoved:
226-
"Context manager for `nbdev_readme` to avoid rendering whole docs website"
226+
"Context manager for `nbdev-readme` to avoid rendering whole docs website"
227227
def __init__(self,path): self._path=path
228228
def __enter__(self):
229229
self._yml_path = self._path/'sidebar.yml'

nbdev/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def release_git(token:str=None):
127127
def release_gh(
128128
token:str=None # Optional GitHub token (otherwise `token` file is used)
129129
):
130-
"Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`"
130+
"Calls `nbdev-changelog`, lets you edit the result, then pushes to git and calls `nbdev-release-git`"
131131
cfg = _find_config()
132132
Release().changelog()
133133
subprocess.run([os.environ.get('EDITOR','nano'), cfg.config_path/'CHANGELOG.md'])

nbdev/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _update_mod(py_path, lib_dir):
7373
@call_parse
7474
def nbdev_update(fname:str=None): # A Python file name to update
7575
"Propagate change in modules matching `fname` to notebooks that created them"
76-
if fname and fname.endswith('.ipynb'): raise ValueError("`nbdev_update` operates on .py files. If you wish to convert notebooks instead, see `nbdev_export`.")
76+
if fname and fname.endswith('.ipynb'): raise ValueError("`nbdev-update` operates on .py files. If you wish to convert notebooks instead, see `nbdev-export`.")
7777
if os.environ.get('IN_TEST',0): return
7878
cfg = get_config()
7979
fname = Path(fname or cfg.lib_path)

nbs/api/01_config.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"source": [
7575
"nbdev is heavily customizeable, thanks to the configuration system defined in this module. There are 2 ways to interact with nbdev's config:\n",
7676
"\n",
77-
"- **In the terminal:** `nbdev_create_config` creates a `pyproject.toml` (if you're starting a new project use `nbdev_new` instead)\n",
77+
"- **In the terminal:** `nbdev-create-config` creates a `pyproject.toml` (if you're starting a new project use `nbdev-new` instead)\n",
7878
"- **In your library:** `get_config` returns a `ConfigToml` object.\n",
7979
"\n",
8080
"Read on for more about how these work."
@@ -303,7 +303,7 @@
303303
"You can create a `pyproject.toml` by passing settings via the command line:\n",
304304
"\n",
305305
"```sh\n",
306-
"nbdev_create_config --repo nbdev --user fastai --author fastai \\\n",
306+
"nbdev-create-config --repo nbdev --user fastai --author fastai \\\n",
307307
" --author_email info@fast.ai --description 'A test project'\n",
308308
"```\n",
309309
"\n",
@@ -343,7 +343,7 @@
343343
" if f.exists() and _has_nbdev(f): return f\n",
344344
" for d in [p] + list(p.parents):\n",
345345
" if (d/'settings.ini').exists():\n",
346-
" raise ValueError(f\"Found old settings.ini. Migrate to pyproject.toml using `nbdev_migrate_config`. See https://nbdev.fast.ai/getting_started.html\")"
346+
" raise ValueError(f\"Found old settings.ini. Migrate to pyproject.toml using `nbdev-migrate-config`. See https://nbdev.fast.ai/getting_started.html\")"
347347
]
348348
},
349349
{
@@ -355,7 +355,7 @@
355355
"source": [
356356
"#| export\n",
357357
"nbdev_defaults = dict(nbs_path='nbs', doc_path='_docs', tst_flags='notest', recursive=True, readme_nb='index.ipynb',\n",
358-
" clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, branch='main',\n",
358+
" clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, custom_sidebar=False, branch='main',\n",
359359
" doc_procs=[], export_procs=[])\n",
360360
"\n",
361361
"_path_keys = 'lib_path', 'nbs_path', 'doc_path'"
@@ -462,7 +462,7 @@
462462
"source": [
463463
"Searches up from `path` until a `pyproject.toml` with `[tool.nbdev]` is found. Unspecified optional settings return defaults.\n",
464464
"\n",
465-
"See `nbdev_create_config` for creating a new config."
465+
"See `nbdev-create-config` for creating a new config."
466466
]
467467
},
468468
{

nbs/api/04_export.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
" nm = ifnone(name, getattr(exp, 'default_exp', None) if mod=='#' else mod)\n",
143143
" if not nm:\n",
144144
" warn(f\"Notebook '{nbname}' uses `#| export` without `#| default_exp` cell.\\n\"\n",
145-
" \"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\\n\"\n",
145+
" \"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev-migrate` to upgrade.\\n\"\n",
146146
" \"See https://nbdev.fast.ai/getting_started.html for more information.\")\n",
147147
" return\n",
148148
" mm = mod_maker(dest=lib_path, name=nm, nb_path=nbname, is_new=bool(name) or mod=='#', solo_nb=solo_nb)\n",

0 commit comments

Comments
 (0)