nbdev 2.3.28__tar.gz → 2.3.29__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.29}/PKG-INFO +1 -1
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/__init__.py +1 -1
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/_modidx.py +1 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/cli.py +4 -11
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/processors.py +13 -3
- {nbdev-2.3.28 → nbdev-2.3.29/nbdev.egg-info}/PKG-INFO +1 -1
- {nbdev-2.3.28 → nbdev-2.3.29}/settings.ini +1 -1
- {nbdev-2.3.28 → nbdev-2.3.29}/CONTRIBUTING.md +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/LICENSE +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/MANIFEST.in +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/README.md +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/clean.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/config.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/doclinks.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/export.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/extract_attachments.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/frontmatter.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/imports.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/maker.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/merge.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/migrate.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/process.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/qmd.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/quarto.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/release.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/serve.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/serve_drv.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/showdoc.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/sync.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/test.py +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/SOURCES.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/entry_points.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/not-zip-safe +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/requires.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/setup.cfg +0 -0
- {nbdev-2.3.28 → nbdev-2.3.29}/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
|
|
|
@@ -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,7 +277,8 @@ 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"
|
|
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
|