Skip to content

Commit fd9c34f

Browse files
turtlequantclaude
andcommitted
Showcase: fix link text, add operator content lazy-loading, fix code blocks
- Fix display text: geniucker-dev → turtlequant in project links section - Add file_path to operators.json for GitHub raw URL construction - Lazy-load operator markdown content on card expand (from GitHub raw) - Simple markdown renderer for headings, bold, lists, code, tables - Content cached after first load - Add .op-content-body CSS with scroll, syntax styling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6515200 commit fd9c34f

5 files changed

Lines changed: 163 additions & 25 deletions

File tree

docs/site/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ def build_operators() -> dict:
7474
dir_category = md_path.parent.name
7575
category = fm.get("category", dir_category)
7676

77+
# Relative path for GitHub raw URL
78+
rel_path = str(md_path.relative_to(PROJECT_ROOT))
79+
7780
entry = {
7881
"id": fm["id"],
7982
"name": fm.get("name", fm["id"]),
@@ -82,6 +85,7 @@ def build_operators() -> dict:
8285
"tags": fm.get("tags", []),
8386
"data_needed": fm.get("data_needed", []),
8487
"outputs": fm.get("outputs", []),
88+
"file_path": rel_path,
8589
}
8690

8791
# Include gate info if present

docs/site/css/style.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,38 @@ body {
290290
display: none;
291291
}
292292

293+
.op-content-body {
294+
font-size: 0.85rem;
295+
line-height: 1.6;
296+
color: var(--text-secondary);
297+
max-height: 400px;
298+
overflow-y: auto;
299+
padding: 0.5rem;
300+
background: var(--bg-main);
301+
border-radius: 4px;
302+
}
303+
304+
.op-content-body h4, .op-content-body h5 {
305+
color: var(--text-primary);
306+
margin: 0.75rem 0 0.25rem;
307+
}
308+
309+
.op-content-body code {
310+
background: rgba(0,0,0,0.05);
311+
padding: 0.1rem 0.3rem;
312+
border-radius: 3px;
313+
font-size: 0.8rem;
314+
}
315+
316+
.op-content-body li {
317+
margin-left: 1rem;
318+
}
319+
320+
.op-content-body td {
321+
padding: 0.2rem 0.5rem;
322+
border-bottom: 1px solid var(--border);
323+
}
324+
293325
.detail-section {
294326
margin-bottom: 0.6rem;
295327
}

docs/site/data/operators.json

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"desc": "资产质量综合评价"
4646
}
4747
],
48+
"file_path": "operators/v2/bank/asset_quality.md",
4849
"gate": {
4950
"only_industry": [
5051
"银行"
@@ -92,6 +93,7 @@
9293
"desc": "盈利能力综合评价"
9394
}
9495
],
96+
"file_path": "operators/v2/bank/bank_nim.md",
9597
"gate": {
9698
"only_industry": [
9799
"银行"
@@ -141,6 +143,7 @@
141143
"desc": "压力测试综合结论"
142144
}
143145
],
146+
"file_path": "operators/v2/bank/bank_stress_test.md",
144147
"gate": {
145148
"only_industry": [
146149
"银行"
@@ -195,6 +198,7 @@
195198
"desc": "估值综合结论"
196199
}
197200
],
201+
"file_path": "operators/v2/bank/pb_roe_valuation.md",
198202
"gate": {
199203
"only_industry": [
200204
"银行"
@@ -246,6 +250,7 @@
246250
"desc": "护城河综合结论"
247251
}
248252
],
253+
"file_path": "operators/v2/consumer/brand_moat.md",
249254
"gate": {
250255
"only_industry": [
251256
"食品饮料",
@@ -297,6 +302,7 @@
297302
"desc": "增长持续性综合判断"
298303
}
299304
],
305+
"file_path": "operators/v2/consumer/consumer_growth.md",
300306
"gate": {
301307
"only_industry": [
302308
"食品饮料",
@@ -344,7 +350,8 @@
344350
"type": "str",
345351
"desc": "一句话买入逻辑(可证伪、可量化、有时限)"
346352
}
347-
]
353+
],
354+
"file_path": "operators/v2/decision/apple_trading_model.md"
348355
},
349356
{
350357
"id": "position_management",
@@ -387,7 +394,8 @@
387394
"type": "str",
388395
"desc": "宏观事件影响评估(无影响/短期压制/需警惕/止损)"
389396
}
390-
]
397+
],
398+
"file_path": "operators/v2/decision/position_management.md"
391399
},
392400
{
393401
"id": "stress_test",
@@ -426,7 +434,8 @@
426434
"type": "str",
427435
"desc": "通过/勉强通过/不通过"
428436
}
429-
]
437+
],
438+
"file_path": "operators/v2/decision/stress_test.md"
430439
}
431440
],
432441
"forward_risk": [
@@ -472,7 +481,8 @@
472481
"type": "text",
473482
"desc": "下游行业被AI改变导致的间接需求萎缩风险"
474483
}
475-
]
484+
],
485+
"file_path": "operators/v2/forward_risk/ai_disruption.md"
476486
},
477487
{
478488
"id": "industry_position",
@@ -527,7 +537,8 @@
527537
"type": "text",
528538
"desc": "波特五力综合评级与关键结论"
529539
}
530-
]
540+
],
541+
"file_path": "operators/v2/forward_risk/industry_position.md"
531542
},
532543
{
533544
"id": "market_sentiment",
@@ -572,7 +583,8 @@
572583
"type": "text",
573584
"desc": "个股所属行业与大盘的情绪偏离描述"
574585
}
575-
]
586+
],
587+
"file_path": "operators/v2/forward_risk/market_sentiment.md"
576588
},
577589
{
578590
"id": "news_signal",
@@ -613,7 +625,8 @@
613625
"type": "enum [新闻充足, 新闻有限, 无新闻数据-已降级]",
614626
"desc": "新闻数据可用性标记"
615627
}
616-
]
628+
],
629+
"file_path": "operators/v2/forward_risk/news_signal.md"
617630
},
618631
{
619632
"id": "policy_risk",
@@ -673,7 +686,8 @@
673686
"type": "list",
674687
"desc": "影响该公司的关键政策清单"
675688
}
676-
]
689+
],
690+
"file_path": "operators/v2/forward_risk/policy_risk.md"
677691
}
678692
],
679693
"fundamental": [
@@ -719,6 +733,7 @@
719733
"desc": "趋势信号:改善/稳定/恶化/拐点"
720734
}
721735
],
736+
"file_path": "operators/v2/fundamental/cash_trend_5y.md",
722737
"gate": {
723738
"exclude_industry": [
724739
"银行",
@@ -771,7 +786,8 @@
771786
"type": "str",
772787
"desc": "周期判断的关键依据"
773788
}
774-
]
789+
],
790+
"file_path": "operators/v2/fundamental/cycle_analysis.md"
775791
},
776792
{
777793
"id": "debt_structure",
@@ -804,6 +820,7 @@
804820
"desc": "健康/可接受/警惕/危险"
805821
}
806822
],
823+
"file_path": "operators/v2/fundamental/debt_structure.md",
807824
"gate": {
808825
"exclude_industry": [
809826
"银行",
@@ -845,7 +862,8 @@
845862
"type": "list",
846863
"desc": "诚信红旗信号列表"
847864
}
848-
]
865+
],
866+
"file_path": "operators/v2/fundamental/management_integrity.md"
849867
},
850868
{
851869
"id": "performance_restoration",
@@ -879,7 +897,8 @@
879897
"type": "float",
880898
"desc": "还原后实际经营利润(亿)"
881899
}
882-
]
900+
],
901+
"file_path": "operators/v2/fundamental/performance_restoration.md"
883902
},
884903
{
885904
"id": "stream_classification",
@@ -908,7 +927,8 @@
908927
"type": "str",
909928
"desc": "流派归属的关键判据与推理过程"
910929
}
911-
]
930+
],
931+
"file_path": "operators/v2/fundamental/stream_classification.md"
912932
}
913933
],
914934
"manufacturing": [
@@ -956,6 +976,7 @@
956976
"desc": "产能周期综合判断与投资建议"
957977
}
958978
],
979+
"file_path": "operators/v2/manufacturing/capacity_cycle.md",
959980
"gate": {
960981
"only_industry": [
961982
"钢铁",
@@ -1007,6 +1028,7 @@
10071028
"desc": "资本效率综合评价"
10081029
}
10091030
],
1031+
"file_path": "operators/v2/manufacturing/roic_analysis.md",
10101032
"gate": {
10111033
"only_industry": [
10121034
"钢铁",
@@ -1060,6 +1082,7 @@
10601082
"desc": "上下游议价地位综合判断"
10611083
}
10621084
],
1085+
"file_path": "operators/v2/manufacturing/supply_chain_position.md",
10631086
"gate": {
10641087
"only_industry": [
10651088
"钢铁",
@@ -1101,7 +1124,8 @@
11011124
"type": "list",
11021125
"desc": "数据质量警告列表"
11031126
}
1104-
]
1127+
],
1128+
"file_path": "operators/v2/screening/data_source_grading.md"
11051129
},
11061130
{
11071131
"id": "geopolitical_exclusion",
@@ -1133,7 +1157,8 @@
11331157
"type": "bool",
11341158
"desc": "是否一票否决"
11351159
}
1136-
]
1160+
],
1161+
"file_path": "operators/v2/screening/geopolitical_exclusion.md"
11371162
},
11381163
{
11391164
"id": "quick_screen_5min",
@@ -1175,7 +1200,8 @@
11751200
"type": "str",
11761201
"desc": "筛选结论备注"
11771202
}
1178-
]
1203+
],
1204+
"file_path": "operators/v2/screening/quick_screen_5min.md"
11791205
},
11801206
{
11811207
"id": "soe_identification",
@@ -1206,7 +1232,8 @@
12061232
"type": "str",
12071233
"desc": "最终控制人名称"
12081234
}
1209-
]
1235+
],
1236+
"file_path": "operators/v2/screening/soe_identification.md"
12101237
}
12111238
],
12121239
"special": [
@@ -1238,7 +1265,8 @@
12381265
"type": "float",
12391266
"desc": "T级加权清算价值(亿元)"
12401267
}
1241-
]
1268+
],
1269+
"file_path": "operators/v2/special/cigar_butt.md"
12421270
},
12431271
{
12441272
"id": "light_asset_model",
@@ -1268,7 +1296,8 @@
12681296
"type": "float",
12691297
"desc": "经常性收入占比(%)"
12701298
}
1271-
]
1299+
],
1300+
"file_path": "operators/v2/special/light_asset_model.md"
12721301
}
12731302
],
12741303
"tech": [
@@ -1310,6 +1339,7 @@
13101339
"desc": "成长性综合结论"
13111340
}
13121341
],
1342+
"file_path": "operators/v2/tech/tech_growth.md",
13131343
"gate": {
13141344
"only_industry": [
13151345
"科技"
@@ -1356,6 +1386,7 @@
13561386
"desc": "估值综合结论"
13571387
}
13581388
],
1389+
"file_path": "operators/v2/tech/tech_valuation.md",
13591390
"gate": {
13601391
"only_industry": [
13611392
"科技"
@@ -1407,6 +1438,7 @@
14071438
"desc": "所有者收益计算是否有效(负值时为false)"
14081439
}
14091440
],
1441+
"file_path": "operators/v2/valuation/owner_earnings.md",
14101442
"gate": {
14111443
"exclude_industry": [
14121444
"银行",
@@ -1449,7 +1481,8 @@
14491481
"type": "str",
14501482
"desc": "推荐估值方法"
14511483
}
1452-
]
1484+
],
1485+
"file_path": "operators/v2/valuation/pe_trap_detection.md"
14531486
},
14541487
{
14551488
"id": "safety_margin",
@@ -1489,7 +1522,8 @@
14891522
"type": "float",
14901523
"desc": "卖出价位(元)"
14911524
}
1492-
]
1525+
],
1526+
"file_path": "operators/v2/valuation/safety_margin.md"
14931527
},
14941528
{
14951529
"id": "valuation_dividend",
@@ -1518,7 +1552,8 @@
15181552
"type": "bool",
15191553
"desc": "股息是否可持续"
15201554
}
1521-
]
1555+
],
1556+
"file_path": "operators/v2/valuation/valuation_dividend.md"
15221557
},
15231558
{
15241559
"id": "valuation_fcf",
@@ -1573,6 +1608,7 @@
15731608
"desc": "双向验证结论(一致/需调整)"
15741609
}
15751610
],
1611+
"file_path": "operators/v2/valuation/valuation_fcf.md",
15761612
"gate": {
15771613
"exclude_industry": [
15781614
"银行",
@@ -1615,7 +1651,8 @@
16151651
"type": "float",
16161652
"desc": "预期修复回报率(%)"
16171653
}
1618-
]
1654+
],
1655+
"file_path": "operators/v2/valuation/valuation_repair.md"
16191656
}
16201657
]
16211658
}

0 commit comments

Comments
 (0)