commonmarker 1.0.0.pre7 → 1.0.0.pre8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c87ce202760202992aca40370ad30e42e650951943541d6ad7fb5450083f832
4
- data.tar.gz: fea4811ffd8f8cf1d4fdd59597f054268ab83509692edb384f868c675d874209
3
+ metadata.gz: bfc92817cc50034a3ab9ea9f39e596b6db5fa9493788738674bf3d404b847a37
4
+ data.tar.gz: c902aaab95e381532d1f7b94c760f5e7b5c5bd60036b4c13c56d916f0e8414b4
5
5
  SHA512:
6
- metadata.gz: 187e7b0c3470ca3576c3e9d7a055204802e2e615cbb54673ca7403b120333829c5f7c7f64d73789e2c17345fd74c85563bae351fa43b9c40f97577ae2dd0a421
7
- data.tar.gz: 85bb7242753afc47dd27a00ac54aa4d6cecddec36767bcc66b566ed2baa34a1d5e0669f5039b7f39b6dee3661fa696417e978cb77c7e7125e1a8fe99efc68751
6
+ metadata.gz: bfa5d99febcbe7dcebdefa7de45df78efabbd51c47cc7fd066779bb0ac9e33615da18e000e39d65f4f45e4bb61135a3f991f1f102f8cc4640c017432baddbd37
7
+ data.tar.gz: b47323650e5e4b979cb224aa8dd5298cfc09f3b8547777a65131b0b2f4aad91d41ce140cb0235e9226ebde09c7e5e68de757a9237f8e8ba094aebb183e30b553
data/Cargo.lock CHANGED
@@ -25,9 +25,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
25
25
 
26
26
  [[package]]
27
27
  name = "base64"
28
- version = "0.13.1"
28
+ version = "0.21.0"
29
29
  source = "registry+https://github.com/rust-lang/crates.io-index"
30
- checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
30
+ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
31
31
 
32
32
  [[package]]
33
33
  name = "bincode"
@@ -89,9 +89,9 @@ dependencies = [
89
89
 
90
90
  [[package]]
91
91
  name = "cc"
92
- version = "1.0.78"
92
+ version = "1.0.79"
93
93
  source = "registry+https://github.com/rust-lang/crates.io-index"
94
- checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
94
+ checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
95
95
 
96
96
  [[package]]
97
97
  name = "cexpr"
@@ -110,9 +110,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
110
110
 
111
111
  [[package]]
112
112
  name = "clang-sys"
113
- version = "1.4.0"
113
+ version = "1.6.0"
114
114
  source = "registry+https://github.com/rust-lang/crates.io-index"
115
- checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3"
115
+ checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a"
116
116
  dependencies = [
117
117
  "glob",
118
118
  "libc",
@@ -121,9 +121,9 @@ dependencies = [
121
121
 
122
122
  [[package]]
123
123
  name = "clap"
124
- version = "4.0.32"
124
+ version = "4.1.8"
125
125
  source = "registry+https://github.com/rust-lang/crates.io-index"
126
- checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39"
126
+ checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5"
127
127
  dependencies = [
128
128
  "bitflags",
129
129
  "clap_derive",
@@ -137,9 +137,9 @@ dependencies = [
137
137
 
138
138
  [[package]]
139
139
  name = "clap_derive"
140
- version = "4.0.21"
140
+ version = "4.1.8"
141
141
  source = "registry+https://github.com/rust-lang/crates.io-index"
142
- checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
142
+ checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0"
143
143
  dependencies = [
144
144
  "heck",
145
145
  "proc-macro-error",
@@ -150,9 +150,9 @@ dependencies = [
150
150
 
151
151
  [[package]]
152
152
  name = "clap_lex"
153
- version = "0.3.0"
153
+ version = "0.3.2"
154
154
  source = "registry+https://github.com/rust-lang/crates.io-index"
155
- checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
155
+ checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09"
156
156
  dependencies = [
157
157
  "os_str_bytes",
158
158
  ]
@@ -163,6 +163,7 @@ version = "1.0.0"
163
163
  dependencies = [
164
164
  "comrak",
165
165
  "magnus",
166
+ "syntect",
166
167
  ]
167
168
 
168
169
  [[package]]
@@ -348,18 +349,15 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
348
349
 
349
350
  [[package]]
350
351
  name = "heck"
351
- version = "0.4.0"
352
+ version = "0.4.1"
352
353
  source = "registry+https://github.com/rust-lang/crates.io-index"
353
- checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
354
+ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
354
355
 
355
356
  [[package]]
356
357
  name = "hermit-abi"
357
- version = "0.2.6"
358
+ version = "0.3.1"
358
359
  source = "registry+https://github.com/rust-lang/crates.io-index"
359
- checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
360
- dependencies = [
361
- "libc",
362
- ]
360
+ checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
363
361
 
364
362
  [[package]]
365
363
  name = "indexmap"
@@ -373,9 +371,9 @@ dependencies = [
373
371
 
374
372
  [[package]]
375
373
  name = "io-lifetimes"
376
- version = "1.0.3"
374
+ version = "1.0.5"
377
375
  source = "registry+https://github.com/rust-lang/crates.io-index"
378
- checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
376
+ checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
379
377
  dependencies = [
380
378
  "libc",
381
379
  "windows-sys",
@@ -383,9 +381,9 @@ dependencies = [
383
381
 
384
382
  [[package]]
385
383
  name = "is-terminal"
386
- version = "0.4.2"
384
+ version = "0.4.4"
387
385
  source = "registry+https://github.com/rust-lang/crates.io-index"
388
- checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
386
+ checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
389
387
  dependencies = [
390
388
  "hermit-abi",
391
389
  "io-lifetimes",
@@ -450,9 +448,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
450
448
 
451
449
  [[package]]
452
450
  name = "magnus"
453
- version = "0.4.4"
451
+ version = "0.5.1"
454
452
  source = "registry+https://github.com/rust-lang/crates.io-index"
455
- checksum = "fc87660cd7daa49fddbfd524c836de54d5c927d520cd163f43700c5087c57d6c"
453
+ checksum = "ac1f63d741de829356a1399b34cbf6e79b79fc80aa85f86c8a2e7966768d95bc"
456
454
  dependencies = [
457
455
  "magnus-macros",
458
456
  "rb-sys",
@@ -461,9 +459,9 @@ dependencies = [
461
459
 
462
460
  [[package]]
463
461
  name = "magnus-macros"
464
- version = "0.3.0"
462
+ version = "0.4.0"
465
463
  source = "registry+https://github.com/rust-lang/crates.io-index"
466
- checksum = "206cb23bfeea05180c97522ef6a3e52a4eb17b0ed2f30ee3ca9c4f994d2378ae"
464
+ checksum = "85aa71c9891b2732ff1157e1860a1ee578459fd25811fd3d72cc6e32b3fbdfea"
467
465
  dependencies = [
468
466
  "proc-macro2",
469
467
  "quote",
@@ -493,9 +491,9 @@ dependencies = [
493
491
 
494
492
  [[package]]
495
493
  name = "nom"
496
- version = "7.1.2"
494
+ version = "7.1.3"
497
495
  source = "registry+https://github.com/rust-lang/crates.io-index"
498
- checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c"
496
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
499
497
  dependencies = [
500
498
  "memchr",
501
499
  "minimal-lexical",
@@ -503,9 +501,9 @@ dependencies = [
503
501
 
504
502
  [[package]]
505
503
  name = "once_cell"
506
- version = "1.17.0"
504
+ version = "1.17.1"
507
505
  source = "registry+https://github.com/rust-lang/crates.io-index"
508
- checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
506
+ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
509
507
 
510
508
  [[package]]
511
509
  name = "onig"
@@ -543,9 +541,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
543
541
 
544
542
  [[package]]
545
543
  name = "pest"
546
- version = "2.5.2"
544
+ version = "2.5.5"
547
545
  source = "registry+https://github.com/rust-lang/crates.io-index"
548
- checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4"
546
+ checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660"
549
547
  dependencies = [
550
548
  "thiserror",
551
549
  "ucd-trie",
@@ -553,9 +551,9 @@ dependencies = [
553
551
 
554
552
  [[package]]
555
553
  name = "pest_derive"
556
- version = "2.5.2"
554
+ version = "2.5.5"
557
555
  source = "registry+https://github.com/rust-lang/crates.io-index"
558
- checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603"
556
+ checksum = "2ac3922aac69a40733080f53c1ce7f91dcf57e1a5f6c52f421fadec7fbdc4b69"
559
557
  dependencies = [
560
558
  "pest",
561
559
  "pest_generator",
@@ -563,9 +561,9 @@ dependencies = [
563
561
 
564
562
  [[package]]
565
563
  name = "pest_generator"
566
- version = "2.5.2"
564
+ version = "2.5.5"
567
565
  source = "registry+https://github.com/rust-lang/crates.io-index"
568
- checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7"
566
+ checksum = "d06646e185566b5961b4058dd107e0a7f56e77c3f484549fb119867773c0f202"
569
567
  dependencies = [
570
568
  "pest",
571
569
  "pest_meta",
@@ -576,13 +574,13 @@ dependencies = [
576
574
 
577
575
  [[package]]
578
576
  name = "pest_meta"
579
- version = "2.5.2"
577
+ version = "2.5.5"
580
578
  source = "registry+https://github.com/rust-lang/crates.io-index"
581
- checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065"
579
+ checksum = "e6f60b2ba541577e2a0c307c8f39d1439108120eb7903adeb6497fa880c59616"
582
580
  dependencies = [
583
581
  "once_cell",
584
582
  "pest",
585
- "sha1",
583
+ "sha2",
586
584
  ]
587
585
 
588
586
  [[package]]
@@ -611,16 +609,16 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
611
609
 
612
610
  [[package]]
613
611
  name = "plist"
614
- version = "1.3.1"
612
+ version = "1.4.1"
615
613
  source = "registry+https://github.com/rust-lang/crates.io-index"
616
- checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225"
614
+ checksum = "9469799ca90293a376f68f6fcb8f11990d9cff55602cfba0ba83893c973a7f46"
617
615
  dependencies = [
618
616
  "base64",
619
617
  "indexmap",
620
618
  "line-wrap",
619
+ "quick-xml",
621
620
  "serde",
622
621
  "time",
623
- "xml-rs",
624
622
  ]
625
623
 
626
624
  [[package]]
@@ -649,13 +647,22 @@ dependencies = [
649
647
 
650
648
  [[package]]
651
649
  name = "proc-macro2"
652
- version = "1.0.49"
650
+ version = "1.0.51"
653
651
  source = "registry+https://github.com/rust-lang/crates.io-index"
654
- checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
652
+ checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
655
653
  dependencies = [
656
654
  "unicode-ident",
657
655
  ]
658
656
 
657
+ [[package]]
658
+ name = "quick-xml"
659
+ version = "0.26.0"
660
+ source = "registry+https://github.com/rust-lang/crates.io-index"
661
+ checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd"
662
+ dependencies = [
663
+ "memchr",
664
+ ]
665
+
659
666
  [[package]]
660
667
  name = "quote"
661
668
  version = "1.0.23"
@@ -667,29 +674,32 @@ dependencies = [
667
674
 
668
675
  [[package]]
669
676
  name = "rb-sys"
670
- version = "0.9.53"
677
+ version = "0.9.65"
671
678
  source = "registry+https://github.com/rust-lang/crates.io-index"
672
- checksum = "aa291f69bcc44f8e96597a3f39e9933fde6977b825415cfaa670ac49b8ab7c99"
679
+ checksum = "e8fe617bad8e88fd7e5d6f432e35f09e5f94144dfb8e8ee4adde82fb920dc59b"
673
680
  dependencies = [
674
681
  "rb-sys-build",
675
682
  ]
676
683
 
677
684
  [[package]]
678
685
  name = "rb-sys-build"
679
- version = "0.9.53"
686
+ version = "0.9.65"
680
687
  source = "registry+https://github.com/rust-lang/crates.io-index"
681
- checksum = "d998fd6ef588471d6d7cca24c4da88eda5e6757b6885c55760e856ecdb254c3d"
688
+ checksum = "007e63597f91c711cbb299e60fecbdb6f5ad4a066d6a20c81943893f1584c895"
682
689
  dependencies = [
683
690
  "bindgen",
691
+ "lazy_static",
692
+ "quote",
684
693
  "regex",
685
694
  "shell-words",
695
+ "syn",
686
696
  ]
687
697
 
688
698
  [[package]]
689
699
  name = "rb-sys-env"
690
- version = "0.1.1"
700
+ version = "0.1.2"
691
701
  source = "registry+https://github.com/rust-lang/crates.io-index"
692
- checksum = "74c38752410925faeb82c400c06ba2fd9ee6aa8f719dd33994c9e53f5242d25f"
702
+ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
693
703
 
694
704
  [[package]]
695
705
  name = "redox_syscall"
@@ -713,9 +723,9 @@ dependencies = [
713
723
 
714
724
  [[package]]
715
725
  name = "regex"
716
- version = "1.7.0"
726
+ version = "1.7.1"
717
727
  source = "registry+https://github.com/rust-lang/crates.io-index"
718
- checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
728
+ checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
719
729
  dependencies = [
720
730
  "aho-corasick",
721
731
  "memchr",
@@ -736,9 +746,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
736
746
 
737
747
  [[package]]
738
748
  name = "rustix"
739
- version = "0.36.6"
749
+ version = "0.36.8"
740
750
  source = "registry+https://github.com/rust-lang/crates.io-index"
741
- checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
751
+ checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
742
752
  dependencies = [
743
753
  "bitflags",
744
754
  "errno",
@@ -788,9 +798,9 @@ dependencies = [
788
798
 
789
799
  [[package]]
790
800
  name = "serde_json"
791
- version = "1.0.91"
801
+ version = "1.0.93"
792
802
  source = "registry+https://github.com/rust-lang/crates.io-index"
793
- checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
803
+ checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
794
804
  dependencies = [
795
805
  "itoa",
796
806
  "ryu",
@@ -798,10 +808,10 @@ dependencies = [
798
808
  ]
799
809
 
800
810
  [[package]]
801
- name = "sha1"
802
- version = "0.10.5"
811
+ name = "sha2"
812
+ version = "0.10.6"
803
813
  source = "registry+https://github.com/rust-lang/crates.io-index"
804
- checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
814
+ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
805
815
  dependencies = [
806
816
  "cfg-if",
807
817
  "cpufeatures",
@@ -843,9 +853,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
843
853
 
844
854
  [[package]]
845
855
  name = "syn"
846
- version = "1.0.107"
856
+ version = "1.0.109"
847
857
  source = "registry+https://github.com/rust-lang/crates.io-index"
848
- checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
858
+ checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
849
859
  dependencies = [
850
860
  "proc-macro2",
851
861
  "quote",
@@ -878,18 +888,18 @@ dependencies = [
878
888
 
879
889
  [[package]]
880
890
  name = "termcolor"
881
- version = "1.1.3"
891
+ version = "1.2.0"
882
892
  source = "registry+https://github.com/rust-lang/crates.io-index"
883
- checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
893
+ checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
884
894
  dependencies = [
885
895
  "winapi-util",
886
896
  ]
887
897
 
888
898
  [[package]]
889
899
  name = "terminal_size"
890
- version = "0.2.3"
900
+ version = "0.2.5"
891
901
  source = "registry+https://github.com/rust-lang/crates.io-index"
892
- checksum = "cb20089a8ba2b69debd491f8d2d023761cbf196e999218c591fa1e7e15a21907"
902
+ checksum = "4c9afddd2cec1c0909f06b00ef33f94ab2cc0578c4a610aa208ddfec8aa2b43a"
893
903
  dependencies = [
894
904
  "rustix",
895
905
  "windows-sys",
@@ -917,9 +927,9 @@ dependencies = [
917
927
 
918
928
  [[package]]
919
929
  name = "time"
920
- version = "0.3.17"
930
+ version = "0.3.20"
921
931
  source = "registry+https://github.com/rust-lang/crates.io-index"
922
- checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376"
932
+ checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890"
923
933
  dependencies = [
924
934
  "itoa",
925
935
  "serde",
@@ -935,18 +945,18 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
935
945
 
936
946
  [[package]]
937
947
  name = "time-macros"
938
- version = "0.2.6"
948
+ version = "0.2.8"
939
949
  source = "registry+https://github.com/rust-lang/crates.io-index"
940
- checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2"
950
+ checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36"
941
951
  dependencies = [
942
952
  "time-core",
943
953
  ]
944
954
 
945
955
  [[package]]
946
956
  name = "typed-arena"
947
- version = "2.0.1"
957
+ version = "2.0.2"
948
958
  source = "registry+https://github.com/rust-lang/crates.io-index"
949
- checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae"
959
+ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
950
960
 
951
961
  [[package]]
952
962
  name = "typenum"
@@ -1028,9 +1038,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1028
1038
 
1029
1039
  [[package]]
1030
1040
  name = "windows-sys"
1031
- version = "0.42.0"
1041
+ version = "0.45.0"
1032
1042
  source = "registry+https://github.com/rust-lang/crates.io-index"
1033
- checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
1043
+ checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
1044
+ dependencies = [
1045
+ "windows-targets",
1046
+ ]
1047
+
1048
+ [[package]]
1049
+ name = "windows-targets"
1050
+ version = "0.42.1"
1051
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1052
+ checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
1034
1053
  dependencies = [
1035
1054
  "windows_aarch64_gnullvm",
1036
1055
  "windows_aarch64_msvc",
@@ -1043,45 +1062,45 @@ dependencies = [
1043
1062
 
1044
1063
  [[package]]
1045
1064
  name = "windows_aarch64_gnullvm"
1046
- version = "0.42.0"
1065
+ version = "0.42.1"
1047
1066
  source = "registry+https://github.com/rust-lang/crates.io-index"
1048
- checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
1067
+ checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
1049
1068
 
1050
1069
  [[package]]
1051
1070
  name = "windows_aarch64_msvc"
1052
- version = "0.42.0"
1071
+ version = "0.42.1"
1053
1072
  source = "registry+https://github.com/rust-lang/crates.io-index"
1054
- checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
1073
+ checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
1055
1074
 
1056
1075
  [[package]]
1057
1076
  name = "windows_i686_gnu"
1058
- version = "0.42.0"
1077
+ version = "0.42.1"
1059
1078
  source = "registry+https://github.com/rust-lang/crates.io-index"
1060
- checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
1079
+ checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
1061
1080
 
1062
1081
  [[package]]
1063
1082
  name = "windows_i686_msvc"
1064
- version = "0.42.0"
1083
+ version = "0.42.1"
1065
1084
  source = "registry+https://github.com/rust-lang/crates.io-index"
1066
- checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
1085
+ checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
1067
1086
 
1068
1087
  [[package]]
1069
1088
  name = "windows_x86_64_gnu"
1070
- version = "0.42.0"
1089
+ version = "0.42.1"
1071
1090
  source = "registry+https://github.com/rust-lang/crates.io-index"
1072
- checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
1091
+ checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
1073
1092
 
1074
1093
  [[package]]
1075
1094
  name = "windows_x86_64_gnullvm"
1076
- version = "0.42.0"
1095
+ version = "0.42.1"
1077
1096
  source = "registry+https://github.com/rust-lang/crates.io-index"
1078
- checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
1097
+ checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
1079
1098
 
1080
1099
  [[package]]
1081
1100
  name = "windows_x86_64_msvc"
1082
- version = "0.42.0"
1101
+ version = "0.42.1"
1083
1102
  source = "registry+https://github.com/rust-lang/crates.io-index"
1084
- checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
1103
+ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
1085
1104
 
1086
1105
  [[package]]
1087
1106
  name = "xdg"
@@ -1092,12 +1111,6 @@ dependencies = [
1092
1111
  "dirs",
1093
1112
  ]
1094
1113
 
1095
- [[package]]
1096
- name = "xml-rs"
1097
- version = "0.8.4"
1098
- source = "registry+https://github.com/rust-lang/crates.io-index"
1099
- checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
1100
-
1101
1114
  [[package]]
1102
1115
  name = "yaml-rust"
1103
1116
  version = "0.4.5"
data/README.md CHANGED
@@ -131,9 +131,16 @@ Commonmarker.to_html(code, plugins: { syntax_highlighter: nil })
131
131
  Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: nil } })
132
132
  ```
133
133
 
134
+ You can also provide a `path` to a directory containing `.tmtheme` files to load:
135
+
136
+ ```ruby
137
+
138
+ Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Monokai", path: "./themes" } })
139
+ ```
140
+
134
141
  ##### Available themes
135
142
 
136
- Here's [a list of available themes](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations):
143
+ Here's [a list of themes available by default](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations):
137
144
 
138
145
  - `"base16-ocean.dark"`
139
146
  - `"base16-eighties.dark"`
@@ -4,8 +4,9 @@ version = "1.0.0"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
7
- magnus = "0.4"
7
+ magnus = "0.5"
8
8
  comrak = { version = "0.16", features = ["shortcodes"] }
9
+ syntect = { version = "5.0", features = ["plist-load"] }
9
10
 
10
11
  [lib]
11
12
  name = "commonmarker"
@@ -1,10 +1,17 @@
1
1
  extern crate core;
2
2
 
3
+ use std::path::PathBuf;
4
+
5
+ use ::syntect::highlighting::ThemeSet;
3
6
  use comrak::{
4
- adapters::SyntaxHighlighterAdapter, markdown_to_html, markdown_to_html_with_plugins,
5
- plugins::syntect::SyntectAdapter, ComrakOptions, ComrakPlugins,
7
+ adapters::SyntaxHighlighterAdapter,
8
+ markdown_to_html, markdown_to_html_with_plugins,
9
+ plugins::syntect::{SyntectAdapter, SyntectAdapterBuilder},
10
+ ComrakOptions, ComrakPlugins,
11
+ };
12
+ use magnus::{
13
+ define_module, exception, function, r_hash::ForEach, scan_args, Error, RHash, Symbol, Value,
6
14
  };
7
- use magnus::{define_module, function, r_hash::ForEach, scan_args, Error, RHash, Symbol, Value};
8
15
 
9
16
  mod options;
10
17
  use options::iterate_options_hash;
@@ -12,7 +19,8 @@ use options::iterate_options_hash;
12
19
  mod plugins;
13
20
  use plugins::{
14
21
  syntax_highlighting::{
15
- fetch_syntax_highlighter_theme, SYNTAX_HIGHLIGHTER_PLUGIN_DEFAULT_THEME,
22
+ fetch_syntax_highlighter_path, fetch_syntax_highlighter_theme,
23
+ SYNTAX_HIGHLIGHTER_PLUGIN_DEFAULT_THEME,
16
24
  },
17
25
  SYNTAX_HIGHLIGHTER_PLUGIN,
18
26
  };
@@ -52,13 +60,75 @@ fn commonmark_to_html<'a>(args: &[Value]) -> Result<String, magnus::Error> {
52
60
  let adapter: SyntectAdapter;
53
61
 
54
62
  let theme = match rb_plugins.get(Symbol::new(SYNTAX_HIGHLIGHTER_PLUGIN)) {
55
- Some(theme_val) => fetch_syntax_highlighter_theme(theme_val)?,
63
+ Some(syntax_highlighter_options) => {
64
+ fetch_syntax_highlighter_theme(syntax_highlighter_options)?
65
+ }
56
66
  None => SYNTAX_HIGHLIGHTER_PLUGIN_DEFAULT_THEME.to_string(), // no `syntax_highlighter:` defined
57
67
  };
58
68
 
59
- if theme.is_empty() || theme == "none" {
69
+ let path = match rb_plugins.get(Symbol::new(SYNTAX_HIGHLIGHTER_PLUGIN)) {
70
+ Some(syntax_highlighter_options) => {
71
+ fetch_syntax_highlighter_path(syntax_highlighter_options)?
72
+ }
73
+ None => PathBuf::from("".to_string()), // no `syntax_highlighter:` defined
74
+ };
75
+
76
+ if !path.eq(&PathBuf::from("".to_string())) && !path.exists() {
77
+ return Err(Error::new(
78
+ exception::arg_error(),
79
+ format!("path does not exist"),
80
+ ));
81
+ }
82
+
83
+ if theme.is_empty() && path.exists() {
84
+ return Err(Error::new(
85
+ exception::arg_error(),
86
+ "`path` also needs `theme` passed into the `syntax_highlighter`",
87
+ ));
88
+ }
89
+ if path.exists() && !path.is_dir() {
90
+ return Err(Error::new(
91
+ exception::arg_error(),
92
+ "`path` needs to be a directory",
93
+ ));
94
+ }
95
+
96
+ if path.exists() {
97
+ let builder = SyntectAdapterBuilder::new();
98
+ let mut ts = ThemeSet::load_defaults();
99
+
100
+ match ts.add_from_folder(&path) {
101
+ Ok(_) => {}
102
+ Err(e) => {
103
+ return Err(Error::new(
104
+ exception::arg_error(),
105
+ format!("failed to load theme set from path: {e}"),
106
+ ));
107
+ }
108
+ }
109
+
110
+ ts.themes.get(&theme).ok_or_else(|| {
111
+ Error::new(
112
+ exception::arg_error(),
113
+ format!("theme `{}` does not exist", theme),
114
+ )
115
+ })?;
116
+
117
+ adapter = builder.theme_set(ts).theme(&theme).build();
118
+
119
+ syntax_highlighter = Some(&adapter);
120
+ } else if theme.is_empty() || theme == "none" {
60
121
  syntax_highlighter = None;
61
122
  } else {
123
+ ThemeSet::load_defaults()
124
+ .themes
125
+ .get(&theme)
126
+ .ok_or_else(|| {
127
+ Error::new(
128
+ exception::arg_error(),
129
+ format!("theme `{}` does not exist", theme),
130
+ )
131
+ })?;
62
132
  adapter = SyntectAdapter::new(&theme);
63
133
  syntax_highlighter = Some(&adapter);
64
134
  }
@@ -1,8 +1,11 @@
1
+ use std::path::PathBuf;
2
+
1
3
  use magnus::{RHash, Symbol, Value};
2
4
 
3
5
  use crate::EMPTY_STR;
4
6
 
5
7
  pub const SYNTAX_HIGHLIGHTER_PLUGIN_THEME_KEY: &str = "theme";
8
+ pub const SYNTAX_HIGHLIGHTER_PLUGIN_PATH_KEY: &str = "path";
6
9
  pub const SYNTAX_HIGHLIGHTER_PLUGIN_DEFAULT_THEME: &str = "base16-ocean.dark";
7
10
 
8
11
  pub fn fetch_syntax_highlighter_theme(value: Value) -> Result<String, magnus::Error> {
@@ -28,3 +31,28 @@ pub fn fetch_syntax_highlighter_theme(value: Value) -> Result<String, magnus::Er
28
31
  }
29
32
  }
30
33
  }
34
+
35
+ pub fn fetch_syntax_highlighter_path(value: Value) -> Result<PathBuf, magnus::Error> {
36
+ if value.is_nil() {
37
+ // `syntax_highlighter: nil`
38
+ return Ok(PathBuf::from(EMPTY_STR));
39
+ }
40
+
41
+ let syntax_highlighter_plugin = value.try_convert::<RHash>()?;
42
+ let path_key = Symbol::new(SYNTAX_HIGHLIGHTER_PLUGIN_PATH_KEY);
43
+
44
+ match syntax_highlighter_plugin.get(path_key) {
45
+ Some(path) => {
46
+ if path.is_nil() {
47
+ // `syntax_highlighter: { path: nil }`
48
+ return Ok(PathBuf::from(EMPTY_STR));
49
+ }
50
+
51
+ Ok(PathBuf::from(path.try_convert::<String>()?))
52
+ }
53
+ None => {
54
+ // `syntax_highlighter: { }`
55
+ Ok(PathBuf::from(EMPTY_STR))
56
+ }
57
+ }
58
+ }
@@ -35,6 +35,7 @@ module Commonmarker
35
35
  PLUGINS = {
36
36
  syntax_highlighter: {
37
37
  theme: "base16-ocean.dark",
38
+ path: "",
38
39
  },
39
40
  }
40
41
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "1.0.0.pre7"
4
+ VERSION = "1.0.0.pre8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre7
4
+ version: 1.0.0.pre8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-01-26 00:00:00.000000000 Z
12
+ date: 2023-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys