nbdev 2.3.28__tar.gz → 2.3.30__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.28/nbdev.egg-info → nbdev-2.3.30}/PKG-INFO +1 -1
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/__init__.py +1 -1
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/_modidx.py +1 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/cli.py +4 -11
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/config.py +1 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/processors.py +15 -4
- {nbdev-2.3.28 → nbdev-2.3.30/nbdev.egg-info}/PKG-INFO +1 -1
- {nbdev-2.3.28 → nbdev-2.3.30}/settings.ini +1 -1
- {nbdev-2.3.28 → nbdev-2.3.30}/CONTRIBUTING.md +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/LICENSE +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/MANIFEST.in +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/README.md +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/clean.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/doclinks.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/export.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/extract_attachments.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/frontmatter.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/imports.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/maker.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/merge.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/migrate.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/process.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/qmd.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/quarto.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/release.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/serve.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/serve_drv.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/showdoc.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/sync.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev/test.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/SOURCES.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/entry_points.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/not-zip-safe +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/requires.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/setup.cfg +0 -0
- {nbdev-2.3.28 → nbdev-2.3.30}/setup.py +0 -0
|
@@ -204,6 +204,7 @@ d = { 'settings': { 'branch': 'master',
|
|
|
204
204
|
'nbdev.processors.add_show_docs': ('api/processors.html#add_show_docs', 'nbdev/processors.py'),
|
|
205
205
|
'nbdev.processors.add_show_docs.begin': ( 'api/processors.html#add_show_docs.begin',
|
|
206
206
|
'nbdev/processors.py'),
|
|
207
|
+
'nbdev.processors.ai_magics': ('api/processors.html#ai_magics', 'nbdev/processors.py'),
|
|
207
208
|
'nbdev.processors.boxify': ('api/processors.html#boxify', 'nbdev/processors.py'),
|
|
208
209
|
'nbdev.processors.cell_lang': ('api/processors.html#cell_lang', 'nbdev/processors.py'),
|
|
209
210
|
'nbdev.processors.clean_magics': ('api/processors.html#clean_magics', 'nbdev/processors.py'),
|
|
@@ -85,30 +85,24 @@ def nbdev_new(**kwargs):
|
|
|
85
85
|
nbdev_create_config.__wrapped__(**kwargs)
|
|
86
86
|
cfg = get_config()
|
|
87
87
|
_update_repo_meta(cfg)
|
|
88
|
-
|
|
89
88
|
path = Path()
|
|
90
89
|
|
|
91
|
-
_ORG_OR_USR = 'fastai'
|
|
92
|
-
_REPOSITORY = 'nbdev-template'
|
|
90
|
+
_ORG_OR_USR,_REPOSITORY = 'fastai','nbdev-template'
|
|
93
91
|
_TEMPLATE = f'{_ORG_OR_USR}/{_REPOSITORY}'
|
|
94
92
|
template = kwargs.get('template', _TEMPLATE)
|
|
95
|
-
try:
|
|
96
|
-
|
|
97
|
-
except ValueError:
|
|
98
|
-
org_or_usr, repo = _ORG_OR_USR, _REPOSITORY
|
|
99
|
-
|
|
93
|
+
try: org_or_usr, repo = template.split('/')
|
|
94
|
+
except ValueError: org_or_usr, repo = _ORG_OR_USR, _REPOSITORY
|
|
100
95
|
|
|
101
96
|
tag = kwargs.get('tag', None)
|
|
102
97
|
if tag is None:
|
|
103
98
|
with warnings.catch_warnings():
|
|
104
99
|
warnings.simplefilter('ignore', UserWarning)
|
|
105
|
-
|
|
106
100
|
tag = GhApi(gh_host='https://api.github.com', authenticate=False).repos.get_latest_release(org_or_usr, repo).tag_name
|
|
107
101
|
|
|
108
102
|
url = f"https://github.com/{org_or_usr}/{repo}/archive/{tag}.tar.gz"
|
|
109
103
|
extract_tgz(url)
|
|
110
104
|
tmpl_path = path/f'{repo}-{tag}'
|
|
111
|
-
|
|
105
|
+
|
|
112
106
|
cfg.nbs_path.mkdir(exist_ok=True)
|
|
113
107
|
nbexists = bool(first(cfg.nbs_path.glob('*.ipynb')))
|
|
114
108
|
_nbs_path_sufs = ('.ipynb','.css')
|
|
@@ -121,7 +115,6 @@ def nbdev_new(**kwargs):
|
|
|
121
115
|
rmtree(tmpl_path)
|
|
122
116
|
|
|
123
117
|
refresh_quarto_yml()
|
|
124
|
-
|
|
125
118
|
nbdev_export.__wrapped__()
|
|
126
119
|
nbdev_readme.__wrapped__()
|
|
127
120
|
|
|
@@ -63,6 +63,7 @@ def _apply_defaults(
|
|
|
63
63
|
clear_all:bool_arg=False, # Remove all cell metadata and cell outputs?
|
|
64
64
|
cell_number:bool_arg=True, # Add cell number to the exported file
|
|
65
65
|
put_version_in_init:bool_arg=True, # Add the version to the main __init__.py in nbdev_export
|
|
66
|
+
skip_procs:str='', # A comma-separated list of processors that you want to skip
|
|
66
67
|
):
|
|
67
68
|
"Apply default settings where missing in `cfg`."
|
|
68
69
|
if getattr(cfg,'repo',None) is None:
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
# %% auto 0
|
|
6
6
|
__all__ = ['populate_language', 'insert_warning', 'cell_lang', 'add_show_docs', 'fdiv', 'boxify', 'mv_exports', 'add_links',
|
|
7
|
-
'add_fold', 'strip_ansi', 'strip_hidden_metadata', 'hide_', 'hide_line', 'filter_stream_', '
|
|
8
|
-
'rm_header_dash', 'rm_export', 'clean_show_doc', 'exec_show_docs', 'FilterDefaults']
|
|
7
|
+
'add_fold', 'strip_ansi', 'strip_hidden_metadata', 'hide_', 'hide_line', 'filter_stream_', 'ai_magics',
|
|
8
|
+
'clean_magics', 'rm_header_dash', 'rm_export', 'clean_show_doc', 'exec_show_docs', 'FilterDefaults']
|
|
9
9
|
|
|
10
10
|
# %% ../nbs/api/10_processors.ipynb
|
|
11
11
|
import ast
|
|
@@ -169,6 +169,15 @@ def filter_stream_(cell, *words):
|
|
|
169
169
|
if outp.output_type == 'stream':
|
|
170
170
|
outp['text'] = [l for l in outp.text if not re.search('|'.join(words), l)]
|
|
171
171
|
|
|
172
|
+
# %% ../nbs/api/10_processors.ipynb
|
|
173
|
+
_aimagics_pattern = re.compile(r'^\s*(%%ai.? |%%ai.?$)', re.MULTILINE)
|
|
174
|
+
|
|
175
|
+
def ai_magics(cell):
|
|
176
|
+
"A preprocessor to convert AI magics to markdown"
|
|
177
|
+
if cell.cell_type == 'code' and _aimagics_pattern.search(cell.source):
|
|
178
|
+
cell.cell_type ='markdown'
|
|
179
|
+
cell.source = '\n'.join(cell.source.splitlines()[1:])
|
|
180
|
+
|
|
172
181
|
# %% ../nbs/api/10_processors.ipynb
|
|
173
182
|
_magics_pattern = re.compile(r'^\s*(%%|%).*', re.MULTILINE)
|
|
174
183
|
|
|
@@ -268,11 +277,13 @@ class FilterDefaults:
|
|
|
268
277
|
def base_procs(self):
|
|
269
278
|
return [FrontmatterProc, populate_language, add_show_docs, insert_warning,
|
|
270
279
|
strip_ansi, hide_line, filter_stream_, rm_header_dash,
|
|
271
|
-
clean_show_doc, exec_show_docs, rm_export, clean_magics, hide_, add_links,
|
|
280
|
+
clean_show_doc, exec_show_docs, rm_export, ai_magics, clean_magics, hide_, add_links,
|
|
281
|
+
add_fold, mv_exports, strip_hidden_metadata]
|
|
272
282
|
|
|
273
283
|
def procs(self):
|
|
274
284
|
"Processors for export"
|
|
275
|
-
|
|
285
|
+
skip_procs = get_config().get('skip_procs', '').split(',')
|
|
286
|
+
return L(self.base_procs()).filter(lambda x: x.__name__ not in skip_procs) + self.xtra_procs()
|
|
276
287
|
|
|
277
288
|
def nb_proc(self, nb):
|
|
278
289
|
"Get an `NBProcessor` with these processors"
|
|
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
|