Merge pull request #158 from barrett-ruth/feat/buf-difficulties

fix: open problem-specific url
This commit is contained in:
Barrett Ruth 2025-10-15 17:02:51 +02:00 committed by GitHub
commit c29ec1c6b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ io
debug
venv/
CLAUDE.md
__pycache__

View file

@ -211,7 +211,8 @@ run CSES problems with Rust using the single schema:
Should return full filename with extension.
(default: concatenates contest_id and problem_id, lowercased)
{ui} (|CpUI|) UI settings: run panel, diff backend, picker.
{open_url} (boolean) Open the contest url in the browser.
{open_url} (boolean) Open the contest & problem url in the browser
when the contest is first opened.
*CpPlatform*
Fields: ~

View file

@ -84,7 +84,7 @@ function M.setup_contest(platform, contest_id, problem_id, language)
start_tests(platform, contest_id, problems)
if config_module.get_config().open_url and is_new_contest and contest_data.url then
vim.ui.open(contest_data.url)
vim.ui.open(contest_data.url:format(pid))
end
end

View file

@ -286,7 +286,7 @@ class AtcoderScraper(BaseScraper):
error="",
contest_id=cid,
problems=problems,
url=f"https://atcoder.jp/contests/{contest_id}/tasks",
url=f"https://atcoder.jp/contests/{contest_id}/tasks/{contest_id}_%s",
)
return await self._safe_execute("metadata", impl, contest_id)

View file

@ -202,7 +202,7 @@ class CodeforcesScraper(BaseScraper):
error="",
contest_id=cid,
problems=problems,
url=f"https://codeforces.com/contest/{contest_id}",
url=f"https://codeforces.com/contest/{contest_id}/%s",
)
return await self._safe_execute("metadata", impl, contest_id)

View file

@ -200,7 +200,7 @@ class CSESScraper(BaseScraper):
error="",
contest_id=contest_id,
problems=problems,
url="https://cses.fi/problemset",
url="https://cses.fi/problemset/task/%s",
)
async def scrape_contest_list(self) -> ContestListResult: