Skip to content

feat: add support for site-specific template files#669

Open
Sadashii wants to merge 1 commit into
agrawal-d:mainfrom
Sadashii:site-specific-templates
Open

feat: add support for site-specific template files#669
Sadashii wants to merge 1 commit into
agrawal-d:mainfrom
Sadashii:site-specific-templates

Conversation

@Sadashii

Copy link
Copy Markdown
Contributor

This PR addresses #633 by introducing support for loading different templates depending on the competitive programming site/platform.

Features Added:

  • cph.general.siteTemplates Configuration Setting: Adds an object setting in VS Code allowing users to map specific site names (case-insensitive keys like "USACO", "Codeforces", "AtCoder") to template file paths.
  • Smart Matching: Evaluates the problem's group (problem.group) case-insensitively against the keys configured in siteTemplates.
  • Graceful Fallbacks: If a site-specific template matches, it is loaded. If not, it falls back to the default language template configured under cph.general.defaultLanguageTemplateFileLocation.

Example Configuration:

"cph.general.siteTemplates": {
    "USACO": "F:\\templates\\usaco_file_io.cpp",
    "Codeforces": "F:\\templates\\codeforces_fast_io.cpp"
}

@Sadashii
Sadashii force-pushed the site-specific-templates branch from e8fe110 to 8f895f4 Compare May 30, 2026 09:05
@agrawal-d

Copy link
Copy Markdown
Owner

Thanks! Please add more details (eg. how to configure in the setting description - I cant tell from reading the setting description how I would configure it for Codeforces and USACO as you show in the example.

And add even more details and screenshot(s) in the user-guide.

@agrawal-d
agrawal-d self-requested a review May 30, 2026 12:59

@agrawal-d agrawal-d left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs documentation

@Sadashii
Sadashii force-pushed the site-specific-templates branch from 8f895f4 to 7c3da77 Compare June 6, 2026 11:54
@Sadashii
Sadashii requested a review from agrawal-d June 6, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants