Open ouuan opened 4 years ago
Of course, we have to provide presets for CF Tool, and move <CF Tool Command>
to <CF Tool Command> ...
.
这个确实挺重要的
其实有些OJ也提供了API,比如luogu,可能没有那么麻烦吧
其实有些OJ也提供了API,比如luogu,可能没有那么麻烦吧
Chinese:
不是要做提交工具,而是让 CP Editor 的用户可以使用除了 CF Tool 外的其它提交工具。另外这里最好说英语。
English:
We won't make OJ tools, we will just make the users of CP Editor able to use tools besides CF Tool. BTW, It's better to speak English here.
I agree. But where is the API
You can publish a docs first
We can wrap tools in to scripts or programs, which provide the same interface.
Alternatively, we can make extensions flexible(dynamic loaded), and let it generate its own settings page.
It seems that we need one more page like the code snippets page and the parentheses page. We'd better write a solution for these pages and more pages in the future.
When will this be in use
Is your feature request related to a problem? Please describe.
Now CP Editor only supports CF Tool, but:
There are other CLI tools for submitting to online judges, like Online Judge Tools. They support more online judges.
Users may use mirrors like https://codeforc.es/ for Codeforces, now they are forced to use https://codeforces.com.
Users have no way to fix bugs caused by external API changes like #194 by themselves.
Describe the solution you'd like
We can let the user set custom submit commands.
A submit rule has the following components:
${filepath}
.) It could be different for different languages.When clicking the submit button, if the problem URL matches a regex, CP Editor will execute the submit command, redirect stdout and stderr of the submit process to the message logger. When the process finishes, a toast message which contains the latest status or "Unknown" will show.
For example:
(.*://codeforces.com/contest/([1-9][0-9]*)/problem/(0|[A-Z][1-9]?))
.cf submit -f ${filepath} \1
.status: (.+)
, status:\1
.Accepted|Pretests passed|Happy New Year
.Running
.Contest \2 Problem \3
Describe alternatives you've considered
N/A
Additional context
N/A