feat(doc): document default setup

This commit is contained in:
Barrett Ruth 2025-09-26 09:53:32 -04:00
parent f0fbb15765
commit e5aca06955
2 changed files with 19 additions and 3 deletions

View file

@ -121,9 +121,8 @@ Template Variables ~
============================================================================== ==============================================================================
CONFIGURATION *cp-config* CONFIGURATION *cp-config*
cp.nvim works out of the box. No setup required.
Here's an example configuration with lazy.nvim: >lua Here's an example configuration with lazy.nvim: >lua
{ {
'barrett-ruth/cp.nvim', 'barrett-ruth/cp.nvim',
cmd = 'CP', cmd = 'CP',
@ -166,6 +165,21 @@ Here's an example configuration with lazy.nvim: >lua
} }
< <
By default, all contests are configured to use C++ with the g++ compiler and ISO standard
17. Python is also configured with the system executable python as a non-default option. Consult lua/cp/config.lua for
more information.
For example, to run CodeForces contests with Python, only the following config
is required:
{
contests = {
codeforces = {
default_langauge = 'python'
}
}
}
*cp.Config* *cp.Config*
Fields: ~ Fields: ~
{contests} (table<string,ContestConfig>) Contest configurations. {contests} (table<string,ContestConfig>) Contest configurations.
@ -243,7 +257,7 @@ Here's an example configuration with lazy.nvim: >lua
function(state: cp.State) function(state: cp.State)
Hook functions receive the cp.nvim state object (cp.State). See the state Hook functions receive the cp.nvim state object (cp.State). See the state
module documentation for available methods and fields. module documentation (lua/cp/state.lua) for available methods and fields.
Example usage in hook: >lua Example usage in hook: >lua
hooks = { hooks = {

View file

@ -5,6 +5,8 @@
---@field set_contest_id fun(contest_id: string) ---@field set_contest_id fun(contest_id: string)
---@field get_problem_id fun(): string? ---@field get_problem_id fun(): string?
---@field set_problem_id fun(problem_id: string) ---@field set_problem_id fun(problem_id: string)
---@field get_active_panel fun(): string?
---@field set_active_panel fun(): string?
---@field get_test_cases fun(): table[]? ---@field get_test_cases fun(): table[]?
---@field set_test_cases fun(test_cases: table[]) ---@field set_test_cases fun(test_cases: table[])
---@field get_saved_session fun(): table? ---@field get_saved_session fun(): table?