nbdev 2.3.30__tar.gz → 2.3.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nbdev-2.3.30/nbdev.egg-info → nbdev-2.3.32}/PKG-INFO +4 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/__init__.py +1 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/_modidx.py +5 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/cli.py +34 -2
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/config.py +7 -6
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/doclinks.py +6 -4
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/export.py +10 -3
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/migrate.py +1 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/processors.py +1 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/quarto.py +2 -2
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/release.py +1 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/showdoc.py +28 -5
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/sync.py +5 -2
- {nbdev-2.3.30 → nbdev-2.3.32/nbdev.egg-info}/PKG-INFO +4 -1
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/SOURCES.txt +1 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/entry_points.txt +2 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/requires.txt +3 -0
- nbdev-2.3.32/pyproject.toml +3 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/settings.ini +6 -3
- {nbdev-2.3.30 → nbdev-2.3.32}/CONTRIBUTING.md +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/LICENSE +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/MANIFEST.in +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/README.md +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/clean.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/extract_attachments.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/frontmatter.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/imports.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/maker.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/merge.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/process.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/qmd.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/serve.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/serve_drv.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev/test.py +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/not-zip-safe +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/setup.cfg +0 -0
- {nbdev-2.3.30 → nbdev-2.3.32}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nbdev
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.32
|
|
4
4
|
Summary: Create delightful software with Jupyter Notebooks
|
|
5
5
|
Home-page: https://github.com/fastai/nbdev
|
|
6
6
|
Author: Jeremy Howard and Hamel Husain
|
|
@@ -28,6 +28,7 @@ Requires-Dist: astunparse
|
|
|
28
28
|
Requires-Dist: ghapi>=1.0.3
|
|
29
29
|
Requires-Dist: watchdog
|
|
30
30
|
Requires-Dist: asttokens
|
|
31
|
+
Requires-Dist: setuptools
|
|
31
32
|
Requires-Dist: PyYAML
|
|
32
33
|
Provides-Extra: dev
|
|
33
34
|
Requires-Dist: ipywidgets; extra == "dev"
|
|
@@ -38,6 +39,8 @@ Requires-Dist: matplotlib; extra == "dev"
|
|
|
38
39
|
Requires-Dist: black; extra == "dev"
|
|
39
40
|
Requires-Dist: svg.py; extra == "dev"
|
|
40
41
|
Requires-Dist: nbclassic; extra == "dev"
|
|
42
|
+
Requires-Dist: pysymbol_llm; extra == "dev"
|
|
43
|
+
Requires-Dist: llms-txt; extra == "dev"
|
|
41
44
|
|
|
42
45
|
# Getting Started
|
|
43
46
|
|
|
@@ -23,9 +23,11 @@ d = { 'settings': { 'branch': 'master',
|
|
|
23
23
|
'nbdev.cli._update_repo_meta': ('api/cli.html#_update_repo_meta', 'nbdev/cli.py'),
|
|
24
24
|
'nbdev.cli.chelp': ('api/cli.html#chelp', 'nbdev/cli.py'),
|
|
25
25
|
'nbdev.cli.extract_tgz': ('api/cli.html#extract_tgz', 'nbdev/cli.py'),
|
|
26
|
+
'nbdev.cli.nb_export_cli': ('api/cli.html#nb_export_cli', 'nbdev/cli.py'),
|
|
26
27
|
'nbdev.cli.nbdev_filter': ('api/cli.html#nbdev_filter', 'nbdev/cli.py'),
|
|
27
28
|
'nbdev.cli.nbdev_new': ('api/cli.html#nbdev_new', 'nbdev/cli.py'),
|
|
28
|
-
'nbdev.cli.nbdev_update_license': ('api/cli.html#nbdev_update_license', 'nbdev/cli.py')
|
|
29
|
+
'nbdev.cli.nbdev_update_license': ('api/cli.html#nbdev_update_license', 'nbdev/cli.py'),
|
|
30
|
+
'nbdev.cli.watch_export': ('api/cli.html#watch_export', 'nbdev/cli.py')},
|
|
29
31
|
'nbdev.config': { 'nbdev.config._apply_defaults': ('api/config.html#_apply_defaults', 'nbdev/config.py'),
|
|
30
32
|
'nbdev.config._basic_export_nb': ('api/config.html#_basic_export_nb', 'nbdev/config.py'),
|
|
31
33
|
'nbdev.config._cfg2txt': ('api/config.html#_cfg2txt', 'nbdev/config.py'),
|
|
@@ -41,6 +43,7 @@ d = { 'settings': { 'branch': 'master',
|
|
|
41
43
|
'nbdev.config.config_key': ('api/config.html#config_key', 'nbdev/config.py'),
|
|
42
44
|
'nbdev.config.create_output': ('api/config.html#create_output', 'nbdev/config.py'),
|
|
43
45
|
'nbdev.config.get_config': ('api/config.html#get_config', 'nbdev/config.py'),
|
|
46
|
+
'nbdev.config.is_nbdev': ('api/config.html#is_nbdev', 'nbdev/config.py'),
|
|
44
47
|
'nbdev.config.nbdev_create_config': ('api/config.html#nbdev_create_config', 'nbdev/config.py'),
|
|
45
48
|
'nbdev.config.show_src': ('api/config.html#show_src', 'nbdev/config.py'),
|
|
46
49
|
'nbdev.config.update_version': ('api/config.html#update_version', 'nbdev/config.py'),
|
|
@@ -331,6 +334,7 @@ d = { 'settings': { 'branch': 'master',
|
|
|
331
334
|
'nbdev.showdoc.ShowDocRenderer': ('api/showdoc.html#showdocrenderer', 'nbdev/showdoc.py'),
|
|
332
335
|
'nbdev.showdoc.ShowDocRenderer.__init__': ('api/showdoc.html#showdocrenderer.__init__', 'nbdev/showdoc.py'),
|
|
333
336
|
'nbdev.showdoc._bold': ('api/showdoc.html#_bold', 'nbdev/showdoc.py'),
|
|
337
|
+
'nbdev.showdoc._create_html_table': ('api/showdoc.html#_create_html_table', 'nbdev/showdoc.py'),
|
|
334
338
|
'nbdev.showdoc._docstring': ('api/showdoc.html#_docstring', 'nbdev/showdoc.py'),
|
|
335
339
|
'nbdev.showdoc._escape_markdown': ('api/showdoc.html#_escape_markdown', 'nbdev/showdoc.py'),
|
|
336
340
|
'nbdev.showdoc._ext_link': ('api/showdoc.html#_ext_link', 'nbdev/showdoc.py'),
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
# %% ../nbs/api/13_cli.ipynb 2
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
import warnings
|
|
8
|
+
import time
|
|
8
9
|
|
|
9
10
|
from .config import *
|
|
10
11
|
from .process import *
|
|
@@ -12,9 +13,11 @@ from .processors import *
|
|
|
12
13
|
from .doclinks import *
|
|
13
14
|
from .test import *
|
|
14
15
|
from .clean import *
|
|
15
|
-
from .quarto import nbdev_readme, refresh_quarto_yml
|
|
16
|
+
from .quarto import nbdev_readme, refresh_quarto_yml, fs_watchdog
|
|
17
|
+
from .export import nb_export
|
|
16
18
|
from .frontmatter import FrontmatterProc
|
|
17
19
|
|
|
20
|
+
from fastcore.xtras import run
|
|
18
21
|
from execnb.nbio import *
|
|
19
22
|
from fastcore.meta import *
|
|
20
23
|
from fastcore.utils import *
|
|
@@ -27,7 +30,8 @@ from contextlib import redirect_stdout
|
|
|
27
30
|
import os, tarfile, sys
|
|
28
31
|
|
|
29
32
|
# %% auto 0
|
|
30
|
-
__all__ = ['mapping', 'nbdev_filter', 'extract_tgz', 'nbdev_new', 'nbdev_update_license', '
|
|
33
|
+
__all__ = ['mapping', 'nbdev_filter', 'extract_tgz', 'nbdev_new', 'nbdev_update_license', 'nb_export_cli', 'watch_export',
|
|
34
|
+
'chelp']
|
|
31
35
|
|
|
32
36
|
# %% ../nbs/api/13_cli.ipynb
|
|
33
37
|
@call_parse
|
|
@@ -158,6 +162,34 @@ def nbdev_update_license(
|
|
|
158
162
|
lic.write(body)
|
|
159
163
|
print(f"License updated from {curr_lic} to {to}")
|
|
160
164
|
|
|
165
|
+
# %% ../nbs/api/13_cli.ipynb
|
|
166
|
+
@call_parse
|
|
167
|
+
@delegates(nb_export, but=['procs', 'mod_maker'])
|
|
168
|
+
def nb_export_cli(nbname,
|
|
169
|
+
debug:store_true=False, # Debug flag
|
|
170
|
+
**kwargs):
|
|
171
|
+
"Export a single nbdev notebook to a python script."
|
|
172
|
+
return nb_export(nbname=nbname, debug=debug, **kwargs)
|
|
173
|
+
|
|
174
|
+
# %% ../nbs/api/13_cli.ipynb
|
|
175
|
+
@call_parse
|
|
176
|
+
def watch_export(nbs:str=None, # Nb directory to watch for changes
|
|
177
|
+
lib:str=None, # Export directory to write py files to
|
|
178
|
+
force:bool=False # Ignore nbdev config if in nbdev project
|
|
179
|
+
):
|
|
180
|
+
'''Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available'''
|
|
181
|
+
cfg = get_config() if is_nbdev() else None
|
|
182
|
+
nbs = nbs or (cfg.nbs_path if cfg else '.')
|
|
183
|
+
lib = lib or (cfg.lib_path if cfg else '.')
|
|
184
|
+
if cfg and (nbs != cfg.nbs_path or lib != cfg.lib_path) and not force:
|
|
185
|
+
raise ValueError("In nbdev project. Use --force to override config.")
|
|
186
|
+
def _export(e,lib=lib):
|
|
187
|
+
p = e.src_path
|
|
188
|
+
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith('.~')):
|
|
189
|
+
if e.event_type == 'modified': run(f'nb_export --lib_path {lib} "{p}"')
|
|
190
|
+
with fs_watchdog(_export, nbs):
|
|
191
|
+
while True: time.sleep(1)
|
|
192
|
+
|
|
161
193
|
# %% ../nbs/api/13_cli.ipynb
|
|
162
194
|
@call_parse
|
|
163
195
|
def chelp():
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_config.ipynb.
|
|
4
4
|
|
|
5
5
|
# %% auto 0
|
|
6
|
-
__all__ = ['nbdev_create_config', 'get_config', 'config_key', '
|
|
7
|
-
'write_cells']
|
|
6
|
+
__all__ = ['nbdev_create_config', 'get_config', 'config_key', 'is_nbdev', 'create_output', 'show_src', 'update_version',
|
|
7
|
+
'add_init', 'write_cells']
|
|
8
8
|
|
|
9
9
|
# %% ../nbs/api/01_config.ipynb
|
|
10
10
|
from datetime import datetime
|
|
@@ -181,10 +181,8 @@ def nbdev_create_config(
|
|
|
181
181
|
|
|
182
182
|
# %% ../nbs/api/01_config.ipynb
|
|
183
183
|
def _nbdev_config_file(cfg_name=_nbdev_cfg_name, path=None):
|
|
184
|
-
cfg_path =
|
|
185
|
-
|
|
186
|
-
if not (cfg_path/cfg_name).exists(): cfg_path = path
|
|
187
|
-
return cfg_path/cfg_name
|
|
184
|
+
cfg_path = Path.cwd() if path is None else Path(path)
|
|
185
|
+
return getattr(Config.find(cfg_name), 'config_file', cfg_path/cfg_name)
|
|
188
186
|
|
|
189
187
|
# %% ../nbs/api/01_config.ipynb
|
|
190
188
|
def _xdg_config_paths(cfg_name=_nbdev_cfg_name):
|
|
@@ -209,6 +207,9 @@ def config_key(c, default=None, path=True, missing_ok=None):
|
|
|
209
207
|
warn("`config_key` is deprecated. Use `get_config().get` or `get_config().path` instead.", DeprecationWarning)
|
|
210
208
|
return get_config().path(c, default) if path else get_config().get(c, default)
|
|
211
209
|
|
|
210
|
+
# %% ../nbs/api/01_config.ipynb
|
|
211
|
+
def is_nbdev(): return _nbdev_config_file().exists()
|
|
212
|
+
|
|
212
213
|
# %% ../nbs/api/01_config.ipynb
|
|
213
214
|
def create_output(txt, mime):
|
|
214
215
|
"Add a cell output containing `txt` of the `mime` text MIME sub-type"
|
|
@@ -143,9 +143,10 @@ def nbdev_export(
|
|
|
143
143
|
**kwargs):
|
|
144
144
|
"Export notebooks in `path` to Python modules"
|
|
145
145
|
if os.environ.get('IN_TEST',0): return
|
|
146
|
+
if not is_nbdev(): raise Exception('`nbdev_export` must be called from a directory within a nbdev project.')
|
|
146
147
|
if procs:
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
import nbdev.export
|
|
149
|
+
procs = [getattr(nbdev.export, p) for p in L(procs)]
|
|
149
150
|
files = nbglob(path=path, as_path=True, **kwargs).sorted('name')
|
|
150
151
|
for f in files: nb_export(f, procs=procs)
|
|
151
152
|
add_init(get_config().lib_path)
|
|
@@ -194,7 +195,7 @@ def _qual_syms(entries):
|
|
|
194
195
|
return {'syms': {mod:_qual_mod(d, settings) for mod,d in entries['syms'].items()}, 'settings':settings}
|
|
195
196
|
|
|
196
197
|
# %% ../nbs/api/05_doclinks.ipynb
|
|
197
|
-
_re_backticks = re.compile(r'`([^`\s]
|
|
198
|
+
_re_backticks = re.compile(r'`([^`\s]+?)(?:\(\))?`')
|
|
198
199
|
|
|
199
200
|
# %% ../nbs/api/05_doclinks.ipynb
|
|
200
201
|
@lru_cache(None)
|
|
@@ -235,12 +236,13 @@ class NbdevLookup:
|
|
|
235
236
|
_,py,gh = res
|
|
236
237
|
line = _lineno(sym, py)
|
|
237
238
|
return f'{gh}#L{line}'
|
|
238
|
-
|
|
239
|
+
|
|
239
240
|
def _link_sym(self, m):
|
|
240
241
|
l = m.group(1)
|
|
241
242
|
s = self.doc(l)
|
|
242
243
|
if s is None: return m.group(0)
|
|
243
244
|
l = l.replace('\\', r'\\')
|
|
245
|
+
if m.group(0).endswith('()`'): l += '()'
|
|
244
246
|
return rf"[`{l}`]({s})"
|
|
245
247
|
|
|
246
248
|
def link_line(self, l): return _re_backticks.sub(self._link_sym, l)
|
|
@@ -14,6 +14,7 @@ from .process import *
|
|
|
14
14
|
from fastcore.script import *
|
|
15
15
|
from fastcore.basics import *
|
|
16
16
|
from fastcore.imports import *
|
|
17
|
+
from fastcore.meta import *
|
|
17
18
|
|
|
18
19
|
from collections import defaultdict
|
|
19
20
|
|
|
@@ -63,12 +64,18 @@ import nbdev.export
|
|
|
63
64
|
def optional_procs():
|
|
64
65
|
"An explicit list of processors that could be used by `nb_export`"
|
|
65
66
|
return L([p for p in nbdev.export.__all__
|
|
66
|
-
if p not in ["nb_export", "ExportModuleProc", "optional_procs"]])
|
|
67
|
+
if p not in ["nb_export", "nb_export_cli", "ExportModuleProc", "optional_procs"]])
|
|
67
68
|
|
|
68
69
|
# %% ../nbs/api/04_export.ipynb
|
|
69
|
-
def nb_export(nbname,
|
|
70
|
+
def nb_export(nbname:str, # Filename of notebook
|
|
71
|
+
lib_path:str=None, # Path to destination library. If not in a nbdev project, defaults to current directory.
|
|
72
|
+
procs=None, # Processors to use
|
|
73
|
+
name:str=None, # Name of python script {name}.py to create.
|
|
74
|
+
mod_maker=ModuleMaker,
|
|
75
|
+
debug:bool=False, # Debug mode
|
|
76
|
+
):
|
|
70
77
|
"Create module(s) from notebook"
|
|
71
|
-
if lib_path is None: lib_path = get_config().lib_path
|
|
78
|
+
if lib_path is None: lib_path = get_config().lib_path if is_nbdev() else '.'
|
|
72
79
|
exp = ExportModuleProc()
|
|
73
80
|
nb = NBProcessor(nbname, [exp]+L(procs), debug=debug)
|
|
74
81
|
nb.process()
|
|
@@ -112,7 +112,7 @@ def _re_v1():
|
|
|
112
112
|
d += L(get_config().tst_flags).filter()
|
|
113
113
|
d += [s.replace('_', '-') for s in d] # allow for hyphenated version of old directives
|
|
114
114
|
_tmp = '|'.join(list(set(d)))
|
|
115
|
-
return re.compile(
|
|
115
|
+
return re.compile(fr"^[ \f\v\t]*?(#)\s*({_tmp})(?!\S)", re.MULTILINE)
|
|
116
116
|
|
|
117
117
|
def _repl_directives(code_str):
|
|
118
118
|
def _fmt(x): return f"#| {_subv1(x[2].replace('-', '_').strip())}"
|
|
@@ -206,7 +206,7 @@ _re_showdoc = re.compile(r'^show_doc', re.MULTILINE)
|
|
|
206
206
|
def _is_showdoc(cell): return cell['cell_type'] == 'code' and _re_showdoc.search(cell.source)
|
|
207
207
|
def _add_directives(cell, d):
|
|
208
208
|
for k,v in d.items():
|
|
209
|
-
if not re.findall(
|
|
209
|
+
if not re.findall(fr'#\| *{k}:', cell.source): cell.source = f'#| {k}: {v}\n' + cell.source
|
|
210
210
|
|
|
211
211
|
def clean_show_doc(cell):
|
|
212
212
|
"Remove ShowDoc input cells"
|
|
@@ -89,7 +89,7 @@ def _recursive_parser(
|
|
|
89
89
|
set_index: bool = True): # If `True`, `index` file will be set to href.
|
|
90
90
|
for name, val in dir_dict.items():
|
|
91
91
|
if type(val) is str:
|
|
92
|
-
if re.search('index\..*', re.sub(r'^\d+_', '', val)) and set_index and section:
|
|
92
|
+
if re.search(r'index\..*', re.sub(r'^\d+_', '', val)) and set_index and section:
|
|
93
93
|
section.update({'href': str(dirpath/val)})
|
|
94
94
|
else:
|
|
95
95
|
contents.append(str(dirpath/val))
|
|
@@ -110,7 +110,7 @@ def nbdev_sidebar(
|
|
|
110
110
|
path:str=None, # Path to notebooks
|
|
111
111
|
printit:bool=False, # Print YAML for debugging
|
|
112
112
|
force:bool=False, # Create sidebar even if settings.ini custom_sidebar=False
|
|
113
|
-
skip_folder_re:str='(?:^[_.]|^www\$)', # Skip folders matching regex
|
|
113
|
+
skip_folder_re:str=r'(?:^[_.]|^www\$)', # Skip folders matching regex
|
|
114
114
|
**kwargs):
|
|
115
115
|
"Create sidebar.yml"
|
|
116
116
|
if not force and get_config().custom_sidebar: return
|
|
@@ -288,7 +288,7 @@ def release_conda(
|
|
|
288
288
|
if skip_upload: return print(loc)
|
|
289
289
|
if not upload_user: upload_user = get_config().conda_user
|
|
290
290
|
if not upload_user: return print("`conda_user` not in settings.ini and no `upload_user` passed. Cannot upload")
|
|
291
|
-
if 'anaconda upload' not in res: return print(f"{res}\n\
|
|
291
|
+
if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. Check auto-upload not set in .condarc. Try `--do_build False`.")
|
|
292
292
|
return anaconda_upload(name, loc)
|
|
293
293
|
|
|
294
294
|
# %% ../nbs/api/18_release.ipynb
|
|
@@ -192,24 +192,47 @@ def show_doc(sym, # Symbol to document
|
|
|
192
192
|
if isinstance(sym, TypeDispatch): pass
|
|
193
193
|
else:return renderer(sym or show_doc, name=name, title_level=title_level)
|
|
194
194
|
|
|
195
|
+
# %% ../nbs/api/08_showdoc.ipynb
|
|
196
|
+
def _create_html_table(table_str):
|
|
197
|
+
def split_row(row):
|
|
198
|
+
return re.findall(r'\|(?:(?:\\.|[^|\\])*)', row)
|
|
199
|
+
|
|
200
|
+
def unescape_cell(cell):
|
|
201
|
+
return cell.strip(' *|').replace(r'\|', '|')
|
|
202
|
+
|
|
203
|
+
lines = table_str.strip().split('\n')
|
|
204
|
+
header = [f"<th>{unescape_cell(cell)}</th>" for cell in split_row(lines[0])]
|
|
205
|
+
rows = [[f"<td>{unescape_cell(cell)}</td>" for cell in split_row(line)] for line in lines[2:]]
|
|
206
|
+
|
|
207
|
+
return f'''<table>
|
|
208
|
+
<thead><tr>{' '.join(header)}</tr></thead>
|
|
209
|
+
<tbody>{''.join(f'<tr>{" ".join(row)}</tr>' for row in rows)}</tbody>
|
|
210
|
+
</table>'''
|
|
211
|
+
|
|
195
212
|
# %% ../nbs/api/08_showdoc.ipynb
|
|
196
213
|
def _html_link(url, txt): return f'<a href="{url}" target="_blank" rel="noreferrer noopener">{txt}</a>'
|
|
197
214
|
|
|
215
|
+
# %% ../nbs/api/08_showdoc.ipynb
|
|
198
216
|
class BasicHtmlRenderer(ShowDocRenderer):
|
|
199
|
-
"
|
|
217
|
+
"HTML renderer for `show_doc`"
|
|
200
218
|
def _repr_html_(self):
|
|
201
219
|
doc = '<hr/>\n'
|
|
220
|
+
src = NbdevLookup().code(self.fn)
|
|
202
221
|
doc += f'<h{self.title_level}>{self.nm}</h{self.title_level}>\n'
|
|
203
|
-
|
|
204
|
-
|
|
222
|
+
sig = _fmt_sig(self.sig) if self.sig else ''
|
|
223
|
+
# Escape < and > characters in the signature
|
|
224
|
+
sig = sig.replace('<', '<').replace('>', '>')
|
|
225
|
+
doc += f'<blockquote><pre><code>{self.nm} {sig}</code></pre></blockquote>'
|
|
226
|
+
if self.docs:
|
|
227
|
+
doc += f"<p><i>{self.docs}</i></p>"
|
|
228
|
+
if src: doc += f"<br/>{_html_link(src, 'source')}"
|
|
229
|
+
if self.dm.has_docment: doc += _create_html_table(str(self.dm))
|
|
205
230
|
return doc
|
|
206
231
|
|
|
207
232
|
def doc(self):
|
|
208
233
|
"Show `show_doc` info along with link to docs"
|
|
209
234
|
from IPython.display import display,HTML
|
|
210
235
|
res = self._repr_html_()
|
|
211
|
-
docs = NbdevLookup().doc(self.fn)
|
|
212
|
-
if docs is not None: res += '\n<p>' +_html_link(docs, "Show in docs") + '</p>'
|
|
213
236
|
display(HTML(res))
|
|
214
237
|
|
|
215
238
|
# %% ../nbs/api/08_showdoc.ipynb
|
|
@@ -19,7 +19,7 @@ from fastcore.script import *
|
|
|
19
19
|
from fastcore.xtras import *
|
|
20
20
|
|
|
21
21
|
import ast
|
|
22
|
-
|
|
22
|
+
import importlib
|
|
23
23
|
|
|
24
24
|
# %% ../nbs/api/06_sync.ipynb
|
|
25
25
|
def absolute_import(name, fname, level):
|
|
@@ -32,7 +32,10 @@ def absolute_import(name, fname, level):
|
|
|
32
32
|
# %% ../nbs/api/06_sync.ipynb
|
|
33
33
|
@functools.lru_cache(maxsize=None)
|
|
34
34
|
def _mod_files():
|
|
35
|
-
|
|
35
|
+
midx_spec = importlib.util.spec_from_file_location("_modidx", get_config().lib_path / "_modidx.py")
|
|
36
|
+
midx = importlib.util.module_from_spec(midx_spec)
|
|
37
|
+
midx_spec.loader.exec_module(midx)
|
|
38
|
+
|
|
36
39
|
return L(files for mod in midx.d['syms'].values() for _,files in mod.values()).unique()
|
|
37
40
|
|
|
38
41
|
# %% ../nbs/api/06_sync.ipynb
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nbdev
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.32
|
|
4
4
|
Summary: Create delightful software with Jupyter Notebooks
|
|
5
5
|
Home-page: https://github.com/fastai/nbdev
|
|
6
6
|
Author: Jeremy Howard and Hamel Husain
|
|
@@ -28,6 +28,7 @@ Requires-Dist: astunparse
|
|
|
28
28
|
Requires-Dist: ghapi>=1.0.3
|
|
29
29
|
Requires-Dist: watchdog
|
|
30
30
|
Requires-Dist: asttokens
|
|
31
|
+
Requires-Dist: setuptools
|
|
31
32
|
Requires-Dist: PyYAML
|
|
32
33
|
Provides-Extra: dev
|
|
33
34
|
Requires-Dist: ipywidgets; extra == "dev"
|
|
@@ -38,6 +39,8 @@ Requires-Dist: matplotlib; extra == "dev"
|
|
|
38
39
|
Requires-Dist: black; extra == "dev"
|
|
39
40
|
Requires-Dist: svg.py; extra == "dev"
|
|
40
41
|
Requires-Dist: nbclassic; extra == "dev"
|
|
42
|
+
Requires-Dist: pysymbol_llm; extra == "dev"
|
|
43
|
+
Requires-Dist: llms-txt; extra == "dev"
|
|
41
44
|
|
|
42
45
|
# Getting Started
|
|
43
46
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
|
+
nb_export = nbdev.cli:nb_export_cli
|
|
2
3
|
nbdev_bump_version = nbdev.release:nbdev_bump_version
|
|
3
4
|
nbdev_changelog = nbdev.release:changelog
|
|
4
5
|
nbdev_clean = nbdev.clean:nbdev_clean
|
|
@@ -29,6 +30,7 @@ nbdev_test = nbdev.test:nbdev_test
|
|
|
29
30
|
nbdev_trust = nbdev.clean:nbdev_trust
|
|
30
31
|
nbdev_update = nbdev.sync:nbdev_update
|
|
31
32
|
nbdev_update_license = nbdev.cli:nbdev_update_license
|
|
33
|
+
watch_export = nbdev.cli:watch_export
|
|
32
34
|
|
|
33
35
|
[nbdev]
|
|
34
36
|
nbdev = nbdev._modidx:d
|
|
@@ -9,17 +9,17 @@ author = Jeremy Howard and Hamel Husain
|
|
|
9
9
|
author_email = j@fast.ai
|
|
10
10
|
branch = master
|
|
11
11
|
min_python = 3.7
|
|
12
|
-
version = 2.3.
|
|
12
|
+
version = 2.3.32
|
|
13
13
|
audience = Developers
|
|
14
14
|
language = English
|
|
15
15
|
custom_sidebar = True
|
|
16
16
|
license = apache2
|
|
17
17
|
status = 5
|
|
18
|
-
requirements = fastcore>=1.5.27 execnb>=0.1.4 astunparse ghapi>=1.0.3 watchdog asttokens
|
|
18
|
+
requirements = fastcore>=1.5.27 execnb>=0.1.4 astunparse ghapi>=1.0.3 watchdog asttokens setuptools
|
|
19
19
|
pip_requirements = PyYAML
|
|
20
20
|
conda_requirements = pyyaml
|
|
21
21
|
conda_user = fastai
|
|
22
|
-
dev_requirements = ipywidgets nbdev-numpy nbdev-stdlib pandas matplotlib black svg.py nbclassic
|
|
22
|
+
dev_requirements = ipywidgets nbdev-numpy nbdev-stdlib pandas matplotlib black svg.py nbclassic pysymbol_llm llms-txt
|
|
23
23
|
console_scripts = nbdev_create_config=nbdev.config:nbdev_create_config
|
|
24
24
|
nbdev_update=nbdev.sync:nbdev_update
|
|
25
25
|
nbdev_update_license=nbdev.cli:nbdev_update_license
|
|
@@ -50,6 +50,8 @@ console_scripts = nbdev_create_config=nbdev.config:nbdev_create_config
|
|
|
50
50
|
nbdev_requirements=nbdev.release:write_requirements
|
|
51
51
|
nbdev_proc_nbs=nbdev.quarto:nbdev_proc_nbs
|
|
52
52
|
nbdev_help=nbdev.cli:chelp
|
|
53
|
+
nb_export=nbdev.cli:nb_export_cli
|
|
54
|
+
watch_export=nbdev.cli:watch_export
|
|
53
55
|
tst_flags = notest
|
|
54
56
|
nbs_path = nbs
|
|
55
57
|
doc_path = _docs
|
|
@@ -68,4 +70,5 @@ clean_ids = False
|
|
|
68
70
|
clear_all = False
|
|
69
71
|
cell_number = False
|
|
70
72
|
put_version_in_init = True
|
|
73
|
+
skip_procs =
|
|
71
74
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|