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.
Files changed (38) hide show
  1. {nbdev-2.3.28/nbdev.egg-info → nbdev-2.3.29}/PKG-INFO +1 -1
  2. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/__init__.py +1 -1
  3. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/_modidx.py +1 -0
  4. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/cli.py +4 -11
  5. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/processors.py +13 -3
  6. {nbdev-2.3.28 → nbdev-2.3.29/nbdev.egg-info}/PKG-INFO +1 -1
  7. {nbdev-2.3.28 → nbdev-2.3.29}/settings.ini +1 -1
  8. {nbdev-2.3.28 → nbdev-2.3.29}/CONTRIBUTING.md +0 -0
  9. {nbdev-2.3.28 → nbdev-2.3.29}/LICENSE +0 -0
  10. {nbdev-2.3.28 → nbdev-2.3.29}/MANIFEST.in +0 -0
  11. {nbdev-2.3.28 → nbdev-2.3.29}/README.md +0 -0
  12. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/clean.py +0 -0
  13. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/config.py +0 -0
  14. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/doclinks.py +0 -0
  15. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/export.py +0 -0
  16. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/extract_attachments.py +0 -0
  17. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/frontmatter.py +0 -0
  18. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/imports.py +0 -0
  19. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/maker.py +0 -0
  20. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/merge.py +0 -0
  21. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/migrate.py +0 -0
  22. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/process.py +0 -0
  23. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/qmd.py +0 -0
  24. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/quarto.py +0 -0
  25. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/release.py +0 -0
  26. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/serve.py +0 -0
  27. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/serve_drv.py +0 -0
  28. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/showdoc.py +0 -0
  29. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/sync.py +0 -0
  30. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev/test.py +0 -0
  31. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/SOURCES.txt +0 -0
  32. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/dependency_links.txt +0 -0
  33. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/entry_points.txt +0 -0
  34. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/not-zip-safe +0 -0
  35. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/requires.txt +0 -0
  36. {nbdev-2.3.28 → nbdev-2.3.29}/nbdev.egg-info/top_level.txt +0 -0
  37. {nbdev-2.3.28 → nbdev-2.3.29}/setup.cfg +0 -0
  38. {nbdev-2.3.28 → nbdev-2.3.29}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdev
3
- Version: 2.3.28
3
+ Version: 2.3.29
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
@@ -1,4 +1,4 @@
1
- __version__ = "2.3.28"
1
+ __version__ = "2.3.29"
2
2
 
3
3
  from .doclinks import nbdev_export
4
4
  from .showdoc import show_doc
@@ -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
- org_or_usr, repo = template.split('/')
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_', 'clean_magics',
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, add_fold, mv_exports, strip_hidden_metadata]
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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdev
3
- Version: 2.3.28
3
+ Version: 2.3.29
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
@@ -9,7 +9,7 @@ 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.28
12
+ version = 2.3.29
13
13
  audience = Developers
14
14
  language = English
15
15
  custom_sidebar = 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