@jutge.org/toolkit 4.4.50 → 4.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/problem-anatomy.md
CHANGED
|
@@ -120,7 +120,7 @@ This optional section describes the output of the problem.
|
|
|
120
120
|
|
|
121
121
|
The `\Sample` section will contain the sample test cases. It is possible to adjust the formatting of the sample test cases: `\SampleOneCol` places input and output test cases one below the other, while `\SampleTwoCol` places them side by side.
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
It is also possible to use `\SampleSession` to get their sample test cases properly formatted as interactive Python sessions using `sample.dt`. The `sample.dt` file should contain the sample test cases using the [doctest](https://docs.python.org/3/library/doctest.html) format and currently must be generated by hand. Using `sample.dt` for compilers different than Python is not explicetely supported, but many users do so.
|
|
124
124
|
|
|
125
125
|
The title inside the `\Problem{}` macro should match the title in the metadata given in the `problem.lang.yml` file, but the title in the LaTeX file can contain math or LaTeX macros whereas the title in the YAML file should be plain text.
|
|
126
126
|
|
package/package.json
CHANGED
package/toolkit/convert.ts
CHANGED
|
@@ -23,7 +23,14 @@ convertCmd
|
|
|
23
23
|
for (const realDirectory of realDirectories) {
|
|
24
24
|
await tui.section(`Processing ${realDirectory}`, async () => {
|
|
25
25
|
const problem = await newProblem(realDirectory)
|
|
26
|
-
|
|
26
|
+
// Single structure keeps one language per directory (ca/, en/, …).
|
|
27
|
+
// findRealDirectories visits each of those directories on its own,
|
|
28
|
+
// so only the statement in the current directory belongs here.
|
|
29
|
+
const languages =
|
|
30
|
+
problem.structure === 'single' && problem.language
|
|
31
|
+
? problem.languages.filter((language) => language === problem.language)
|
|
32
|
+
: problem.languages
|
|
33
|
+
for (const language of languages) {
|
|
27
34
|
await tui.section(`Converting problem.${language}.tex`, async () => {
|
|
28
35
|
const originalText = await readTextInDir(realDirectory, `problem.${language}.tex`)
|
|
29
36
|
const convertedText = replaceAtSigns(originalText)
|