mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
feat: Add paginate parameter to cmd_web
This commit is contained in:
parent
e255c28353
commit
584813c0f3
1 changed files with 9 additions and 6 deletions
|
@ -120,7 +120,7 @@ class Commands:
|
|||
else:
|
||||
self.io.tool_output("Please provide a partial model name to search for.")
|
||||
|
||||
def cmd_web(self, args):
|
||||
def cmd_web(self, args, paginate=True):
|
||||
"Scrape a webpage, convert to markdown and add to the chat"
|
||||
|
||||
url = args.strip()
|
||||
|
@ -140,11 +140,14 @@ class Commands:
|
|||
content = self.scraper.scrape(url) or ""
|
||||
content = f"{url}:\n\n" + content
|
||||
|
||||
# Use pypager to show the content
|
||||
source = StringSource(content)
|
||||
pager = Pager()
|
||||
pager.add_source(source)
|
||||
pager.run()
|
||||
if paginate:
|
||||
# Use pypager to show the content
|
||||
source = StringSource(content)
|
||||
pager = Pager()
|
||||
pager.add_source(source)
|
||||
pager.run()
|
||||
else:
|
||||
self.io.tool_output(content)
|
||||
|
||||
return content
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue