nbdev 3.0.15__tar.gz → 3.0.16__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-3.0.15/nbdev.egg-info → nbdev-3.0.16}/PKG-INFO +1 -1
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/__init__.py +1 -1
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/export.py +1 -1
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/maker.py +5 -4
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/processors.py +3 -2
- {nbdev-3.0.15 → nbdev-3.0.16/nbdev.egg-info}/PKG-INFO +1 -1
- {nbdev-3.0.15 → nbdev-3.0.16}/pyproject.toml +1 -1
- {nbdev-3.0.15 → nbdev-3.0.16}/CONTRIBUTING.md +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/LICENSE +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/MANIFEST.in +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/README.md +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/_modidx.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/clean.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/cli.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/config.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/diff.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/doclinks.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/extract_attachments.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/frontmatter.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/imports.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/merge.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/migrate.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/process.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/qmd.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/quarto.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/release.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/scrubmagics.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/serve.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/serve_drv.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/showdoc.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/sync.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/test.py +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/SOURCES.txt +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/entry_points.txt +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/requires.txt +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-3.0.15 → nbdev-3.0.16}/setup.cfg +0 -0
|
@@ -30,7 +30,7 @@ class ExportModuleProc:
|
|
|
30
30
|
def __call__(self, cell):
|
|
31
31
|
src = cell.source
|
|
32
32
|
if not src: return
|
|
33
|
-
if cell.cell_type=='markdown' and src.startswith('# '): self.
|
|
33
|
+
if cell.cell_type=='markdown' and (src.startswith('# ') or 'export' in cell.directives_): self._exporti_(cell)
|
|
34
34
|
_exports_=_export_
|
|
35
35
|
|
|
36
36
|
# %% ../nbs/api/04_export.ipynb #76717e36
|
|
@@ -111,7 +111,7 @@ def make_code_cells(*ss): return dict2nb({'cells':L(ss).map(mk_cell)}).cells
|
|
|
111
111
|
# %% ../nbs/api/02_maker.ipynb #a2546836
|
|
112
112
|
def relative_import(name, fname, level=0):
|
|
113
113
|
"Convert a module `name` to a name relative to `fname`"
|
|
114
|
-
|
|
114
|
+
if level: raise ValueError(f"nbdev export does not support relative imports: module={name}, export_path={fname}")
|
|
115
115
|
sname = name.replace('.','/')
|
|
116
116
|
if not(os.path.commonpath([sname,fname])): return name
|
|
117
117
|
rel = os.path.relpath(sname, fname)
|
|
@@ -175,14 +175,15 @@ def _import2relative(cells, lib_path=None):
|
|
|
175
175
|
|
|
176
176
|
# %% ../nbs/api/02_maker.ipynb #5bff9d71
|
|
177
177
|
def _retr_mdoc(cells):
|
|
178
|
-
"Search for
|
|
178
|
+
"Search for markdown cells used to create module docstring"
|
|
179
179
|
md1 = first(o for o in cells if o.cell_type=='markdown' and o.source.startswith('# '))
|
|
180
180
|
if not md1: return ''
|
|
181
181
|
lines = dropwhile(lambda l: not l.startswith('> '), md1.source.splitlines())
|
|
182
182
|
lines = list(takewhile(lambda l: l.startswith('> '), lines))
|
|
183
|
-
if not lines: return ''
|
|
184
183
|
summ = '\n'.join(l.lstrip('> ').strip() for l in lines)
|
|
185
|
-
|
|
184
|
+
docs = L(o.source.rstrip() for o in cells if o.cell_type=='markdown' and 'export' in getattr(o,'directives_',{}))
|
|
185
|
+
mdoc = '\n\n'.join(L(summ)+docs).strip()
|
|
186
|
+
return f'"""{mdoc}"""\n\n' if mdoc else ''
|
|
186
187
|
|
|
187
188
|
# %% ../nbs/api/02_maker.ipynb #cdd205d6
|
|
188
189
|
@patch
|
|
@@ -198,8 +198,9 @@ def rm_header_dash(cell):
|
|
|
198
198
|
_hide_dirs = {'export','exporti', 'hide','default_exp'}
|
|
199
199
|
|
|
200
200
|
def rm_export(cell):
|
|
201
|
-
"Remove cells that are exported or hidden"
|
|
202
|
-
if cell.directives_ and (cell.directives_.keys() & _hide_dirs): del(cell['source'])
|
|
201
|
+
"Remove code cells that are exported or hidden"
|
|
202
|
+
if cell.cell_type=='code' and cell.directives_ and (cell.directives_.keys() & _hide_dirs): del(cell['source'])
|
|
203
|
+
|
|
203
204
|
|
|
204
205
|
# %% ../nbs/api/10_processors.ipynb #2d9a0a30
|
|
205
206
|
_re_showdoc = re.compile(r'^show_doc', re.MULTILINE)
|
|
@@ -76,7 +76,7 @@ version = {attr = "nbdev.__version__"}
|
|
|
76
76
|
include = ["nbdev"]
|
|
77
77
|
|
|
78
78
|
[tool.nbdev]
|
|
79
|
-
allowed_metadata_keys = ['
|
|
79
|
+
allowed_metadata_keys = ['solveit']
|
|
80
80
|
custom_sidebar = true
|
|
81
81
|
readme_nb = "getting_started.ipynb"
|
|
82
82
|
jupyter_hooks = true
|
|
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
|
|
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
|