njk-tool 0.0.26 → 0.0.27

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.
@@ -13294,794 +13294,794 @@ var TagType;
13294
13294
  TagType["Table"] = "table";
13295
13295
  })(TagType || (TagType = {}));
13296
13296
 
13297
- const styleText = `<style>/* Components.css */
13298
- /* END-Components.css */
13299
- /* ContentTitle.css */
13300
- .collapsible-container {
13301
- --margin: 36px 0 20px;
13302
- width: 100%;
13303
- overflow: hidden;
13304
- margin: var(--margin);
13305
- }
13306
- .collapsible-input {
13307
- display: none;
13308
- }
13309
- .content-title:hover {
13310
- color: #409EFF;
13311
- }
13312
- .collapsible-label {
13313
- display: flex;
13314
- justify-content: space-between;
13315
- align-items: center;
13316
- cursor: pointer;
13317
- }
13318
- .collapsible-label:hover {
13319
- color: #409EFF;
13320
- }
13321
- .collapsible-input:checked~.collapsible-arrow {
13322
- transform: rotate(90deg);
13323
- }
13324
- .collapsible-content {
13325
- max-height: 0;
13326
- overflow: hidden;
13327
- transition: max-height 0.3s cubic-bezier(0, 1, 0, 1) 0.3s ease;
13328
- }
13329
- .collapsible-hover-content {
13330
- max-height: 0;
13331
- overflow: hidden;
13332
- transition: max-height 0.3s cubic-bezier(0, 1, 0, 1) 0.3s ease;
13333
- }
13334
- .collapsible-container:hover>.collapsible-hover-content {
13335
- max-height: 500px;
13336
- }
13337
- .collapsible-input:checked~.collapsible-content {
13338
- max-height: 500px;
13339
- /* 根据内容调整 */
13340
- }
13341
- .title-tag,
13342
- .title-tag-small {
13343
- align-items: center;
13344
- margin-left: 4px;
13345
- border-radius: 4px;
13346
- color: white;
13347
- background-color: #2196F3
13348
- }
13349
- .title-tag-titile-container{
13350
- display: flex;
13351
- align-items: center
13352
- }
13353
- .title-tag-small {
13354
- font-size: 10px;
13355
- padding: 2px 8px;
13356
- }
13357
- .title-tag {
13358
- font-size: 10px;
13359
- padding: 6px 10px;
13360
- }
13361
- /* END-ContentTitle.css */
13362
- /* Divider.css */
13363
- .divider-base {
13364
- border: none;
13365
- height: 1px;
13366
- background: #e0e0e0;
13367
- background-size: 100% 100%;
13368
- margin: 20px 0;
13369
- }
13370
- /* END-Divider.css */
13371
- /* TOC.css */
13372
- /* 基础样式 */
13373
- .article-toc {
13374
- position: fixed;
13375
- top: 50px;
13376
- right: 2rem;
13377
- max-height: calc(100vh - 4rem);
13378
- margin-left: 2rem;
13379
- font-size: 0.95rem;
13380
- }
13381
- /* 隐藏 checkbox */
13382
- .toc-toggle-checkbox {
13383
- position: absolute;
13384
- opacity: 0;
13385
- height: 0;
13386
- width: 0;
13387
- }
13388
- /* 切换按钮样式 */
13389
- .toc-toggle-label {
13390
- display: flex;
13391
- align-items: center;
13392
- background: #f8f9fa;
13393
- padding: 0.3rem 0.6rem;
13394
- border-radius: 4px;
13395
- cursor: pointer;
13396
- margin-bottom: 0.5rem;
13397
- }
13398
- .toc-icon {
13399
- font-size: 1.2rem;
13400
- margin-right: 0.3rem;
13401
- }
13402
- /* 目录导航 */
13403
- .toc-nav {
13404
- padding: 0.5rem;
13405
- background: white;
13406
- border-radius: 6px;
13407
- box-shadow: 0 1px 3px rgba(0,0,0,0.1);
13408
- }
13409
- .toc-section {
13410
- margin-bottom: 0.8rem;
13411
- }
13412
- .toc-heading {
13413
- font-size: 1rem;
13414
- margin: 0 0 0.4rem 0;
13415
- padding-bottom: 0.2rem;
13416
- border-bottom: 1px solid #eee;
13417
- }
13418
- .toc-list {
13419
- list-style: none;
13420
- padding-left: 0.4rem;
13421
- margin: 0;
13422
- }
13423
- .toc-item {
13424
- margin: 0.2rem 0;
13425
- }
13426
- .toc-link {
13427
- display: block;
13428
- padding: 0.2rem 0.4rem;
13429
- color: #495057;
13430
- text-decoration: none;
13431
- border-radius: 3px;
13432
- transition: all 0.2s;
13433
- }
13434
- .toc-link:hover {
13435
- background: #f0f0f0;
13436
- color: #007bff;
13437
- }
13438
- /* 层级缩进 */
13439
- .toc-link[data-level="2"] {
13440
- padding-left: 0.8rem;
13441
- }
13442
- .toc-link[data-level="3"] {
13443
- padding-left: 1.6rem;
13444
- }
13445
- /* 激活状态 */
13446
- .toc-link.active {
13447
- background: #e7f5ff;
13448
- color: #0066cc;
13449
- font-weight: 500;
13450
- }
13451
- /* 折叠功能实现 */
13452
- .toc-toggle-checkbox:not(:checked) ~ .toc-nav {
13453
- display: none;
13454
- }
13455
- /* 响应式设计 */
13456
- @media (max-width: 768px) {
13457
- .article-toc {
13458
- margin-left: 1rem;
13459
- font-size: 0.9rem;
13460
- }
13461
- }
13462
- /* END-TOC.css */
13463
- /* Text.css */
13464
- /* END-Text.css */
13465
- /* Title.css */
13466
- .title-base {
13467
- text-align: center;
13468
- font-weight: bolder;
13469
- }
13470
- .njk-title-h1 {
13471
- position: relative;
13472
- padding: 0 0 4.8px;
13473
- }
13474
- .njk-title-h2 {
13475
- position: relative;
13476
- }
13477
- .njk-title-h3 {
13478
- position: relative;
13479
- margin-bottom: 10px;
13480
- }
13481
- /* .njk-title-h2::before,
13482
- .njk-title-h1::before {
13483
- display: none;
13484
- position: absolute;
13485
- content: "# ";
13486
- color: #007bff;
13487
- }
13488
- .njk-title-h1::before {
13489
- left: -26px;
13490
- }
13491
- .njk-title-h2::before {
13492
- left: -18px;
13493
- }
13494
- .njk-title-h1:hover::before,
13495
- .njk-title-h2:hover::before {
13496
- display: inline-block;
13497
- } */
13498
- /* END-Title.css */
13499
- /* Notice.css */
13500
- /* Notice */
13501
- .notice {
13502
- margin: 16px 0;
13503
- padding: 12px 16px;
13504
- margin-bottom: 1rem;
13505
- border-radius: 4px;
13506
- font-size: 14px;
13507
- line-height: 1.5rem;
13508
- }
13509
- .notice-title {
13510
- font-weight: bold;
13511
- margin-bottom: 4px;
13512
- }
13513
- /* 不同类型的通知样式 */
13514
- .notice-info {
13515
- background-color: #e8f4ff;
13516
- border-left: 4px solid #1890ff;
13517
- }
13518
- .notice-warning {
13519
- background-color: #fff7e6;
13520
- border-left: 4px solid #faad14;
13521
- }
13522
- .notice-success {
13523
- background-color: #f6ffed;
13524
- border-left: 4px solid #52c41a;
13525
- }
13526
- .notice-error {
13527
- background-color: #fff2f0;
13528
- border-left: 4px solid #f5222d;
13529
- }
13530
- /* END-Notice.css */
13531
- /* Table.css */
13532
- .my-daframe-default {
13533
- margin: 0 auto 20px;
13534
- border-collapse: collapse;
13535
- border: 2px solid black;
13536
- /* 合并边框 */
13537
- font-family: Arial, Helvetica, sans-serif;
13538
- font-size: 14px;
13539
- color: #444444;
13540
- }
13541
- .my-daframe-default a {
13542
- text-decoration: none !important;
13543
- color: #444444 !important;
13544
- font-family: Arial, Helvetica, sans-serif;
13545
- font-size: 14px;
13546
- }
13547
- .thead-light th {
13548
- white-space: nowrap;
13549
- background-color: #e0e3e8;
13550
- /* background-color: #f5f7fa; */
13551
- color: #333333;
13552
- font-weight: 600;
13553
- padding: 12px 16px;
13554
- text-align: left;
13555
- border-right: 1px solid rgba(19, 18, 18, 0.6);
13556
- border-bottom: 2px solid black;
13557
- font-size: 16px;
13558
- }
13559
- .my-daframe-default tr {
13560
- border-bottom: 1px solid black;
13561
- }
13562
- .my-daframe-default td {
13563
- border-right: 1px solid rgba(19, 18, 18, 0.6);
13564
- /* color: #333333; */
13565
- /* font-weight: 600; */
13566
- /* text-align: left; */
13567
- }
13568
- .default-row {
13569
- border: 1px solid #eee;
13570
- background-color: #fff;
13571
- }
13572
- .default-row:hover {
13573
- background-color: #f0f4f8;
13574
- color: rebeccapurple;
13575
- }
13576
- .default-cell {
13577
- padding: 10px 16px;
13578
- /* border: 1px solid #e1e4e8; */
13579
- font-weight: 400;
13580
- font-size: 14px;
13581
- color: #444;
13582
- background-color: transparent;
13583
- }
13584
- /* END-Table.css */
13585
- /* Block.css */
13586
- /* Block.njk */
13587
- .code-block {
13588
- --block-margin: 0px
13589
- margin: var(--block-margin) 0;
13590
- border-radius: 4px;
13591
- overflow: hidden;
13592
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
13593
- }
13594
- .code-block pre {
13595
- margin: 0;
13596
- padding: 1rem;
13597
- background-color: #f5f5f5;
13598
- font-family: 'Courier New', monospace;
13599
- font-size: 14px;
13600
- line-height: 1.5;
13601
- white-space: pre-wrap;
13602
- }
13603
- .code-block code {
13604
- display: block;
13605
- overflow-x: auto;
13606
- }
13607
- /* END-Block.css */
13608
- /* Date.css */
13609
- .center-info-box {
13610
- margin-top: -20px;
13611
- margin-bottom: 20px;
13612
- text-align: center;
13613
- color: black;
13614
- }
13615
- /* END-Date.css */
13616
- /* Tab.css */
13617
- /* Tab 容器 */
13618
- .tab-container {
13619
- max-width: 600px;
13620
- margin: 0 auto;
13621
- }
13622
- /* 隐藏 Radio 按钮 */
13623
- .tab-radio {
13624
- display: none;
13625
- }
13626
- /* Tab 按钮样式 */
13627
- .tab-labels {
13628
- display: flex;
13629
- border-bottom: 1px solid #ccc;
13630
- }
13631
- .tab-label {
13632
- padding: 5px 10px;
13633
- cursor: pointer;
13634
- background-color: #f1f1f1;
13635
- border: 1px solid #ccc;
13636
- border-bottom: none;
13637
- margin-right: 2px;
13638
- border-radius: 5px 5px 0 0;
13639
- }
13640
- .tab-label:hover {
13641
- background-color: #ddd;
13642
- }
13643
- .tab-radio:checked+.tab-label {
13644
- background-color: #fff;
13645
- border-bottom: 1px solid #fff;
13646
- margin-bottom: -1px;
13647
- }
13648
- /* Tab 内容区域 */
13649
- .tab-content {
13650
- display: none;
13651
- padding: 20px;
13652
- border: 1px solid #ccc;
13653
- border-top: none;
13654
- }
13655
- /* END-Tab.css */
13656
- /* Base.css */
13657
- body {
13658
- margin: 0;
13659
- padding: 0;
13660
- font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
13661
- }
13662
- /* PC端样式 */
13663
- a {
13664
- text-decoration: none;
13665
- }
13666
- a:hover {
13667
- color: #409EFF;
13668
- }
13669
- .email-main-container {
13670
- margin: 0;
13671
- min-width: 1000px;
13672
- padding: 0 5rem;
13673
- }
13674
- :root {
13675
- --njk-title-color: black;
13676
- --njk-title-align: center;
13677
- --njk-title-position: relative;
13678
- --njk-title-margin: 36px 0 20px;
13679
- --njk-table-margin: 0 auto 20px;
13680
- }
13681
- /* END-Base.css */
13297
+ const styleText = `<style>/* Components.css */
13298
+ /* END-Components.css */
13299
+ /* ContentTitle.css */
13300
+ .collapsible-container {
13301
+ --margin: 36px 0 20px;
13302
+ width: 100%;
13303
+ overflow: hidden;
13304
+ margin: var(--margin);
13305
+ }
13306
+ .collapsible-input {
13307
+ display: none;
13308
+ }
13309
+ .content-title:hover {
13310
+ color: #409EFF;
13311
+ }
13312
+ .collapsible-label {
13313
+ display: flex;
13314
+ justify-content: space-between;
13315
+ align-items: center;
13316
+ cursor: pointer;
13317
+ }
13318
+ .collapsible-label:hover {
13319
+ color: #409EFF;
13320
+ }
13321
+ .collapsible-input:checked~.collapsible-arrow {
13322
+ transform: rotate(90deg);
13323
+ }
13324
+ .collapsible-content {
13325
+ max-height: 0;
13326
+ overflow: hidden;
13327
+ transition: max-height 0.3s cubic-bezier(0, 1, 0, 1) 0.3s ease;
13328
+ }
13329
+ .collapsible-hover-content {
13330
+ max-height: 0;
13331
+ overflow: hidden;
13332
+ transition: max-height 0.3s cubic-bezier(0, 1, 0, 1) 0.3s ease;
13333
+ }
13334
+ .collapsible-container:hover>.collapsible-hover-content {
13335
+ max-height: 500px;
13336
+ }
13337
+ .collapsible-input:checked~.collapsible-content {
13338
+ max-height: 500px;
13339
+ /* 根据内容调整 */
13340
+ }
13341
+ .title-tag,
13342
+ .title-tag-small {
13343
+ align-items: center;
13344
+ margin-left: 4px;
13345
+ border-radius: 4px;
13346
+ color: white;
13347
+ background-color: #2196F3
13348
+ }
13349
+ .title-tag-titile-container{
13350
+ display: flex;
13351
+ align-items: center
13352
+ }
13353
+ .title-tag-small {
13354
+ font-size: 10px;
13355
+ padding: 2px 8px;
13356
+ }
13357
+ .title-tag {
13358
+ font-size: 10px;
13359
+ padding: 6px 10px;
13360
+ }
13361
+ /* END-ContentTitle.css */
13362
+ /* Divider.css */
13363
+ .divider-base {
13364
+ border: none;
13365
+ height: 1px;
13366
+ background: #e0e0e0;
13367
+ background-size: 100% 100%;
13368
+ margin: 20px 0;
13369
+ }
13370
+ /* END-Divider.css */
13371
+ /* TOC.css */
13372
+ /* 基础样式 */
13373
+ .article-toc {
13374
+ position: fixed;
13375
+ top: 50px;
13376
+ right: 2rem;
13377
+ max-height: calc(100vh - 4rem);
13378
+ margin-left: 2rem;
13379
+ font-size: 0.95rem;
13380
+ }
13381
+ /* 隐藏 checkbox */
13382
+ .toc-toggle-checkbox {
13383
+ position: absolute;
13384
+ opacity: 0;
13385
+ height: 0;
13386
+ width: 0;
13387
+ }
13388
+ /* 切换按钮样式 */
13389
+ .toc-toggle-label {
13390
+ display: flex;
13391
+ align-items: center;
13392
+ background: #f8f9fa;
13393
+ padding: 0.3rem 0.6rem;
13394
+ border-radius: 4px;
13395
+ cursor: pointer;
13396
+ margin-bottom: 0.5rem;
13397
+ }
13398
+ .toc-icon {
13399
+ font-size: 1.2rem;
13400
+ margin-right: 0.3rem;
13401
+ }
13402
+ /* 目录导航 */
13403
+ .toc-nav {
13404
+ padding: 0.5rem;
13405
+ background: white;
13406
+ border-radius: 6px;
13407
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
13408
+ }
13409
+ .toc-section {
13410
+ margin-bottom: 0.8rem;
13411
+ }
13412
+ .toc-heading {
13413
+ font-size: 1rem;
13414
+ margin: 0 0 0.4rem 0;
13415
+ padding-bottom: 0.2rem;
13416
+ border-bottom: 1px solid #eee;
13417
+ }
13418
+ .toc-list {
13419
+ list-style: none;
13420
+ padding-left: 0.4rem;
13421
+ margin: 0;
13422
+ }
13423
+ .toc-item {
13424
+ margin: 0.2rem 0;
13425
+ }
13426
+ .toc-link {
13427
+ display: block;
13428
+ padding: 0.2rem 0.4rem;
13429
+ color: #495057;
13430
+ text-decoration: none;
13431
+ border-radius: 3px;
13432
+ transition: all 0.2s;
13433
+ }
13434
+ .toc-link:hover {
13435
+ background: #f0f0f0;
13436
+ color: #007bff;
13437
+ }
13438
+ /* 层级缩进 */
13439
+ .toc-link[data-level="2"] {
13440
+ padding-left: 0.8rem;
13441
+ }
13442
+ .toc-link[data-level="3"] {
13443
+ padding-left: 1.6rem;
13444
+ }
13445
+ /* 激活状态 */
13446
+ .toc-link.active {
13447
+ background: #e7f5ff;
13448
+ color: #0066cc;
13449
+ font-weight: 500;
13450
+ }
13451
+ /* 折叠功能实现 */
13452
+ .toc-toggle-checkbox:not(:checked) ~ .toc-nav {
13453
+ display: none;
13454
+ }
13455
+ /* 响应式设计 */
13456
+ @media (max-width: 768px) {
13457
+ .article-toc {
13458
+ margin-left: 1rem;
13459
+ font-size: 0.9rem;
13460
+ }
13461
+ }
13462
+ /* END-TOC.css */
13463
+ /* Text.css */
13464
+ /* END-Text.css */
13465
+ /* Title.css */
13466
+ .title-base {
13467
+ text-align: center;
13468
+ font-weight: bolder;
13469
+ }
13470
+ .njk-title-h1 {
13471
+ position: relative;
13472
+ padding: 0 0 4.8px;
13473
+ }
13474
+ .njk-title-h2 {
13475
+ position: relative;
13476
+ }
13477
+ .njk-title-h3 {
13478
+ position: relative;
13479
+ margin-bottom: 10px;
13480
+ }
13481
+ /* .njk-title-h2::before,
13482
+ .njk-title-h1::before {
13483
+ display: none;
13484
+ position: absolute;
13485
+ content: "# ";
13486
+ color: #007bff;
13487
+ }
13488
+ .njk-title-h1::before {
13489
+ left: -26px;
13490
+ }
13491
+ .njk-title-h2::before {
13492
+ left: -18px;
13493
+ }
13494
+ .njk-title-h1:hover::before,
13495
+ .njk-title-h2:hover::before {
13496
+ display: inline-block;
13497
+ } */
13498
+ /* END-Title.css */
13499
+ /* Notice.css */
13500
+ /* Notice */
13501
+ .notice {
13502
+ margin: 16px 0;
13503
+ padding: 12px 16px;
13504
+ margin-bottom: 1rem;
13505
+ border-radius: 4px;
13506
+ font-size: 14px;
13507
+ line-height: 1.5rem;
13508
+ }
13509
+ .notice-title {
13510
+ font-weight: bold;
13511
+ margin-bottom: 4px;
13512
+ }
13513
+ /* 不同类型的通知样式 */
13514
+ .notice-info {
13515
+ background-color: #e8f4ff;
13516
+ border-left: 4px solid #1890ff;
13517
+ }
13518
+ .notice-warning {
13519
+ background-color: #fff7e6;
13520
+ border-left: 4px solid #faad14;
13521
+ }
13522
+ .notice-success {
13523
+ background-color: #f6ffed;
13524
+ border-left: 4px solid #52c41a;
13525
+ }
13526
+ .notice-error {
13527
+ background-color: #fff2f0;
13528
+ border-left: 4px solid #f5222d;
13529
+ }
13530
+ /* END-Notice.css */
13531
+ /* Table.css */
13532
+ .my-daframe-default {
13533
+ margin: 0 auto 20px;
13534
+ border-collapse: collapse;
13535
+ border: 2px solid black;
13536
+ /* 合并边框 */
13537
+ font-family: Arial, Helvetica, sans-serif;
13538
+ font-size: 14px;
13539
+ color: #444444;
13540
+ }
13541
+ .my-daframe-default a {
13542
+ text-decoration: none !important;
13543
+ color: #444444 !important;
13544
+ font-family: Arial, Helvetica, sans-serif;
13545
+ font-size: 14px;
13546
+ }
13547
+ .thead-light th {
13548
+ white-space: nowrap;
13549
+ background-color: #e0e3e8;
13550
+ /* background-color: #f5f7fa; */
13551
+ color: #333333;
13552
+ font-weight: 600;
13553
+ padding: 12px 16px;
13554
+ text-align: left;
13555
+ border-right: 1px solid rgba(19, 18, 18, 0.6);
13556
+ border-bottom: 2px solid black;
13557
+ font-size: 16px;
13558
+ }
13559
+ .my-daframe-default tr {
13560
+ border-bottom: 1px solid black;
13561
+ }
13562
+ .my-daframe-default td {
13563
+ border-right: 1px solid rgba(19, 18, 18, 0.6);
13564
+ /* color: #333333; */
13565
+ /* font-weight: 600; */
13566
+ /* text-align: left; */
13567
+ }
13568
+ .default-row {
13569
+ border: 1px solid #eee;
13570
+ background-color: #fff;
13571
+ }
13572
+ .default-row:hover {
13573
+ background-color: #f0f4f8;
13574
+ color: rebeccapurple;
13575
+ }
13576
+ .default-cell {
13577
+ padding: 10px 16px;
13578
+ /* border: 1px solid #e1e4e8; */
13579
+ font-weight: 400;
13580
+ font-size: 14px;
13581
+ color: #444;
13582
+ background-color: transparent;
13583
+ }
13584
+ /* END-Table.css */
13585
+ /* Block.css */
13586
+ /* Block.njk */
13587
+ .code-block {
13588
+ --block-margin: 0px
13589
+ margin: var(--block-margin) 0;
13590
+ border-radius: 4px;
13591
+ overflow: hidden;
13592
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
13593
+ }
13594
+ .code-block pre {
13595
+ margin: 0;
13596
+ padding: 1rem;
13597
+ background-color: #f5f5f5;
13598
+ font-family: 'Courier New', monospace;
13599
+ font-size: 14px;
13600
+ line-height: 1.5;
13601
+ white-space: pre-wrap;
13602
+ }
13603
+ .code-block code {
13604
+ display: block;
13605
+ overflow-x: auto;
13606
+ }
13607
+ /* END-Block.css */
13608
+ /* Date.css */
13609
+ .center-info-box {
13610
+ margin-top: -20px;
13611
+ margin-bottom: 20px;
13612
+ text-align: center;
13613
+ color: black;
13614
+ }
13615
+ /* END-Date.css */
13616
+ /* Tab.css */
13617
+ /* Tab 容器 */
13618
+ .tab-container {
13619
+ max-width: 600px;
13620
+ margin: 0 auto;
13621
+ }
13622
+ /* 隐藏 Radio 按钮 */
13623
+ .tab-radio {
13624
+ display: none;
13625
+ }
13626
+ /* Tab 按钮样式 */
13627
+ .tab-labels {
13628
+ display: flex;
13629
+ border-bottom: 1px solid #ccc;
13630
+ }
13631
+ .tab-label {
13632
+ padding: 5px 10px;
13633
+ cursor: pointer;
13634
+ background-color: #f1f1f1;
13635
+ border: 1px solid #ccc;
13636
+ border-bottom: none;
13637
+ margin-right: 2px;
13638
+ border-radius: 5px 5px 0 0;
13639
+ }
13640
+ .tab-label:hover {
13641
+ background-color: #ddd;
13642
+ }
13643
+ .tab-radio:checked+.tab-label {
13644
+ background-color: #fff;
13645
+ border-bottom: 1px solid #fff;
13646
+ margin-bottom: -1px;
13647
+ }
13648
+ /* Tab 内容区域 */
13649
+ .tab-content {
13650
+ display: none;
13651
+ padding: 20px;
13652
+ border: 1px solid #ccc;
13653
+ border-top: none;
13654
+ }
13655
+ /* END-Tab.css */
13656
+ /* Base.css */
13657
+ body {
13658
+ margin: 0;
13659
+ padding: 0;
13660
+ font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
13661
+ }
13662
+ /* PC端样式 */
13663
+ a {
13664
+ text-decoration: none;
13665
+ }
13666
+ a:hover {
13667
+ color: #409EFF;
13668
+ }
13669
+ .email-main-container {
13670
+ margin: 0;
13671
+ min-width: 1000px;
13672
+ padding: 0 5rem;
13673
+ }
13674
+ :root {
13675
+ --njk-title-color: black;
13676
+ --njk-title-align: center;
13677
+ --njk-title-position: relative;
13678
+ --njk-title-margin: 36px 0 20px;
13679
+ --njk-table-margin: 0 auto 20px;
13680
+ }
13681
+ /* END-Base.css */
13682
13682
  </style>`;
13683
13683
 
13684
- const templateText = `<!-- Head.njk -->
13685
- {% macro use_head(ctx) %}
13686
- <head>
13687
- <meta charset="UTF-8" />
13688
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
13689
- <title>{{ ctx.title }}</title>
13690
- {% if ctx.jsFiles%}
13691
- {% for css in ctx.cssFiles %}
13692
- <link rel="stylesheet" href="{{ css }}" />
13693
- {% endfor %}
13694
- {% endif %}
13695
- </head>
13696
- {% if ctx.jsFiles%}
13697
- {% for js in ctx.jsFiles %}
13698
- <script src="{{ js }}"></script>
13699
- {% endfor %}
13700
- {% endif %}
13701
- {% endmacro %}
13702
- {% macro use_comp_start(ctx) %}
13703
- <table style="width: 100%;table-layout: auto">
13704
- <tr>
13705
- <td>
13706
- {% endmacro %}
13707
- {% macro use_comp_end(ctx) %}
13708
- </td>
13709
- </tr>
13710
- </table>
13711
- {% endmacro %}
13712
- <!-- /Head.njk -->
13713
- <!-- TOC.njk -->
13714
- {% macro use_toc(ctx) %}
13715
- <div class="article-toc">
13716
- <input type="checkbox" id="toc-toggle" class="toc-toggle-checkbox">
13717
- <label for="toc-toggle" class="toc-toggle-label">
13718
- <span class="toc-icon">≡</span>
13719
- <span class="toc-text">目录</span>
13720
- </label>
13721
- <nav class="toc-nav">
13722
- {% for section in ctx.data %}
13723
- <section class="toc-section">
13724
- {% if section.link %}
13725
- <h3 class="toc-heading">
13726
- <a href="{{ section.link }}" class="toc-link">{{ section.text }}</a>
13727
- </h3>
13728
- {% else%}
13729
- <h3 class="toc-heading">{{ section.text }}</h3>
13730
- {% endif %}
13731
- <ul class="toc-list">
13732
- {% for item in section.items %}
13733
- <li class="toc-item">
13734
- <a href="{{ item.link }}" class="toc-link" data-level="{{ loop.depth }}">
13735
- {% if loop.depth > 1 %}•{% endif %}
13736
- {{ item.text }}
13737
- </a>
13738
- </li>
13739
- {% endfor %}
13740
- </ul>
13741
- </section>
13742
- {% endfor %}
13743
- </nav>
13744
- </div>
13745
- {% endmacro %}
13746
- <!-- /TOC.njk -->
13747
- <!-- Divider.njk -->
13748
- {% macro use_divider(ctx) %}
13749
- <hr class="divider-base">
13750
- {% endmacro %}
13751
- <!-- /Divider.njk -->
13752
- <!-- Tag.njk -->
13753
- {% macro use_tag(ctx) %}
13754
- {% set tagClass = "smart-tag" %}
13755
- {% set defaultColor = "#4CAF50" %}
13756
- {% set defaultSize = "medium" %}
13757
- {% set finalColor = defaultColor %}
13758
- {% set finalSize = defaultSize %}
13759
- <span class="{{ tagClass }} {{ finalSize }}" style="background-color: {{ finalColor }};">
13760
- {{ ctx.text }}
13761
- </span>
13762
- <style>
13763
- .smart-tag {
13764
- display: inline-flex;
13765
- align-items: center;
13766
- padding: 4px 12px;
13767
- border-radius: 4px;
13768
- font-family: Arial, sans-serif;
13769
- color: white;
13770
- white-space: nowrap;
13771
- transition: all 0.3s ease;
13772
- }
13773
- /* 尺寸控制 */
13774
- .smart-tag.small {
13775
- font-size: 12px;
13776
- padding: 2px 8px;
13777
- }
13778
- .smart-tag.medium {
13779
- font-size: 14px;
13780
- padding: 4px 12px;
13781
- }
13782
- .smart-tag.large {
13783
- font-size: 16px;
13784
- padding: 6px 16px;
13785
- }
13786
- /* 颜色扩展支持 */
13787
- .smart-tag.blue { background-color: #2196F3 !important; }
13788
- .smart-tag.red { background-color: #f44336 !important; }
13789
- .smart-tag.green { background-color: #4CAF50 !important; }
13790
- </style>
13791
- {% endmacro %}
13792
- <!-- /Tag.njk -->
13793
- <!-- Title.njk -->
13794
- {% macro use_table_wrapper(macro) %}
13795
- <table style="width: 100%;table-layout: auto">
13796
- <th>
13797
- <td>{{ macro }}</td>
13798
- </th>
13799
- </table>
13800
- {% endmacro %}
13801
- {% macro title_default(ctx) %}
13802
- <h1 class="title-base">{{ ctx.text }}</h1>
13803
- {% endmacro %}
13804
- {% macro title_h1(ctx) %}
13805
- <h1 class="title-base njk-title-h1" id="{{ ctx.text }}" style="{{ ctx.style }}">
13806
- {{ ctx.text }}
13807
- </h1>
13808
- {% endmacro %}
13809
- {% macro title_h2(ctx) %}
13810
- <h2 class="title-base njk-title-h2" id="{{ ctx.text }}" class="" style="{{ ctx.style }}">
13811
- {{ ctx.text }}
13812
- </h2>
13813
- {% endmacro %}
13814
- {% macro title_h3(ctx) %}
13815
- <h3 class="title-base njk-title-h3" id="{{ ctx.text }}" class="" style="{{ ctx.style }}">
13816
- {{ ctx.text }}
13817
- </h3>
13818
- {% endmacro %}
13819
- {% macro title_table_default(ctx) %}
13820
- {{ use_comp_start() }}
13821
- <h3 class="title-base njk-title-h3" id="{{ ctx.text }}">
13822
- {{ ctx.text }}
13823
- </h3>
13824
- {{ use_comp_end() }}
13825
- {% endmacro %}
13826
- {% macro use_title(ctx) %}
13827
- {% if ctx.type == "h1" %}
13828
- {{ title_h1(ctx) }}
13829
- {% elif ctx.type == "h2" %}
13830
- {{ title_h2(ctx) }}
13831
- {% elif ctx.type == "h3" %}
13832
- {{ title_h3(ctx) }}
13833
- {% else %}
13834
- {{ title_default(ctx) }}
13835
- {% endif %}
13836
- {% endmacro %}
13837
- <!-- /Title.njk -->
13838
- <!-- Notice.njk -->
13839
- {% macro use_notice(ctx) %}
13840
- {% if ctx.type %}
13841
- {% set type = ctx.type %}
13842
- {% else %}
13843
- {% set type = "info" %}
13844
- {% endif %}
13845
- <div class="notice notice-{{ type }}">
13846
- <div class="notice-title">{{ type|capitalize }}:</div>
13847
- <pre class="notice-content">{{ ctx.text }}</pre>
13848
- </div>
13849
- {% endmacro %}
13850
- <!-- /Notice.njk -->
13851
- <!-- Block.njk -->
13852
- {% macro use_block(ctx) %}
13853
- <div class="code-block">
13854
- <pre><code>{{ ctx.text }}</code></pre>
13855
- </div>
13856
- {% endmacro %}
13857
- <!-- /Block.njk -->
13858
- <!-- Date.njk -->
13859
- {% macro use_date(ctx) %}
13860
- <div class="center-info-box" style="text-align: center;"><span style="font-weight:bolder;">Date:</span>{{ ctx.text}}</div>
13861
- {% endmacro %}
13862
- {% macro use_checker(ctx) %}
13863
- <div class="center-info-box" style="text-align: center;"><span style="font-weight:bolder;">Checker:</span>{{ ctx.text}}</div>
13864
- {% endmacro %}
13865
- <!-- /Date.njk -->
13866
- <!-- Table.njk -->
13867
- {% macro td_default(ctx) %}
13868
- {% if ctx.text %}
13869
- {% set text = ctx.text %}
13870
- {% else %}
13871
- {% set text = ctx %}
13872
- {% endif %}
13873
- <td class="default-cell">{{ text | replace("false", "❌")| replace("False", "❌")| replace("True", "✔️") | replace("true", "✔️") }}</td>
13874
- {% endmacro %}
13875
- {% macro table_default(ctx) %}
13876
- {% if ctx.columns %}
13877
- {% set columns = ctx.columns %}
13878
- {% elif ctx.th %}
13879
- {% set columns = ctx.th %}
13880
- {% else %}
13881
- {% set columns = [] %}
13882
- {% endif %}
13883
- {% if ctx.data %}
13884
- {% set data = ctx.data %}
13885
- {% elif ctx.tbody %}
13886
- {% set data = ctx.tbody %}
13887
- {% endif %}
13888
- {% if ctx.title %}
13889
- {% set title = {text:ctx.title} %}
13890
- {{ use_comp_start() }}
13891
- {{ title_h2(title) }}
13892
- {{ use_comp_end() }}
13893
- {% endif %}
13894
- <table class="my-daframe-default">
13895
- <thead class="thead-light">
13896
- <tr>
13897
- {% for column in columns %}
13898
- <th>{{ column }}</th>
13899
- {% endfor %}
13900
- </tr>
13901
- </thead>
13902
- <tbody>
13903
- {% for row in data %}
13904
- <tr class="default-row">
13905
- {% if ctx.data %}
13906
- {% for column in columns %}
13907
- {{ td_default(row[column]) }}
13908
- {% endfor %}
13909
- {% else %}
13910
- {% for value in row %}
13911
- {{ td_default(value) }}
13912
- {% endfor %}
13913
- {% endif %}
13914
- </tr>
13915
- {% endfor %}
13916
- </tbody>
13917
- </table>
13918
- {% endmacro %}
13919
- {% macro use_table(ctx) %}
13920
- {% if ctx.title %}
13921
- {{ table_default(ctx) }}
13922
- {% else %}
13923
- {{ table_default(ctx) }}
13924
- {% endif %}
13925
- {% endmacro %}
13926
- <!-- /Table.njk -->
13927
- <!-- Tab.njk -->
13928
- {% macro useTab(tabs) %}
13929
- <style>
13930
- /* 显示选中的 Tab 内容 */
13931
- {% for tab in tabs %}
13932
- #{{tab.id}}:checked~#{{tab.content_id}} {
13933
- display: block;
13934
- }
13935
- {% endfor %}
13936
- </style>
13937
- <div class="tab-container">
13938
- {% for tab in tabs %}
13939
- <!-- Radio 按钮(隐藏) -->
13940
- <input {% if loop.first %} checked {% endif %} type="radio" name="tabs" id="{{ tab.id }}" class="tab-radio">
13941
- {% endfor %}
13942
- <!-- Tab 按钮(用 label 包裹) -->
13943
- <div class="tab-labels">
13944
- {% for tab in tabs %}
13945
- <label for="{{ tab.id }}" class="tab-label">{{ tab.title }}
13946
- </label>
13947
- {% endfor %}
13948
- </div>
13949
- <!-- Tab 内容 -->
13950
- {% for tab in tabs %}
13951
- <div id="{{ tab.content_id }}" class="tab-content">
13952
- {{ tab.content }}
13953
- </div>
13954
- {% endfor %}
13955
- </div>
13956
- {% endmacro %}
13957
- <!-- /Tab.njk -->
13958
- <!-- ContentTitle.njk -->
13959
- {% macro h3_handler(ctx) %}
13960
- <div class="title-tag-titile-container">
13961
- {% if ctx.h3 %}
13962
- <h3 style="margin: 0;" class="content-title">{{ ctx.title }}</h3>
13963
- {% else %}
13964
- <h2 style="margin: 0;" class="content-title">{{ ctx.title }}</h3>
13965
- {% endif %}
13966
- <span class="title-tag-small">注释</span>
13967
- </div>
13968
- {% endmacro %}
13969
- {% macro content_title_click(ctx) %}
13970
- <div class="collapsible-container">
13971
- <input type="checkbox" id="{{ ctx.title }}" class="collapsible-input" hidden>
13972
- <label for="{{ ctx.title }}" class="collapsible-label">
13973
- {{ h3_handler(ctx) }}
13974
- </label>
13975
- <div class="collapsible-content">
13976
- {{ use_block(ctx) }}
13977
- </div>
13978
- </div>
13979
- {% endmacro %}
13980
- {% macro content_title_hover(ctx) %}
13981
- <div class="collapsible-container">
13982
- <div class="collapsible-label">
13983
- {{ h3_handler(ctx) }}
13984
- </div>
13985
- <div class="collapsible-hover-content">
13986
- {{ use_block(ctx) }}
13987
- </div>
13988
- </div>
13989
- {% endmacro %}
13990
- {% macro content_title_remain(ctx) %}
13991
- <div class="collapsible-container">
13992
- {{ h3_handler(ctx) }}
13993
- <div>
13994
- {{ use_block(ctx) }}
13995
- </div>
13996
- </div>
13997
- {% endmacro %}
13998
- {% macro pick_content_title(ctx) %}
13999
- {% if ctx.hover %}
14000
- {{ content_title_hover(ctx) }}
14001
- {% elif ctx.remain %}
14002
- {{ content_title_remain(ctx) }}
14003
- {% else %}
14004
- {{ content_title_click(ctx) }}
14005
- {% endif %}
14006
- {% endmacro %}
14007
- {% macro use_content_title(ctx) %}
14008
- {% if ctx.type == "h3" or ctx.type == "hover_h3" or ctx.type == "remain_h3" %}
14009
- {% set h3 = true %}
14010
- {% endif %}
14011
- {% if ctx.type == "hover_h3" or ctx.type == "hover" %}
14012
- {% set hover = true %}
14013
- {% endif %}
14014
- {% if ctx.type == "remain_h3" or ctx.type == "remain" %}
14015
- {% set remain = true %}
14016
- {% endif %}
14017
- {% set param = {title:ctx.title, text:ctx.text, h3:h3, hover:hover, remain:remain} %}
14018
- {{ pick_content_title(param) }}
14019
- {% endmacro %}
14020
- <!-- /ContentTitle.njk -->
14021
- <!-- Component.njk -->
14022
- {% macro pick_component(ctx) %}
14023
- {% if ctx.tag == "head" %}
14024
- {{ use_head(ctx) }}
14025
- {% elif ctx.tag == "text" %}
14026
- {{ use_text(ctx) }}
14027
- {% elif ctx.tag == "title" %}
14028
- {{ use_title(ctx) }}
14029
- {% elif ctx.tag == "table" %}
14030
- {{ use_table(ctx) }}
14031
- {% elif ctx.tag == "toc" %}
14032
- {{ use_toc(ctx) }}
14033
- {% elif ctx.tag == "notice" %}
14034
- {{ use_notice(ctx) }}
14035
- {% elif ctx.tag == "block" %}
14036
- {{ use_block(ctx) }}
14037
- {% elif ctx.tag == "date" %}
14038
- {{ use_date(ctx) }}
14039
- {% elif ctx.tag == "checker" %}
14040
- {{ use_checker(ctx) }}
14041
- {% elif ctx.tag == "divider" %}
14042
- {{ use_divider(ctx) }}
14043
- {% elif ctx.tag == "tag" %}
14044
- {{ use_tag(ctx) }}
14045
- {% elif ctx.tag == "title_content" %}
14046
- {{ use_content_title(ctx) }}
14047
- {% else %}
14048
- {{ title_default(ctx) }}
14049
- {% endif %}
14050
- {% endmacro %}
14051
- {% macro use_component(ctx) %}
14052
- {% if ctx.tag %}
14053
- {{ use_comp_start() }}
14054
- {{ pick_component(ctx) }}
14055
- {{ use_comp_end() }}
14056
- {% else %}
14057
- {% for i in ctx %}
14058
- {% if i.tag != 'table' %}
14059
- {{ use_comp_start() }}
14060
- {{ pick_component(i) }}
14061
- {{ use_comp_end() }}
14062
- {% else %}
14063
- {{ pick_component(i) }}
14064
- {% endif %}
14065
- {% endfor %}
14066
- {% endif %}
14067
- {% endmacro %}
14068
- {{ use_component(ctx) }}</tr>
14069
- <!-- /Component.njk -->
14070
- <!-- Text.njk -->
14071
- {% macro text_default(ctx) %}
14072
- {{ ctx.text | replace("false", "❌") | replace("true", "✔️") }}
14073
- {% endmacro %}
14074
- {% macro bool_text(ctx) %}
14075
- {{ ctx.text | replace("false", "❌") | replace("true", "✔️") }}
14076
- {% endmacro %}
14077
- {% macro use_text(ctx) %}
14078
- {% if ctx.type == "h1" %}
14079
- {{ title_h1(ctx) }}
14080
- {% else %}
14081
- {{ text_default(ctx) }}
14082
- {% endif %}
14083
- {% endmacro %}
14084
- <!-- /Text.njk -->
13684
+ const templateText = `<!-- Head.njk -->
13685
+ {% macro use_head(ctx) %}
13686
+ <head>
13687
+ <meta charset="UTF-8" />
13688
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
13689
+ <title>{{ ctx.title }}</title>
13690
+ {% if ctx.jsFiles%}
13691
+ {% for css in ctx.cssFiles %}
13692
+ <link rel="stylesheet" href="{{ css }}" />
13693
+ {% endfor %}
13694
+ {% endif %}
13695
+ </head>
13696
+ {% if ctx.jsFiles%}
13697
+ {% for js in ctx.jsFiles %}
13698
+ <script src="{{ js }}"></script>
13699
+ {% endfor %}
13700
+ {% endif %}
13701
+ {% endmacro %}
13702
+ {% macro use_comp_start(ctx) %}
13703
+ <table style="width: 100%;table-layout: auto">
13704
+ <tr>
13705
+ <td>
13706
+ {% endmacro %}
13707
+ {% macro use_comp_end(ctx) %}
13708
+ </td>
13709
+ </tr>
13710
+ </table>
13711
+ {% endmacro %}
13712
+ <!-- /Head.njk -->
13713
+ <!-- TOC.njk -->
13714
+ {% macro use_toc(ctx) %}
13715
+ <div class="article-toc">
13716
+ <input type="checkbox" id="toc-toggle" class="toc-toggle-checkbox">
13717
+ <label for="toc-toggle" class="toc-toggle-label">
13718
+ <span class="toc-icon">≡</span>
13719
+ <span class="toc-text">目录</span>
13720
+ </label>
13721
+ <nav class="toc-nav">
13722
+ {% for section in ctx.data %}
13723
+ <section class="toc-section">
13724
+ {% if section.link %}
13725
+ <h3 class="toc-heading">
13726
+ <a href="{{ section.link }}" class="toc-link">{{ section.text }}</a>
13727
+ </h3>
13728
+ {% else%}
13729
+ <h3 class="toc-heading">{{ section.text }}</h3>
13730
+ {% endif %}
13731
+ <ul class="toc-list">
13732
+ {% for item in section.items %}
13733
+ <li class="toc-item">
13734
+ <a href="{{ item.link }}" class="toc-link" data-level="{{ loop.depth }}">
13735
+ {% if loop.depth > 1 %}•{% endif %}
13736
+ {{ item.text }}
13737
+ </a>
13738
+ </li>
13739
+ {% endfor %}
13740
+ </ul>
13741
+ </section>
13742
+ {% endfor %}
13743
+ </nav>
13744
+ </div>
13745
+ {% endmacro %}
13746
+ <!-- /TOC.njk -->
13747
+ <!-- Divider.njk -->
13748
+ {% macro use_divider(ctx) %}
13749
+ <hr class="divider-base">
13750
+ {% endmacro %}
13751
+ <!-- /Divider.njk -->
13752
+ <!-- Tag.njk -->
13753
+ {% macro use_tag(ctx) %}
13754
+ {% set tagClass = "smart-tag" %}
13755
+ {% set defaultColor = "#4CAF50" %}
13756
+ {% set defaultSize = "medium" %}
13757
+ {% set finalColor = defaultColor %}
13758
+ {% set finalSize = defaultSize %}
13759
+ <span class="{{ tagClass }} {{ finalSize }}" style="background-color: {{ finalColor }};">
13760
+ {{ ctx.text }}
13761
+ </span>
13762
+ <style>
13763
+ .smart-tag {
13764
+ display: inline-flex;
13765
+ align-items: center;
13766
+ padding: 4px 12px;
13767
+ border-radius: 4px;
13768
+ font-family: Arial, sans-serif;
13769
+ color: white;
13770
+ white-space: nowrap;
13771
+ transition: all 0.3s ease;
13772
+ }
13773
+ /* 尺寸控制 */
13774
+ .smart-tag.small {
13775
+ font-size: 12px;
13776
+ padding: 2px 8px;
13777
+ }
13778
+ .smart-tag.medium {
13779
+ font-size: 14px;
13780
+ padding: 4px 12px;
13781
+ }
13782
+ .smart-tag.large {
13783
+ font-size: 16px;
13784
+ padding: 6px 16px;
13785
+ }
13786
+ /* 颜色扩展支持 */
13787
+ .smart-tag.blue { background-color: #2196F3 !important; }
13788
+ .smart-tag.red { background-color: #f44336 !important; }
13789
+ .smart-tag.green { background-color: #4CAF50 !important; }
13790
+ </style>
13791
+ {% endmacro %}
13792
+ <!-- /Tag.njk -->
13793
+ <!-- Title.njk -->
13794
+ {% macro use_table_wrapper(macro) %}
13795
+ <table style="width: 100%;table-layout: auto">
13796
+ <th>
13797
+ <td>{{ macro }}</td>
13798
+ </th>
13799
+ </table>
13800
+ {% endmacro %}
13801
+ {% macro title_default(ctx) %}
13802
+ <h1 class="title-base">{{ ctx.text }}</h1>
13803
+ {% endmacro %}
13804
+ {% macro title_h1(ctx) %}
13805
+ <h1 class="title-base njk-title-h1" id="{{ ctx.text }}" style="{{ ctx.style }}">
13806
+ {{ ctx.text }}
13807
+ </h1>
13808
+ {% endmacro %}
13809
+ {% macro title_h2(ctx) %}
13810
+ <h2 class="title-base njk-title-h2" id="{{ ctx.text }}" class="" style="{{ ctx.style }}">
13811
+ {{ ctx.text }}
13812
+ </h2>
13813
+ {% endmacro %}
13814
+ {% macro title_h3(ctx) %}
13815
+ <h3 class="title-base njk-title-h3" id="{{ ctx.text }}" class="" style="{{ ctx.style }}">
13816
+ {{ ctx.text }}
13817
+ </h3>
13818
+ {% endmacro %}
13819
+ {% macro title_table_default(ctx) %}
13820
+ {{ use_comp_start() }}
13821
+ <h3 class="title-base njk-title-h3" id="{{ ctx.text }}">
13822
+ {{ ctx.text }}
13823
+ </h3>
13824
+ {{ use_comp_end() }}
13825
+ {% endmacro %}
13826
+ {% macro use_title(ctx) %}
13827
+ {% if ctx.type == "h1" %}
13828
+ {{ title_h1(ctx) }}
13829
+ {% elif ctx.type == "h2" %}
13830
+ {{ title_h2(ctx) }}
13831
+ {% elif ctx.type == "h3" %}
13832
+ {{ title_h3(ctx) }}
13833
+ {% else %}
13834
+ {{ title_default(ctx) }}
13835
+ {% endif %}
13836
+ {% endmacro %}
13837
+ <!-- /Title.njk -->
13838
+ <!-- Notice.njk -->
13839
+ {% macro use_notice(ctx) %}
13840
+ {% if ctx.type %}
13841
+ {% set type = ctx.type %}
13842
+ {% else %}
13843
+ {% set type = "info" %}
13844
+ {% endif %}
13845
+ <div class="notice notice-{{ type }}">
13846
+ <div class="notice-title">{{ type|capitalize }}:</div>
13847
+ <pre class="notice-content">{{ ctx.text }}</pre>
13848
+ </div>
13849
+ {% endmacro %}
13850
+ <!-- /Notice.njk -->
13851
+ <!-- Block.njk -->
13852
+ {% macro use_block(ctx) %}
13853
+ <div class="code-block">
13854
+ <pre><code>{{ ctx.text }}</code></pre>
13855
+ </div>
13856
+ {% endmacro %}
13857
+ <!-- /Block.njk -->
13858
+ <!-- Date.njk -->
13859
+ {% macro use_date(ctx) %}
13860
+ <div class="center-info-box" style="text-align: center;"><span style="font-weight:bolder;">Date:</span>{{ ctx.text}}</div>
13861
+ {% endmacro %}
13862
+ {% macro use_checker(ctx) %}
13863
+ <div class="center-info-box" style="text-align: center;"><span style="font-weight:bolder;">Checker:</span>{{ ctx.text}}</div>
13864
+ {% endmacro %}
13865
+ <!-- /Date.njk -->
13866
+ <!-- Table.njk -->
13867
+ {% macro td_default(ctx) %}
13868
+ {% if ctx.text %}
13869
+ {% set text = ctx.text %}
13870
+ {% else %}
13871
+ {% set text = ctx %}
13872
+ {% endif %}
13873
+ <td class="default-cell">{{ text | replace("false", "❌")| replace("False", "❌")| replace("True", "✔️") | replace("true", "✔️") | replace("Pass", "✔️") | replace("pass", "✔️") }}</td>
13874
+ {% endmacro %}
13875
+ {% macro table_default(ctx) %}
13876
+ {% if ctx.columns %}
13877
+ {% set columns = ctx.columns %}
13878
+ {% elif ctx.th %}
13879
+ {% set columns = ctx.th %}
13880
+ {% else %}
13881
+ {% set columns = [] %}
13882
+ {% endif %}
13883
+ {% if ctx.data %}
13884
+ {% set data = ctx.data %}
13885
+ {% elif ctx.tbody %}
13886
+ {% set data = ctx.tbody %}
13887
+ {% endif %}
13888
+ {% if ctx.title %}
13889
+ {% set title = {text:ctx.title} %}
13890
+ {{ use_comp_start() }}
13891
+ {{ title_h2(title) }}
13892
+ {{ use_comp_end() }}
13893
+ {% endif %}
13894
+ <table class="my-daframe-default">
13895
+ <thead class="thead-light">
13896
+ <tr>
13897
+ {% for column in columns %}
13898
+ <th>{{ column }}</th>
13899
+ {% endfor %}
13900
+ </tr>
13901
+ </thead>
13902
+ <tbody>
13903
+ {% for row in data %}
13904
+ <tr class="default-row">
13905
+ {% if ctx.data %}
13906
+ {% for column in columns %}
13907
+ {{ td_default(row[column]) }}
13908
+ {% endfor %}
13909
+ {% else %}
13910
+ {% for value in row %}
13911
+ {{ td_default(value) }}
13912
+ {% endfor %}
13913
+ {% endif %}
13914
+ </tr>
13915
+ {% endfor %}
13916
+ </tbody>
13917
+ </table>
13918
+ {% endmacro %}
13919
+ {% macro use_table(ctx) %}
13920
+ {% if ctx.title %}
13921
+ {{ table_default(ctx) }}
13922
+ {% else %}
13923
+ {{ table_default(ctx) }}
13924
+ {% endif %}
13925
+ {% endmacro %}
13926
+ <!-- /Table.njk -->
13927
+ <!-- Tab.njk -->
13928
+ {% macro useTab(tabs) %}
13929
+ <style>
13930
+ /* 显示选中的 Tab 内容 */
13931
+ {% for tab in tabs %}
13932
+ #{{tab.id}}:checked~#{{tab.content_id}} {
13933
+ display: block;
13934
+ }
13935
+ {% endfor %}
13936
+ </style>
13937
+ <div class="tab-container">
13938
+ {% for tab in tabs %}
13939
+ <!-- Radio 按钮(隐藏) -->
13940
+ <input {% if loop.first %} checked {% endif %} type="radio" name="tabs" id="{{ tab.id }}" class="tab-radio">
13941
+ {% endfor %}
13942
+ <!-- Tab 按钮(用 label 包裹) -->
13943
+ <div class="tab-labels">
13944
+ {% for tab in tabs %}
13945
+ <label for="{{ tab.id }}" class="tab-label">{{ tab.title }}
13946
+ </label>
13947
+ {% endfor %}
13948
+ </div>
13949
+ <!-- Tab 内容 -->
13950
+ {% for tab in tabs %}
13951
+ <div id="{{ tab.content_id }}" class="tab-content">
13952
+ {{ tab.content }}
13953
+ </div>
13954
+ {% endfor %}
13955
+ </div>
13956
+ {% endmacro %}
13957
+ <!-- /Tab.njk -->
13958
+ <!-- ContentTitle.njk -->
13959
+ {% macro h3_handler(ctx) %}
13960
+ <div class="title-tag-titile-container">
13961
+ {% if ctx.h3 %}
13962
+ <h3 style="margin: 0;" class="content-title">{{ ctx.title }}</h3>
13963
+ {% else %}
13964
+ <h2 style="margin: 0;" class="content-title">{{ ctx.title }}</h3>
13965
+ {% endif %}
13966
+ <span class="title-tag-small">注释</span>
13967
+ </div>
13968
+ {% endmacro %}
13969
+ {% macro content_title_click(ctx) %}
13970
+ <div class="collapsible-container">
13971
+ <input type="checkbox" id="{{ ctx.title }}" class="collapsible-input" hidden>
13972
+ <label for="{{ ctx.title }}" class="collapsible-label">
13973
+ {{ h3_handler(ctx) }}
13974
+ </label>
13975
+ <div class="collapsible-content">
13976
+ {{ use_block(ctx) }}
13977
+ </div>
13978
+ </div>
13979
+ {% endmacro %}
13980
+ {% macro content_title_hover(ctx) %}
13981
+ <div class="collapsible-container">
13982
+ <div class="collapsible-label">
13983
+ {{ h3_handler(ctx) }}
13984
+ </div>
13985
+ <div class="collapsible-hover-content">
13986
+ {{ use_block(ctx) }}
13987
+ </div>
13988
+ </div>
13989
+ {% endmacro %}
13990
+ {% macro content_title_remain(ctx) %}
13991
+ <div class="collapsible-container">
13992
+ {{ h3_handler(ctx) }}
13993
+ <div>
13994
+ {{ use_block(ctx) }}
13995
+ </div>
13996
+ </div>
13997
+ {% endmacro %}
13998
+ {% macro pick_content_title(ctx) %}
13999
+ {% if ctx.hover %}
14000
+ {{ content_title_hover(ctx) }}
14001
+ {% elif ctx.remain %}
14002
+ {{ content_title_remain(ctx) }}
14003
+ {% else %}
14004
+ {{ content_title_click(ctx) }}
14005
+ {% endif %}
14006
+ {% endmacro %}
14007
+ {% macro use_content_title(ctx) %}
14008
+ {% if ctx.type == "h3" or ctx.type == "hover_h3" or ctx.type == "remain_h3" %}
14009
+ {% set h3 = true %}
14010
+ {% endif %}
14011
+ {% if ctx.type == "hover_h3" or ctx.type == "hover" %}
14012
+ {% set hover = true %}
14013
+ {% endif %}
14014
+ {% if ctx.type == "remain_h3" or ctx.type == "remain" %}
14015
+ {% set remain = true %}
14016
+ {% endif %}
14017
+ {% set param = {title:ctx.title, text:ctx.text, h3:h3, hover:hover, remain:remain} %}
14018
+ {{ pick_content_title(param) }}
14019
+ {% endmacro %}
14020
+ <!-- /ContentTitle.njk -->
14021
+ <!-- Component.njk -->
14022
+ {% macro pick_component(ctx) %}
14023
+ {% if ctx.tag == "head" %}
14024
+ {{ use_head(ctx) }}
14025
+ {% elif ctx.tag == "text" %}
14026
+ {{ use_text(ctx) }}
14027
+ {% elif ctx.tag == "title" %}
14028
+ {{ use_title(ctx) }}
14029
+ {% elif ctx.tag == "table" %}
14030
+ {{ use_table(ctx) }}
14031
+ {% elif ctx.tag == "toc" %}
14032
+ {{ use_toc(ctx) }}
14033
+ {% elif ctx.tag == "notice" %}
14034
+ {{ use_notice(ctx) }}
14035
+ {% elif ctx.tag == "block" %}
14036
+ {{ use_block(ctx) }}
14037
+ {% elif ctx.tag == "date" %}
14038
+ {{ use_date(ctx) }}
14039
+ {% elif ctx.tag == "checker" %}
14040
+ {{ use_checker(ctx) }}
14041
+ {% elif ctx.tag == "divider" %}
14042
+ {{ use_divider(ctx) }}
14043
+ {% elif ctx.tag == "tag" %}
14044
+ {{ use_tag(ctx) }}
14045
+ {% elif ctx.tag == "title_content" %}
14046
+ {{ use_content_title(ctx) }}
14047
+ {% else %}
14048
+ {{ title_default(ctx) }}
14049
+ {% endif %}
14050
+ {% endmacro %}
14051
+ {% macro use_component(ctx) %}
14052
+ {% if ctx.tag %}
14053
+ {{ use_comp_start() }}
14054
+ {{ pick_component(ctx) }}
14055
+ {{ use_comp_end() }}
14056
+ {% else %}
14057
+ {% for i in ctx %}
14058
+ {% if i.tag != 'table' %}
14059
+ {{ use_comp_start() }}
14060
+ {{ pick_component(i) }}
14061
+ {{ use_comp_end() }}
14062
+ {% else %}
14063
+ {{ pick_component(i) }}
14064
+ {% endif %}
14065
+ {% endfor %}
14066
+ {% endif %}
14067
+ {% endmacro %}
14068
+ {{ use_component(ctx) }}</tr>
14069
+ <!-- /Component.njk -->
14070
+ <!-- Text.njk -->
14071
+ {% macro text_default(ctx) %}
14072
+ {{ ctx.text | replace("false", "❌") | replace("true", "✔️") }}
14073
+ {% endmacro %}
14074
+ {% macro bool_text(ctx) %}
14075
+ {{ ctx.text | replace("false", "❌") | replace("true", "✔️") }}
14076
+ {% endmacro %}
14077
+ {% macro use_text(ctx) %}
14078
+ {% if ctx.type == "h1" %}
14079
+ {{ title_h1(ctx) }}
14080
+ {% else %}
14081
+ {{ text_default(ctx) }}
14082
+ {% endif %}
14083
+ {% endmacro %}
14084
+ <!-- /Text.njk -->
14085
14085
  `;
14086
14086
 
14087
14087
  const externalTemplatesDir = fileURLToPath(new URL("../bundle/src", `${import.meta.url}`));