feat: complete rule evidence and frozen review fixtures

This commit is contained in:
cflmy committed 2026-11-23 19:10:56 +08:00
1 parent 1f4e120a53
commit 344ef28870
27 files changed
+1992 -356

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
## @exec 判断
根据整数是否为正,返回 1 或 0。
`params(x: Int)`
**结果 = 0**
`if x > 0`
**结果 = 1**
`else`
**结果 = 0**
`end`
返回表示正数与否的整数。
*return 结果*
+23 -12
View File
@@ -1,22 +1,33 @@
use std::{fs, path::Path};
use comrak::{markdown_to_html, Options};
use comrak::markdown_to_html;
use marqdo_lint::input::profile_options;
fn main() {
let manifest = Path::new(env!("CARGO_MANIFEST_DIR"));
let fixtures = [
("examples/good/branches.mq.md", "examples/rendered/branches.html"),
("examples/bad/branch-single-item.mq.md", "examples/rendered/branch-single-item.html"),
("examples/nested/inventory.mq.md", "examples/rendered/inventory.html"),
("examples/knowledge/discount.mq.md", "examples/rendered/discount.html"),
(
"examples/good/branches.mq.md",
"examples/rendered/branches.html",
),
(
"examples/bad/branch-single-item.mq.md",
"examples/rendered/branch-single-item.html",
),
(
"examples/bad/branches-unlisted.mq.md",
"examples/rendered/branches-unlisted.html",
),
(
"examples/nested/inventory.mq.md",
"examples/rendered/inventory.html",
),
(
"examples/knowledge/discount.mq.md",
"examples/rendered/discount.html",
),
];
let mut options = Options::default();
options.extension.table = true;
options.extension.strikethrough = true;
options.extension.tasklist = true;
options.extension.math_dollars = true;
options.extension.math_dollars_block = true;
options.extension.front_matter_delimiter = Some("---".to_string());
let options = profile_options();
for (source, target) in fixtures {
let source_path = manifest.join(source);
+18
View File
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="zh-CN">
<meta charset="utf-8">
<title>Marqdo Lint Review Fixture</title>
<body>
<h2>@exec 判断</h2>
<p>根据整数是否为正,返回 1 或 0。</p>
<p><code>params(x: Int)</code></p>
<p><strong>结果 = 0</strong></p>
<p><code>if x &gt; 0</code></p>
<p><strong>结果 = 1</strong></p>
<p><code>else</code></p>
<p><strong>结果 = 0</strong></p>
<p><code>end</code></p>
<p>返回表示正数与否的整数。</p>
<p><em>return 结果</em></p>
</body>
</html>