Skip to content

Commit

Permalink
check if in nbdev project
Browse files Browse the repository at this point in the history
  • Loading branch information
hamelsmu committed Sep 17, 2024
1 parent 67298f1 commit 27fcf63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llms_txt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _local_docs_pth(cfg): return cfg.config_path/'_proc'/cfg.doc_path.name
def get_doc_content(url):
"Fetch content from local file if in nbdev repo."
cfg = get_config()
if cfg.config_file.exists() and url.startswith(cfg.doc_host):
if is_nbdev() and url.startswith(cfg.doc_host):
relative_path = urlparse(url).path.lstrip('/')
local_path = _local_docs_pth(cfg) / relative_path
if local_path.exists(): return local_path.read_text()
Expand Down
2 changes: 1 addition & 1 deletion nbs/01_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
"def get_doc_content(url):\n",
" \"Fetch content from local file if in nbdev repo.\"\n",
" cfg = get_config()\n",
" if cfg.config_file.exists() and url.startswith(cfg.doc_host):\n",
" if is_nbdev() and url.startswith(cfg.doc_host):\n",
" relative_path = urlparse(url).path.lstrip('/')\n",
" local_path = _local_docs_pth(cfg) / relative_path\n",
" if local_path.exists(): return local_path.read_text()\n",
Expand Down

0 comments on commit 27fcf63

Please sign in to comment.