mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: buildContent: add background field
This commit is contained in:
4 files changed
+26
-25
No files matched your search
@@ -96,6 +96,7 @@ Auto format code: 自动格式化代码
|
|||||||
Auto organize input: 自动整理输入
|
Auto organize input: 自动整理输入
|
||||||
Avatar: 头像
|
Avatar: 头像
|
||||||
Back to contest list: 返回比赛列表
|
Back to contest list: 返回比赛列表
|
||||||
|
Background: 背景
|
||||||
Be Copied: 被复制
|
Be Copied: 被复制
|
||||||
Begin at: 开始于
|
Begin at: 开始于
|
||||||
Begin Date: 开始日期
|
Begin Date: 开始日期
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ __langname: 正體中文
|
|||||||
'Discussion: Terms Of Service': '討論區服務條款'
|
'Discussion: Terms Of Service': '討論區服務條款'
|
||||||
'First Blood Notice\n{0} solved problem {1} ({2})': '題目首殺提示\n{0} 解決了題目 {1} ({2})'
|
'First Blood Notice\n{0} solved problem {1} ({2})': '題目首殺提示\n{0} 解決了題目 {1} ({2})'
|
||||||
'Format: category 1, sub category 1.1, sub category 1.2, ..., sub category 1.x, ..., category n, sub category n.1, sub category n.2, ..., sub category n.m, ...': '格式:分類1, 子分類1.1, 子分類1.2, ..., 子分類1.x, ..., 分類n, 子分類n.1, 子分類n.2, ..., 子分類n.m, ...'
|
'Format: category 1, sub category 1.1, sub category 1.2, ..., sub category 1.x, ..., category n, sub category n.1, sub category n.2, ..., sub category n.m, ...': '格式:分類1, 子分類1.1, 子分類1.2, ..., 子分類1.x, ..., 分類n, 子分類n.1, 子分類n.2, ..., 子分類n.m, ...'
|
||||||
Join {0}: 加入 {0}
|
|
||||||
'No': '否'
|
'No': '否'
|
||||||
'Note: Problem title may not be hidden.': '注意:題目標題可能不會被隱藏。'
|
'Note: Problem title may not be hidden.': '注意:題目標題可能不會被隱藏。'
|
||||||
'Or upload a file:': '或者上傳一個檔案:'
|
'Or upload a file:': '或者上傳一個檔案:'
|
||||||
@@ -39,9 +38,6 @@ Join {0}: 加入 {0}
|
|||||||
'Solved {0} problems, RP: {1} (No. {2})': '解決了 {0} 道題目,RP: {1} (No. {2})'
|
'Solved {0} problems, RP: {1} (No. {2})': '解決了 {0} 道題目,RP: {1} (No. {2})'
|
||||||
'The value `{1}` of {0} already exists.': '{0} 的值 `{1}` 已經存在。'
|
'The value `{1}` of {0} already exists.': '{0} 的值 `{1}` 已經存在。'
|
||||||
'Yes': '是'
|
'Yes': '是'
|
||||||
Effects only when Difficulty is not 'Use algorithm calculated'.: 僅當難度不為“使用演算法計算”時才起效。
|
|
||||||
Split by ',' '.': 由","、"、"或"。"分隔。
|
|
||||||
What's file?: 什麼是檔案?
|
|
||||||
(All Problems): (所有題目)
|
(All Problems): (所有題目)
|
||||||
(None): (無)
|
(None): (無)
|
||||||
(Not changed): 未更改
|
(Not changed): 未更改
|
||||||
@@ -96,6 +92,7 @@ Auto format code: 自動格式化程式碼
|
|||||||
Auto organize input: 自動整理輸入
|
Auto organize input: 自動整理輸入
|
||||||
Avatar: 頭像
|
Avatar: 頭像
|
||||||
Back to contest list: 返回比賽列表
|
Back to contest list: 返回比賽列表
|
||||||
|
Background: 背景
|
||||||
Be Copied: 被複制
|
Be Copied: 被複制
|
||||||
Begin at: 開始於
|
Begin at: 開始於
|
||||||
Begin Date: 開始日期
|
Begin Date: 開始日期
|
||||||
@@ -321,6 +318,7 @@ Edit problems: 修改題目
|
|||||||
Edit Profile: 編輯個人資訊
|
Edit Profile: 編輯個人資訊
|
||||||
Edit training plans: 修改訓練計劃
|
Edit training plans: 修改訓練計劃
|
||||||
Edit: 編輯
|
Edit: 編輯
|
||||||
|
Effects only when Difficulty is not 'Use algorithm calculated'.: 僅當難度不為“使用演算法計算”時才起效。
|
||||||
Email Visibility: Email 可見性
|
Email Visibility: Email 可見性
|
||||||
Email: 電子郵件
|
Email: 電子郵件
|
||||||
Enabled: 開啟
|
Enabled: 開啟
|
||||||
@@ -431,6 +429,7 @@ IO: 輸入輸出
|
|||||||
Is rated: 計入排名
|
Is rated: 計入排名
|
||||||
It works!: 它成了!
|
It works!: 它成了!
|
||||||
Italic: 斜體
|
Italic: 斜體
|
||||||
|
Join {0}: 加入 {0}
|
||||||
Join: 加入
|
Join: 加入
|
||||||
Judge Status: 評測狀態
|
Judge Status: 評測狀態
|
||||||
judge_playground: 評測遊樂場
|
judge_playground: 評測遊樂場
|
||||||
@@ -756,6 +755,7 @@ Solutions per page: 每頁展示的題解數量
|
|||||||
Sorry: 對不起
|
Sorry: 對不起
|
||||||
Sort by: 排序
|
Sort by: 排序
|
||||||
Source type: 來源型別
|
Source type: 來源型別
|
||||||
|
Split by ',' '.': 由","、"、"或"。"分隔。
|
||||||
Split View: 分屏預覽
|
Split View: 分屏預覽
|
||||||
Star Topic: 收藏討論
|
Star Topic: 收藏討論
|
||||||
Star: 收藏
|
Star: 收藏
|
||||||
@@ -919,6 +919,7 @@ Week: 周
|
|||||||
What is domain?: 什麼是域?
|
What is domain?: 什麼是域?
|
||||||
What is this?: 這是什麼?
|
What is this?: 這是什麼?
|
||||||
What's domain?: 什麼是域?
|
What's domain?: 什麼是域?
|
||||||
|
What's file?: 什麼是檔案?
|
||||||
What's script?: 什麼是指令碼?
|
What's script?: 什麼是指令碼?
|
||||||
What's this?: 這是什麼?
|
What's this?: 這是什麼?
|
||||||
Whether to show tags in the problem list.: 是否在題目列表中顯示題目的標籤。
|
Whether to show tags in the problem list.: 是否在題目列表中顯示題目的標籤。
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { load as loadOptions } from '../options';
|
|||||||
import { MongoService } from '../service/db';
|
import { MongoService } from '../service/db';
|
||||||
import { SettingService } from '../settings';
|
import { SettingService } from '../settings';
|
||||||
import {
|
import {
|
||||||
addon, builtinModel, model, service,
|
addon, builtinModel, locale, model, service,
|
||||||
} from './common';
|
} from './common';
|
||||||
|
|
||||||
const argv = cac().parse();
|
const argv = cac().parse();
|
||||||
@@ -110,6 +110,7 @@ export async function load(ctx: Context) {
|
|||||||
require('../service/bus').apply(ctx);
|
require('../service/bus').apply(ctx);
|
||||||
const pending = global.addons;
|
const pending = global.addons;
|
||||||
const fail = [];
|
const fail = [];
|
||||||
|
await locale(pending, fail);
|
||||||
await ctx.plugin(MongoService, loadOptions() || {});
|
await ctx.plugin(MongoService, loadOptions() || {});
|
||||||
await ctx.plugin(SettingService);
|
await ctx.plugin(SettingService);
|
||||||
await ctx.plugin(SystemModel.Service);
|
await ctx.plugin(SystemModel.Service);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export interface ProblemSource {
|
export interface ProblemSource {
|
||||||
|
background?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
input?: string;
|
input?: string;
|
||||||
output?: string;
|
output?: string;
|
||||||
@@ -43,36 +44,33 @@ export function buildContent(source: ProblemSource, type: 'markdown' | 'html' =
|
|||||||
'',
|
'',
|
||||||
]).join('\n');
|
]).join('\n');
|
||||||
}
|
}
|
||||||
return type === 'html'
|
const line = (title: string, s: string) => s ? (type === 'html' ? [`<h2>${_(title)}</h2>`, s] : [`## ${_(title)}`, '', s, '']) : [];
|
||||||
? [
|
return [
|
||||||
...source.description ? [`<h2>${_('Description')}</h2>`, source.description] : [],
|
line('Background', source.background),
|
||||||
...source.input ? [`<h2>${_('Input Format')}</h2>`, source.input] : [],
|
line('Problem Description', source.description),
|
||||||
...source.output ? [`<h2>${_('Output Format')}</h2>`, source.output] : [],
|
line('Input Format', source.input),
|
||||||
...(source.samples || []).map((sample, i) => [
|
line('Output Format', source.output),
|
||||||
|
type === 'html'
|
||||||
|
? (source.samples || []).map((sample, i) => [
|
||||||
`<pre><code class="language-input${i + 1}">`,
|
`<pre><code class="language-input${i + 1}">`,
|
||||||
sample[0],
|
sample[0],
|
||||||
`</code></pre><pre><code class="language-output${i + 1}">`,
|
`</code></pre><pre><code class="language-output${i + 1}">`,
|
||||||
sample[1],
|
sample[1],
|
||||||
'</code></pre>',
|
'</code></pre>',
|
||||||
].join('')),
|
].join(''))
|
||||||
...source.samplesRaw ? [source.samplesRaw] : [],
|
: (source.samples || []).flatMap((sample, i) => [
|
||||||
...source.hint ? [`<h2>${_('Hint')}</h2>`, source.hint] : [],
|
'',
|
||||||
...source.source ? [`<h2>${_('Source')}</h2>`, source.source] : [],
|
|
||||||
].join('\n')
|
|
||||||
: [
|
|
||||||
...source.description ? [`## ${_('Description')}`, '', source.description, ''] : [],
|
|
||||||
...source.input ? [`## ${_('Input Format')}`, '', source.input, ''] : [],
|
|
||||||
...source.output ? [`## ${_('Output Format')}`, '', source.output, ''] : [],
|
|
||||||
...(source.samples || []).flatMap((sample, i) => [
|
|
||||||
`\`\`\`input${i + 1}`,
|
`\`\`\`input${i + 1}`,
|
||||||
sample[0],
|
sample[0],
|
||||||
'```',
|
'```',
|
||||||
|
'',
|
||||||
`\`\`\`output${i + 1}`,
|
`\`\`\`output${i + 1}`,
|
||||||
sample[1],
|
sample[1],
|
||||||
'```',
|
'```',
|
||||||
|
'',
|
||||||
]),
|
]),
|
||||||
...source.samplesRaw ? [source.samplesRaw] : [],
|
...source.samplesRaw ? [source.samplesRaw] : [],
|
||||||
...source.hint ? [`## ${_('Hint')}`, '', source.hint, ''] : [],
|
line('Hint', source.hint),
|
||||||
...source.source ? [`## ${_('Source')}`, '', source.source, ''] : [],
|
line('Source', source.source),
|
||||||
].join('\n');
|
].flat().join('\n');
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user