Skip to content

Commit

Permalink
add pub func
Browse files Browse the repository at this point in the history
  • Loading branch information
hamelsmu committed Sep 17, 2024
1 parent 906a467 commit e3a44ce
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions nbdev/_modidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'nbdev.config.config_key': ('api/config.html#config_key', 'nbdev/config.py'),
'nbdev.config.create_output': ('api/config.html#create_output', 'nbdev/config.py'),
'nbdev.config.get_config': ('api/config.html#get_config', 'nbdev/config.py'),
'nbdev.config.is_nbdev': ('api/config.html#is_nbdev', 'nbdev/config.py'),
'nbdev.config.nbdev_create_config': ('api/config.html#nbdev_create_config', 'nbdev/config.py'),
'nbdev.config.show_src': ('api/config.html#show_src', 'nbdev/config.py'),
'nbdev.config.update_version': ('api/config.html#update_version', 'nbdev/config.py'),
Expand Down
7 changes: 5 additions & 2 deletions nbdev/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_config.ipynb.

# %% auto 0
__all__ = ['nbdev_create_config', 'get_config', 'config_key', 'create_output', 'show_src', 'update_version', 'add_init',
'write_cells']
__all__ = ['nbdev_create_config', 'get_config', 'config_key', 'is_nbdev', 'create_output', 'show_src', 'update_version',
'add_init', 'write_cells']

# %% ../nbs/api/01_config.ipynb
from datetime import datetime
Expand Down Expand Up @@ -209,6 +209,9 @@ def config_key(c, default=None, path=True, missing_ok=None):
warn("`config_key` is deprecated. Use `get_config().get` or `get_config().path` instead.", DeprecationWarning)
return get_config().path(c, default) if path else get_config().get(c, default)

# %% ../nbs/api/01_config.ipynb
def is_nbdev(): return _nbdev_config_file().exists()

# %% ../nbs/api/01_config.ipynb
def create_output(txt, mime):
"Add a cell output containing `txt` of the `mime` text MIME sub-type"
Expand Down
20 changes: 20 additions & 0 deletions nbs/api/01_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,26 @@
"## Helpers"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#|export\n",
"def is_nbdev(): return _nbdev_config_file().exists()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#|hide\n",
"test_eq(is_nbdev(), True)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit e3a44ce

Please sign in to comment.