Skip to content

Commit

Permalink
walrus
Browse files Browse the repository at this point in the history
  • Loading branch information
hamelsmu committed Sep 20, 2024
1 parent cf40a77 commit c86a79a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 87 deletions.
3 changes: 1 addition & 2 deletions llms_txt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def _get_config(): return Config.find('settings.ini')

def get_doc_content(url):
"Fetch content from local file if in nbdev repo."
cfg = _get_config()
if cfg and url.startswith(cfg.doc_host):
if (cfg:=_get_config()) 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
Loading

0 comments on commit c86a79a

Please sign in to comment.