From 7ad25021e74ea26e33d705fbb402d29aabaf6314 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 1 Nov 2022 03:01:47 +0000 Subject: CTAN sync 202211010301 --- macros/generic/markdown/CHANGES.md | 41 + macros/generic/markdown/LICENSE | 415 ++ macros/generic/markdown/Makefile | 205 + macros/generic/markdown/README.md | 16 +- macros/generic/markdown/VERSION | 2 +- macros/generic/markdown/examples/README.md | 7 + macros/generic/markdown/examples/context-mkii.pdf | Bin 0 -> 213638 bytes macros/generic/markdown/examples/context-mkii.tex | 19 +- macros/generic/markdown/examples/context-mkiv.pdf | Bin 0 -> 57852 bytes macros/generic/markdown/examples/context-mkiv.tex | 19 +- macros/generic/markdown/examples/example.md | 22 +- macros/generic/markdown/examples/latex-luatex.pdf | Bin 0 -> 89912 bytes macros/generic/markdown/examples/latex-pdftex.pdf | Bin 0 -> 334207 bytes macros/generic/markdown/examples/latex-tex4ht.css | 219 + macros/generic/markdown/examples/latex-tex4ht.html | 452 ++ macros/generic/markdown/examples/latex-xetex.pdf | Bin 0 -> 61861 bytes macros/generic/markdown/examples/latex.tex | 21 +- macros/generic/markdown/latexmkrc | 5 + macros/generic/markdown/markdown.dtx | 1946 +++++-- macros/generic/markdown/markdown.html | 5937 ++++++++++---------- macros/generic/markdown/markdown.pdf | Bin 895604 -> 917637 bytes macros/latex/contrib/href-ul/README.md | 9 +- macros/latex/contrib/href-ul/href-ul.dtx | 64 +- macros/latex/contrib/href-ul/href-ul.ins | 8 +- macros/latex/contrib/href-ul/href-ul.pdf | Bin 229763 -> 283808 bytes macros/latex/contrib/jeuxcartes/README.md | 18 +- .../contrib/jeuxcartes/doc/JeuxCartes-doc.pdf | Bin 6662060 -> 3106316 bytes .../contrib/jeuxcartes/doc/JeuxCartes-doc.tex | 16 +- .../latex/contrib/jeuxcartes/tex/CaJ-Poker-10C.png | Bin 16929 -> 5994 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-10K.png | Bin 15717 -> 6018 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-10P.png | Bin 10524 -> 6652 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-10T.png | Bin 11012 -> 7406 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-2C.png | Bin 7450 -> 2651 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-2K.png | Bin 6972 -> 2473 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-2P.png | Bin 4473 -> 2686 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-2T.png | Bin 4722 -> 2820 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-3C.png | Bin 9224 -> 3219 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-3K.png | Bin 8548 -> 2886 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-3P.png | Bin 5545 -> 3306 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-3T.png | Bin 5747 -> 3443 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-4C.png | Bin 8699 -> 3359 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-4K.png | Bin 8033 -> 3084 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-4P.png | Bin 5641 -> 3490 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-4T.png | Bin 5846 -> 3792 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-5C.png | Bin 10512 -> 3802 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-5K.png | Bin 9703 -> 3550 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-5P.png | Bin 6560 -> 3811 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-5T.png | Bin 6848 -> 4737 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-6C.png | Bin 12632 -> 4626 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-6K.png | Bin 11949 -> 4221 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-6P.png | Bin 7830 -> 4532 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-6T.png | Bin 8152 -> 5550 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-7C.png | Bin 12522 -> 5135 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-7K.png | Bin 11715 -> 4364 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-7P.png | Bin 7792 -> 4609 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-7T.png | Bin 8108 -> 5421 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-8C.png | Bin 15268 -> 5560 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-8K.png | Bin 14105 -> 5283 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-8P.png | Bin 9295 -> 5945 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-8T.png | Bin 9769 -> 6687 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-9C.png | Bin 15968 -> 6251 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-9K.png | Bin 14817 -> 5819 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-9P.png | Bin 9830 -> 6250 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-9T.png | Bin 10282 -> 6630 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-AC.png | Bin 6887 -> 2417 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-AK.png | Bin 6586 -> 2430 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-AP.png | Bin 4160 -> 2358 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-AT.png | Bin 12024 -> 7599 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-DC.png | Bin 90274 -> 34803 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-DK.png | Bin 83544 -> 32567 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-DP.png | Bin 85185 -> 33449 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-DT.png | Bin 80241 -> 32832 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosArgent.png | Bin 28919 -> 14175 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosBase.png | Bin 1594 -> 669 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosBleu.png | Bin 62669 -> 21170 bytes .../jeuxcartes/tex/CaJ-Poker-DosBleuFonce.png | Bin 59833 -> 21071 bytes .../jeuxcartes/tex/CaJ-Poker-DosBleuVert.png | Bin 62969 -> 20768 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosCyan.png | Bin 53015 -> 20302 bytes .../jeuxcartes/tex/CaJ-Poker-DosFuchsia.png | Bin 53007 -> 20450 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosGris.png | Bin 33037 -> 20005 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosJaune.png | Bin 53007 -> 19807 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosMarron.png | Bin 63461 -> 22269 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosNavy.png | Bin 63519 -> 22895 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosNoir.png | Bin 45992 -> 23053 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosOlive.png | Bin 63108 -> 21555 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosRouge.png | Bin 59833 -> 21422 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosVert.png | Bin 64250 -> 22996 bytes .../jeuxcartes/tex/CaJ-Poker-DosVertCitron.png | Bin 55974 -> 23279 bytes .../contrib/jeuxcartes/tex/CaJ-Poker-DosViolet.png | Bin 64088 -> 21009 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-JN.png | Bin 38205 -> 15546 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-JR.png | Bin 38208 -> 15463 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-RC.png | Bin 81364 -> 32144 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-RK.png | Bin 84821 -> 33496 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-RP.png | Bin 86164 -> 33737 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-RT.png | Bin 86879 -> 35570 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-VC.png | Bin 79792 -> 29764 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-VK.png | Bin 77964 -> 29250 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-VP.png | Bin 93105 -> 36696 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Poker-VT.png | Bin 82311 -> 31821 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-10AT.png | Bin 57196 -> 49076 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-10C.png | Bin 6550 -> 4915 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-10K.png | Bin 6515 -> 4573 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-10P.png | Bin 8337 -> 5819 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-10T.png | Bin 9148 -> 6708 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-11AT.png | Bin 55004 -> 48134 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-12AT.png | Bin 59829 -> 52617 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-13AT.png | Bin 65265 -> 58662 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-14AT.png | Bin 52917 -> 45016 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-15AT.png | Bin 61233 -> 53421 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-16AT.png | Bin 68221 -> 59299 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-17AT.png | Bin 64238 -> 56316 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-18AT.png | Bin 66932 -> 59221 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-19AT.png | Bin 58843 -> 51930 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-1AT.png | Bin 54608 -> 47803 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-20AT.png | Bin 56498 -> 49018 bytes .../contrib/jeuxcartes/tex/CaJ-Tarot-21AT.png | Bin 63853 -> 56981 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-2AT.png | Bin 59695 -> 52493 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-2C.png | Bin 3982 -> 2817 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-2K.png | Bin 3885 -> 2731 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-2P.png | Bin 4568 -> 3178 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-2T.png | Bin 4837 -> 3261 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-3AT.png | Bin 63032 -> 55268 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-3C.png | Bin 4496 -> 3134 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-3K.png | Bin 4369 -> 2976 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-3P.png | Bin 5226 -> 3510 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-3T.png | Bin 5583 -> 3781 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-4AT.png | Bin 61773 -> 54937 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-4C.png | Bin 4293 -> 2873 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-4K.png | Bin 4236 -> 2944 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-4P.png | Bin 5059 -> 3467 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-4T.png | Bin 5569 -> 3694 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-5AT.png | Bin 58625 -> 51691 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-5C.png | Bin 4617 -> 3205 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-5K.png | Bin 4552 -> 3253 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-5P.png | Bin 5519 -> 3640 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-5T.png | Bin 6160 -> 4266 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-6AT.png | Bin 59895 -> 52620 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-6C.png | Bin 5217 -> 3627 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-6K.png | Bin 5008 -> 3640 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-6P.png | Bin 6308 -> 4366 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-6T.png | Bin 6865 -> 4793 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-7AT.png | Bin 62153 -> 54332 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-7C.png | Bin 5270 -> 3642 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-7K.png | Bin 5059 -> 3622 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-7P.png | Bin 6377 -> 4306 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-7T.png | Bin 7024 -> 4858 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-8AT.png | Bin 62990 -> 55824 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-8C.png | Bin 5944 -> 4020 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-8K.png | Bin 5742 -> 3965 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-8P.png | Bin 7308 -> 5019 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-8T.png | Bin 8152 -> 5539 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-9AT.png | Bin 58278 -> 51363 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-9C.png | Bin 6038 -> 4219 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-9K.png | Bin 5961 -> 4403 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-9P.png | Bin 7427 -> 5169 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-9T.png | Bin 8140 -> 5762 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-AC.png | Bin 3206 -> 2099 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-AK.png | Bin 3099 -> 1969 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-AP.png | Bin 3693 -> 2363 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-AT.png | Bin 3880 -> 2465 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-CC.png | Bin 55076 -> 49174 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-CK.png | Bin 55019 -> 48584 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-CP.png | Bin 59298 -> 55017 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-CT.png | Bin 57354 -> 50536 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-DC.png | Bin 51517 -> 45689 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-DK.png | Bin 49058 -> 43543 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-DP.png | Bin 52460 -> 46312 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-DT.png | Bin 44217 -> 38923 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-Dos.png | Bin 13810 -> 12272 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-Exc.png | Bin 59732 -> 54989 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-RC.png | Bin 54000 -> 48690 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-RK.png | Bin 56080 -> 50764 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-RP.png | Bin 47461 -> 42710 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-RT.png | Bin 59599 -> 53982 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-VC.png | Bin 56135 -> 51015 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-VK.png | Bin 63167 -> 56713 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-VP.png | Bin 56491 -> 50456 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Tarot-VT.png | Bin 53517 -> 47649 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-0B.png | Bin 18565 -> 5706 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-0J.png | Bin 17202 -> 5374 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-0R.png | Bin 18850 -> 5582 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-0V.png | Bin 19036 -> 5392 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-1B.png | Bin 15439 -> 4754 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-1J.png | Bin 14420 -> 4540 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-1R.png | Bin 15864 -> 4071 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-1V.png | Bin 15926 -> 4543 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-2B.png | Bin 18072 -> 5396 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-2J.png | Bin 16733 -> 4664 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-2R.png | Bin 18350 -> 5205 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-2V.png | Bin 18621 -> 5257 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-3B.png | Bin 17594 -> 5198 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-3J.png | Bin 16278 -> 4738 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-3R.png | Bin 17851 -> 5180 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-3V.png | Bin 18077 -> 5091 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-4B.png | Bin 16432 -> 5067 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-4J.png | Bin 15177 -> 4567 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-4R.png | Bin 16737 -> 4795 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-4V.png | Bin 16962 -> 4755 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-5B.png | Bin 17926 -> 5332 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-5J.png | Bin 16611 -> 4604 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-5R.png | Bin 18289 -> 5448 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-5V.png | Bin 18463 -> 5225 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-6B.png | Bin 16961 -> 4621 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-6J.png | Bin 15679 -> 4765 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-6R.png | Bin 17243 -> 4986 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-6V.png | Bin 17439 -> 4834 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-7B.png | Bin 16703 -> 5240 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-7J.png | Bin 15546 -> 5076 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-7R.png | Bin 17086 -> 4960 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-7V.png | Bin 17239 -> 4969 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-8B.png | Bin 17900 -> 5207 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-8J.png | Bin 16498 -> 5191 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-8R.png | Bin 18128 -> 5163 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-8V.png | Bin 18357 -> 5248 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-9B.png | Bin 17003 -> 5166 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-9J.png | Bin 15702 -> 4905 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-9R.png | Bin 17298 -> 5145 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-9V.png | Bin 17468 -> 4733 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-CSB.png | Bin 26231 -> 7087 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-CSJ.png | Bin 23900 -> 6841 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-CSR.png | Bin 26768 -> 6736 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-CSV.png | Bin 27195 -> 6402 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-Dos.png | Bin 19451 -> 5666 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-P2B.png | Bin 21458 -> 6248 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-P2J.png | Bin 19765 -> 5598 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-P2R.png | Bin 21877 -> 6111 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-P2V.png | Bin 22037 -> 5786 bytes macros/latex/contrib/jeuxcartes/tex/CaJ-Uno-P4.png | Bin 25683 -> 7377 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-PTJ.png | Bin 23467 -> 6152 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-PTR.png | Bin 26061 -> 6524 bytes .../latex/contrib/jeuxcartes/tex/CaJ-Uno-PTV.png | Bin 26507 -> 6355 bytes .../latex/contrib/jeuxcartes/tex/Caj-Uno-Coul.png | Bin 29329 -> 7534 bytes .../latex/contrib/jeuxcartes/tex/Caj-Uno-PTB.png | Bin 25529 -> 6458 bytes macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty | 855 +-- macros/latex/contrib/to-be-determined/README.md | 9 +- .../contrib/to-be-determined/to-be-determined.dtx | 40 +- .../contrib/to-be-determined/to-be-determined.ins | 8 +- .../contrib/to-be-determined/to-be-determined.pdf | Bin 232654 -> 250268 bytes macros/luatex/latex/piton/piton-french.pdf | Bin 217579 -> 220708 bytes macros/luatex/latex/piton/piton-french.tex | 98 +- macros/luatex/latex/piton/piton.dtx | 1712 ++++-- macros/luatex/latex/piton/piton.pdf | Bin 407293 -> 460278 bytes 242 files changed, 7534 insertions(+), 4629 deletions(-) create mode 100644 macros/generic/markdown/LICENSE create mode 100644 macros/generic/markdown/Makefile create mode 100644 macros/generic/markdown/examples/README.md create mode 100644 macros/generic/markdown/examples/context-mkii.pdf create mode 100644 macros/generic/markdown/examples/context-mkiv.pdf create mode 100644 macros/generic/markdown/examples/latex-luatex.pdf create mode 100644 macros/generic/markdown/examples/latex-pdftex.pdf create mode 100644 macros/generic/markdown/examples/latex-tex4ht.css create mode 100644 macros/generic/markdown/examples/latex-tex4ht.html create mode 100644 macros/generic/markdown/examples/latex-xetex.pdf create mode 100644 macros/generic/markdown/latexmkrc (limited to 'macros') diff --git a/macros/generic/markdown/CHANGES.md b/macros/generic/markdown/CHANGES.md index 077fb63c99..7e6575d20d 100644 --- a/macros/generic/markdown/CHANGES.md +++ b/macros/generic/markdown/CHANGES.md @@ -1,5 +1,46 @@ # Changes +## 2.18.0 (2022-10-31) + +Development: + +- Accept snake\_case variants of options in addition to camelCase variants in + `\markdownSetup` and Lua CLI. Accept snake\_case and caseless variants of + options in `\setupmarkdown`. (#193, #194, #195, #196, #197, #198) +- Rename renderers, renderer prototypes and options based on the semantics of + elements: (#187, #201) + - Rename the `horizontalRule` and `footnote` renderers and renderer + prototypes to `thematicBreak` and `note`. + - Rename the `footnotes` and `inlineFootnotes` options to `notes` and + `inlineNotes`. + - Rename the `HorizontalRule` rule to `ThematicBreak` and increment + `grammar_version` to `2`. This change is not backwards-compatible with the + `grammar_version` of `1`. +- Add `\markdownEscape` macro that inputs a TeX document in the middle of a + markdown document fragment. (1478f7b) +- Add support for raw attributes. (#173, #202) + +Fixes: + +- Fix missing support for forward slashes in + `\markdownSetup{jekyllDataRenderers = {...}}` keys. (#199, #200) +- Fix `plain` LaTeX option not preventing changes to renderer prototypes. + (013abbb) + +Continuous Integration: + +- Check user manual with MarkdownLint. (#203) + +Contributed Software: + +- Update `contributions/pandoc-to-markdown`. + (contributed by @drehak, 3d5b8e5, d3073bc) + +Deprecation: + +- Deprecate `horizontalRule` and `footnote` renderers and renderer prototypes. + (#187, #201) + ## 2.17.1 (2022-10-03) Fixes: diff --git a/macros/generic/markdown/LICENSE b/macros/generic/markdown/LICENSE new file mode 100644 index 0000000000..4db9b5af29 --- /dev/null +++ b/macros/generic/markdown/LICENSE @@ -0,0 +1,415 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. diff --git a/macros/generic/markdown/Makefile b/macros/generic/markdown/Makefile new file mode 100644 index 0000000000..fb68360821 --- /dev/null +++ b/macros/generic/markdown/Makefile @@ -0,0 +1,205 @@ +.PHONY: all base clean implode dist test docker-image force + +SHELL=/bin/bash + +AUXFILES=markdown.bbl markdown.cb markdown.cb2 markdown.glo markdown.bbl \ + markdown.run.xml markdown.markdown.in markdown.markdown.lua \ + markdown.markdown.out markdown-interfaces.md markdown-miscellanea.md \ + markdown-options.md markdown-tokens.md $(TECHNICAL_DOCUMENTATION_RESOURCES) \ + $(VERSION_FILE) +AUXDIRS=_minted-markdown _markdown_markdown markdown pkgcheck +TDSARCHIVE=markdown.tds.zip +CTANARCHIVE=markdown.ctan.zip +DISTARCHIVE=markdown.zip +ARCHIVES=$(TDSARCHIVE) $(CTANARCHIVE) $(DISTARCHIVE) +EXAMPLES_RESOURCES=examples/example.md examples/scientists.csv +EXAMPLES_SOURCES=examples/context-mkii.tex examples/context-mkiv.tex examples/latex.tex +EXAMPLES=examples/context-mkii.pdf examples/context-mkiv.pdf \ + examples/latex-pdftex.pdf examples/latex-luatex.pdf examples/latex-xetex.pdf \ + examples/latex-tex4ht.html examples/latex-tex4ht.css +TESTS=tests/test.sh tests/support/*.tex tests/templates/*/*.tex.m4 \ + tests/templates/*/COMMANDS.m4 tests/testfiles/*/*.test +MAKES=Makefile $(addsuffix /Makefile, $(SUBDIRECTORIES)) latexmkrc +ROOT_README=README.md markdown.png +READMES=$(ROOT_README) LICENSE examples/README.md tests/README.md \ + tests/support/README.md tests/templates/README.md tests/testfiles/README.md \ + tests/templates/*/README.md tests/testfiles/*/README.md +VERSION_FILE=VERSION +CHANGES_FILE=CHANGES.md +DTXARCHIVE=markdown.dtx +INSTALLER=markdown.ins docstrip.cfg +TECHNICAL_DOCUMENTATION_RESOURCES=markdown.bib markdown-figure-block-diagram.tex \ + markdownthemewitiko_markdown_techdoc.sty +TECHNICAL_DOCUMENTATION=markdown.pdf +MARKDOWN_USER_MANUAL=markdown.md markdown.css +HTML_USER_MANUAL=markdown.html markdown.css +USER_MANUAL=$(MARKDOWN_USER_MANUAL) $(HTML_USER_MANUAL) +DOCUMENTATION=$(TECHNICAL_DOCUMENTATION) $(HTML_USER_MANUAL) $(ROOT_README) $(VERSION_FILE) \ + $(CHANGES_FILE) +LIBRARIES=libraries/markdown-tinyyaml.lua +INSTALLABLES=markdown.lua markdown-cli.lua markdown.tex markdown.sty t-markdown.tex \ + markdownthemewitiko_dot.sty markdownthemewitiko_graphicx_http.sty \ + markdownthemewitiko_tilde.sty +EXTRACTABLES=$(INSTALLABLES) $(MARKDOWN_USER_MANUAL) $(TECHNICAL_DOCUMENTATION_RESOURCES) +MAKEABLES=$(TECHNICAL_DOCUMENTATION) $(USER_MANUAL) $(INSTALLABLES) $(EXAMPLES) +RESOURCES=$(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(EXAMPLES) \ + $(MAKES) $(READMES) $(INSTALLER) $(DTXARCHIVE) $(TESTS) +EVERYTHING=$(RESOURCES) $(INSTALLABLES) $(LIBRARIES) +GITHUB_PAGES=gh-pages + +VERSION=$(shell git describe --tags --always --long --exclude latest) +LASTMODIFIED=$(shell git log -1 --date=format:%Y-%m-%d --format=%ad) + +# This is the default pseudo-target. It typesets the manual, +# the examples, and extracts the package files. +all: $(MAKEABLES) + $(MAKE) clean + +# This pseudo-target extracts the source files out of the DTX archive and +# produces external Lua libraries. +base: $(INSTALLABLES) $(LIBRARIES) + $(MAKE) clean + +# This pseudo-target builds a witiko/markdown Docker image. +docker-image: + DOCKER_BUILDKIT=1 docker build --pull --build-arg TEXLIVE_TAG=$(TEXLIVE_TAG) \ + -t witiko/markdown:$(TEXLIVE_TAG) \ + -t witiko/markdown:$(VERSION)-$(TEXLIVE_TAG) . + +# This targets produces a directory with files for the GitHub Pages service. +$(GITHUB_PAGES): $(HTML_USER_MANUAL) + mkdir -p $@ + cp markdown.html $@/index.html + cp markdown.css $@ + +# This target extracts the source files out of the DTX archive. +$(EXTRACTABLES): $(INSTALLER) $(DTXARCHIVE) + xetex $< + sed -i \ + -e 's#(((VERSION)))#$(VERSION)#g' \ + -e 's#(((LASTMODIFIED)))#$(LASTMODIFIED)#g' \ + $(INSTALLABLES) + +# This target produces the version file. +$(VERSION_FILE): force + printf '%s (%s)\n' $(VERSION) $(LASTMODIFIED) > $@ + +# This target produces external Lua libraries. +$(LIBRARIES): force + $(MAKE) -C libraries $(notdir $@) + +# This target typesets the manual. +$(TECHNICAL_DOCUMENTATION): $(DTXARCHIVE) $(TECHNICAL_DOCUMENTATION_RESOURCES) + latexmk -silent $< || (cat $(basename $@).log 1>&2; exit 1) + test `tail $(basename $<).log | sed -rn 's/.*\(([0-9]*) pages.*/\1/p'` -gt 150 + +# These targets typeset the examples. +$(EXAMPLES): $(EXAMPLE_SOURCES) examples/example.tex + $(MAKE) -C examples $(notdir $@) + +examples/example.tex: force + $(MAKE) -C examples $(notdir $@) + +# This target converts the markdown user manual to an HTML page. +%.html: %.md %.css + awk '{ \ + filename = gensub(/^\/(.*\.md)$$/, "\\1", "g"); \ + if(filename != $$0) \ + system("cat " filename); \ + else \ + print($$0); \ + }' <$< | \ + sed -e 's#\\markdownVersion{}#$(VERSION)#g' \ + -e 's#\\markdownLastModified{}#$(LASTMODIFIED)#g' \ + -e 's#\\TeX{}#TeX#g' \ + -e 's#\\LaTeX{}#LaTeX#g' \ + -e 's#\\Hologo{ConTeXt}#ConTeXt#g' \ + -e 's#\\Opt{\([^}]*\)}#**`\1`**#g' \ + -e 's#\\pkg{\([^}]*\)}#**`\1`**#g' \ + -e 's#\\,# #g' \ + -e 's#\\meta{\([^}]*\)}#\⟨*\1*\⟩#g' \ + -e 's#\\acro{\([^}]*\)}#\1#g' \ + -e 's#😉##g' \ + -e 's#\\envm{\([^}]*\)}#`\1`#g' \ + -e 's#\\envmdef{\([^}]*\)}#`\1`#g' \ + -e 's#\\envmref{\([^}]*\)}#`\1`#g' \ + -e 's#\\m{\([^}]*\)}#`\\\1`#g' \ + -e 's#\\mdef{\([^}]*\)}#`\\\1`#g' \ + -e 's#\\mref{\([^}]*\)}#`\\\1`#g' \ + | \ + pandoc -f markdown -t html -N -s --toc --toc-depth=3 --css=$(word 2, $^) >$@ + +# This pseudo-target runs all the tests in the `tests/` directory. +test: + $(MAKE) -C tests + +# This pseudo-target produces the distribution archives. +dist: implode + $(MAKE) $(ARCHIVES) + git clone https://gitlab.com/Lotz/pkgcheck.git + unzip $(CTANARCHIVE) -d markdown + for RETRY in $$(seq 1 10); \ + do \ + if (( RETRY > 1 )); \ + then \ + sleep $$((RETRY * 15)); \ + fi; \ + if pkgcheck/bin/pkgcheck -d markdown/markdown -T $(TDSARCHIVE) --urlcheck; \ + then \ + EXIT_CODE=0; \ + break; \ + else \ + EXIT_CODE=$$?; \ + fi; \ + done; \ + exit $$EXIT_CODE + $(MAKE) clean + +# This target produces the TeX directory structure archive. +$(TDSARCHIVE): $(DTXARCHIVE) $(INSTALLER) $(INSTALLABLES) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES) + @# Installing the macro package. + mkdir -p tex/generic/markdown tex/luatex/markdown tex/latex/markdown \ + tex/context/third/markdown scripts/markdown + cp markdown.lua $(LIBRARIES) tex/luatex/markdown/ + cp markdown-cli.lua scripts/markdown/ + cp markdown.sty markdownthemewitiko_dot.sty markdownthemewitiko_graphicx_http.sty \ + markdownthemewitiko_tilde.sty tex/latex/markdown/ + cp markdown.tex tex/generic/markdown/ + cp t-markdown.tex tex/context/third/markdown/ + @# Installing the documentation. + mkdir -p doc/generic/markdown doc/latex/markdown/examples \ + doc/context/third/markdown/examples + cp $(DOCUMENTATION) doc/generic/markdown/ + cp examples/context-mkii.tex examples/context-mkiv.tex $(EXAMPLES_RESOURCES) \ + doc/context/third/markdown/examples/ + cp examples/latex.tex $(EXAMPLES_RESOURCES) doc/latex/markdown/examples/ + @# Installing the sources. + mkdir -p source/generic/markdown + cp $(DTXARCHIVE) $(INSTALLER) source/generic/markdown + zip -r -v -nw $@ doc scripts source tex + rm -rf doc scripts source tex + +# This target produces the distribution archive. +$(DISTARCHIVE): $(EVERYTHING) $(TDSARCHIVE) + -ln -s . markdown + zip -MM -r -v -nw $@ $(addprefix markdown/,$(EVERYTHING)) $(TDSARCHIVE) + rm -f markdown + +# This target produces the CTAN archive. +$(CTANARCHIVE): $(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES) $(TDSARCHIVE) + -ln -s . markdown + zip -MM -r -v -nw $@ $(addprefix markdown/,$(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES)) $(TDSARCHIVE) + rm -f markdown + +# This pseudo-target removes any existing auxiliary files and directories. +clean: + latexmk -c $(DTXARCHIVE) + rm -f $(AUXFILES) + rm -rf ${AUXDIRS} + $(MAKE) -C examples clean + +# This pseudo-target removes any makeable files. +implode: clean + rm -f $(MAKEABLES) $(ARCHIVES) + $(MAKE) -C examples implode + $(MAKE) -C libraries implode diff --git a/macros/generic/markdown/README.md b/macros/generic/markdown/README.md index c47b1074a2..d7423fa93b 100644 --- a/macros/generic/markdown/README.md +++ b/macros/generic/markdown/README.md @@ -185,8 +185,9 @@ For further information, consult one of the following: - [Using Markdown inside TeX documents][tb119], - [Markdown 2.7.0: Towards lightweight markup in TeX][tb124], - [Making Markdown into a Microwave Meal][tb129], - - [Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX][tb131], and - - [Markdown 2.15.0: What's New?][tb133]. + - [Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX][tb131], + - [Markdown 2.15.0: What's New?][tb133], and + - [Markdown 2.17.1: What's New, What's Next?][tb135]. 5. Journal articles of me and my students published by [CSTUG][] (in Czech and Slovak): - [Rendering Markdown inside TeX Documents][10.5300/2016-1-4/78], - [Markdown 2.8.1: Boldly Unto the Throne of Lightweight Markup in TeX][10.5300/2020-1-2/48], @@ -204,11 +205,12 @@ For further information, consult one of the following: [overleaf-5]: https://www.overleaf.com/latex/examples/writing-posters-with-markdown/jtbgmmgqrqmh "Writing Posters with Markdown" [overleaf-6]: https://www.overleaf.com/latex/examples/using-markdown-in-latex-documents/whdrnpcpnwrm "Using Markdown in LaTeX documents" - [tb119]: https://www.tug.org/TUGboat/tb38-2/tb119novotny.pdf "Using Markdown inside TeX documents" - [tb124]: https://www.tug.org/TUGboat/tb40-1/tb124novotny-markdown.pdf "Markdown 2.7.0: Towards lightweight markup in TeX" - [tb129]: https://www.tug.org/TUGboat/tb41-3/tb129novotny-frozen.pdf "Making Markdown into a Microwave Meal" - [tb131]: https://www.tug.org/TUGboat/tb42-2/tb131novotny-markdown.pdf "Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX" - [tb133]: https://tug.org/TUGboat/tb43-1/tb133novotny-markdown.pdf "Markdown 2.15.0: What's New?" + [tb119]: https://www.tug.org/TUGboat/tb38-2/tb119novotny.pdf "Using Markdown inside TeX documents" + [tb124]: https://www.tug.org/TUGboat/tb40-1/tb124novotny-markdown.pdf "Markdown 2.7.0: Towards lightweight markup in TeX" + [tb129]: https://www.tug.org/TUGboat/tb41-3/tb129novotny-frozen.pdf "Making Markdown into a Microwave Meal" + [tb131]: https://www.tug.org/TUGboat/tb42-2/tb131novotny-markdown.pdf "Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX" + [tb133]: https://www.tug.org/TUGboat/tb43-1/tb133novotny-markdown.pdf "Markdown 2.15.0: What's New?" + [tb135]: https://www.tug.org/TUGboat/production/43-3/tb135novotny-markdown.pdf "Markdown 2.17.1: What's New, What's Next?" [tb131-slides]: https://tug.org/tug2021/assets/pdf/tug2021-novotny-slides.pdf "Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX" [tb131-video]: https://youtu.be/THmPkAncMnc "Markdown 2.10.0: LaTeX Themes & Snippets, Two Flavors of Comments, and LuaMetaTeX" diff --git a/macros/generic/markdown/VERSION b/macros/generic/markdown/VERSION index 5435cd30d6..ca77f648f3 100644 --- a/macros/generic/markdown/VERSION +++ b/macros/generic/markdown/VERSION @@ -1 +1 @@ -2.17.1-0-g8ca83f5 (2022-10-03) +2.18.0-0-gd8ae860 (2022-10-30) diff --git a/macros/generic/markdown/examples/README.md b/macros/generic/markdown/examples/README.md new file mode 100644 index 0000000000..0d32d16ec4 --- /dev/null +++ b/macros/generic/markdown/examples/README.md @@ -0,0 +1,7 @@ +This directory contains example LaTeX and ConTeXt documents. These documents +can be typeset by running the GNU `make` program in this directory. It is +expected that your TeX installation contains the `pdflatex`, `xelatex`, +`lualatex`, `texexec`, and `context` executables. + +The `markdown.dtx` file in the root directory contains documentation in the +markdown language and can also serve as an example LaTeX document. diff --git a/macros/generic/markdown/examples/context-mkii.pdf b/macros/generic/markdown/examples/context-mkii.pdf new file mode 100644 index 0000000000..2f2f8e11cf Binary files /dev/null and b/macros/generic/markdown/examples/context-mkii.pdf differ diff --git a/macros/generic/markdown/examples/context-mkii.tex b/macros/generic/markdown/examples/context-mkii.tex index 77809fa16b..b2c48ac00a 100644 --- a/macros/generic/markdown/examples/context-mkii.tex +++ b/macros/generic/markdown/examples/context-mkii.tex @@ -9,21 +9,22 @@ % Set options of the Markdown module. \setupmarkdown [ - hashEnumerators = yes, + contentBlocks = yes, debugExtensions = yes, definitionLists = yes, - smartEllipses = yes, - footnotes = yes, - inlineFootnotes = yes, + fancy_lists = yes, fencedCode = yes, - contentBlocks = yes, + hashEnumerators = yes, + inlineNotes = yes, + notes = yes, pipeTables = yes, + rawAttribute = yes, + smartEllipses = yes, + strikethrough = yes, + subscripts = yes, + superscripts = yes, tableCaptions = yes, taskLists = yes, - strikeThrough = yes, - superscripts = yes, - subscripts = yes, - fancyLists = yes, ] % Set renderers of the Markdown module. diff --git a/macros/generic/markdown/examples/context-mkiv.pdf b/macros/generic/markdown/examples/context-mkiv.pdf new file mode 100644 index 0000000000..51246ff4a7 Binary files /dev/null and b/macros/generic/markdown/examples/context-mkiv.pdf differ diff --git a/macros/generic/markdown/examples/context-mkiv.tex b/macros/generic/markdown/examples/context-mkiv.tex index 8849e7bd66..b91ab03d99 100644 --- a/macros/generic/markdown/examples/context-mkiv.tex +++ b/macros/generic/markdown/examples/context-mkiv.tex @@ -9,21 +9,22 @@ % Set options of the Markdown module. \setupmarkdown [ - hashEnumerators = yes, + contentBlocks = yes, debugExtensions = yes, definitionLists = yes, - smartEllipses = yes, - footnotes = yes, - inlineFootnotes = yes, + fancy_lists = yes, fencedCode = yes, - contentBlocks = yes, + hashEnumerators = yes, + inlineNotes = yes, + notes = yes, pipeTables = yes, + rawAttribute = yes, + smartEllipses = yes, + strikethrough = yes, + subscripts = yes, + superscripts = yes, tableCaptions = yes, taskLists = yes, - strikeThrough = yes, - superscripts = yes, - subscripts = yes, - fancyLists = yes, ] % Set renderers of the Markdown module. diff --git a/macros/generic/markdown/examples/example.md b/macros/generic/markdown/examples/example.md index 24ca2c6362..f697bcff57 100644 --- a/macros/generic/markdown/examples/example.md +++ b/macros/generic/markdown/examples/example.md @@ -10,7 +10,7 @@ ###### This is an H6 -This is a text paragraph containing an ellipsis ... and followed by a horizontal rule. +This is a text paragraph containing an ellipsis ... and followed by a thematic break. *** @@ -148,20 +148,26 @@ This is a block quote: > > Back to the first level. -Here is a footnote reference[^1] and another.[^longnote] +Here is a note reference[^1] and another.[^longnote] Here is an inline note.^[Inlines notes are easier to write, since you don't have to pick an identifier and move down to type the note.] - -[^1]: Here is the footnote. + +[^1]: Here is the note. [^longnote]: Here's one with multiple blocks. - + Subsequent paragraphs are indented to show that they -belong to the previous footnote. - +belong to the previous note. + Some code The whole paragraph can be indented, or just the first - line. In this way, multi-paragraph footnotes work like + line. In this way, multi-paragraph notes work like multi-paragraph list items. + +This is raw `\TeX`{=tex} code: + +``` {=tex} +$$ x^n + y^n = z^n $$ +``` diff --git a/macros/generic/markdown/examples/latex-luatex.pdf b/macros/generic/markdown/examples/latex-luatex.pdf new file mode 100644 index 0000000000..7777fae525 Binary files /dev/null and b/macros/generic/markdown/examples/latex-luatex.pdf differ diff --git a/macros/generic/markdown/examples/latex-pdftex.pdf b/macros/generic/markdown/examples/latex-pdftex.pdf new file mode 100644 index 0000000000..10024e87b2 Binary files /dev/null and b/macros/generic/markdown/examples/latex-pdftex.pdf differ diff --git a/macros/generic/markdown/examples/latex-tex4ht.css b/macros/generic/markdown/examples/latex-tex4ht.css new file mode 100644 index 0000000000..1a76a03921 --- /dev/null +++ b/macros/generic/markdown/examples/latex-tex4ht.css @@ -0,0 +1,219 @@ + +/* start css.sty */ +.ec-lmr-17{font-size:170%;} +.ec-lmri-12x-x-144{font-size:172%; font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmri-12x-x-144{ font-style:italic;} +.ec-lmr-12{font-size:120%;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmtt-10{ font-family: monospace,monospace;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmbx-10{ font-weight: bold;} +.ec-lmr-9{font-size:90%;} +.ec-lmr-8{font-size:80%;} +.ec-lmtt-8{font-size:80%; font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmtt-8{ font-family: monospace,monospace;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.ec-lmri-10{ font-style:italic;} +.lmmi-7{font-size:70%;} +p{margin-top:0;margin-bottom:0} +p.indent{text-indent:0;} +p + p{margin-top:1em;} +p + div, p + pre {margin-top:1em;} +div + p, pre + p {margin-top:1em;} +a { overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; hyphens: auto; } +@media print {div.crosslinks {visibility:hidden;}} +table.tabular{border-collapse: collapse; border-spacing: 0;} +a img { border-top: 0; border-left: 0; border-right: 0; } +center { margin-top:1em; margin-bottom:1em; } +td center { margin-top:0em; margin-bottom:0em; } +.Canvas { position:relative; } +img.math{vertical-align:middle;} +div.par-math-display, div.math-display{text-align:center;} +li p.indent { text-indent: 0em } +li p:first-child{ margin-top:0em; } +li p:last-child, li div:last-child { margin-bottom:0.5em; } +li p:first-child{ margin-bottom:0; } +li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; } +.enumerate1 {list-style-type:decimal;} +.enumerate2 {list-style-type:lower-alpha;} +.enumerate3 {list-style-type:lower-roman;} +.enumerate4 {list-style-type:upper-alpha;} +div.newtheorem { margin-bottom: 2em; margin-top: 2em;} +div.newtheorem .head{font-weight: bold;} +.obeylines-h,.obeylines-v {white-space: nowrap; } +div.obeylines-v p { margin-top:0; margin-bottom:0; } +.overline{ text-decoration:overline; } +.overline img{ border-top: 1px solid black; } +td.displaylines {text-align:center; white-space:nowrap;} +.centerline {text-align:center;} +.rightline {text-align:right;} +pre.verbatim {font-family: monospace,monospace; text-align:left; clear:both; } +.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.fbox {display:table} +div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +div.minipage{width:100%;} +div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} +div.center div {text-align: left;} +div.flushright, div.flushright div.flushright {text-align: right;} +div.flushright div {text-align: left;} +div.flushleft {text-align: left;} +.underline{ text-decoration:underline; } +.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; } +.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +.framebox-c {text-align:center;} +.framebox-l {text-align:left;} +.framebox-r {text-align:right;} +span.thank-mark{ vertical-align: super } +span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; } +div.footnotes{border-top:solid 1px black; border-bottom:solid 1px black; padding-bottom:1ex; padding-top:0.5ex; margin-right:15%; margin-top:2ex; font-style:italic; font-size:85%;} +div.footnotes p{margin-top:0; margin-bottom:0; text-indent:0;} +div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; } +table.tabular td p{margin-top:0em;} +table.tabular {margin-left: auto; margin-right: auto;} +td p:first-child{ margin-top:0em; } +td p:last-child{ margin-bottom:0em; } +div.td00{ margin-left:0pt; margin-right:0pt; } +div.td01{ margin-left:0pt; margin-right:5pt; } +div.td10{ margin-left:5pt; margin-right:0pt; } +div.td11{ margin-left:5pt; margin-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +td.td00{ padding-left:0pt; padding-right:0pt; } +td.td01{ padding-left:0pt; padding-right:5pt; } +td.td10{ padding-left:5pt; padding-right:0pt; } +td.td11{ padding-left:5pt; padding-right:5pt; } +table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } +.hline hr, .cline hr{ height : 0px; margin:0px; } +.hline td, .cline td{ padding: 0; } +.hline hr, .cline hr{border:none;border-top:1px solid black;} +.hline {border-top: 1px solid black;} +.tabbing-right {text-align:right;} +div.float, div.figure {margin-left: auto; margin-right: auto;} +div.float img {text-align:center;} +div.figure img {text-align:center;} +.marginpar,.reversemarginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;} +.marginpar p,.reversemarginpar p{margin-top:0.4em; margin-bottom:0.4em;} +.reversemarginpar{float:left;} +table.equation {width:100%;} +.equation td{text-align:center; } +td.equation { margin-top:1em; margin-bottom:1em; } +td.equation-label { width:5%; text-align:center; } +td.eqnarray4 { width:5%; white-space: normal; } +td.eqnarray2 { width:5%; } +table.eqnarray-star, table.eqnarray {width:100%;} +div.eqnarray{text-align:center;} +div.array {text-align:center;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.pmatrix img{vertical-align:middle;} +div.pmatrix {text-align:center;} +table.pmatrix {width:100%;} +span.bar-css {text-decoration:overline;} +img.cdots{vertical-align:middle;} +.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;} +.chapterToc a, .chapterToc, .likechapterToc a, .likechapterToc, .appendixToc a, .appendixToc {line-height: 200%; font-weight:bold;} +.index-item, .index-subitem, .index-subsubitem {display:block} +div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;} +div.caption span.id{font-weight: bold; white-space: nowrap; } +h1.partHead{text-align: center} +p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;} +.subparagraphHead, .likesubparagraphHead { font-weight: bold;} +.verse{white-space:nowrap; margin-left:2em} +div.maketitle {text-align:center;} +h2.titleHead{text-align:center;} +div.maketitle{ margin-bottom: 2em; } +div.author, div.date {text-align:center;} +div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; } +h1.partHead{text-align: center} + .chapterToc, .likechapterToc {margin-left:0em;} + .chapterToc ~ .likesectionToc, .chapterToc ~ .sectionToc, .likechapterToc ~ .likesectionToc, .likechapterToc ~ .sectionToc {margin-left:2em;} + .chapterToc ~ .likesectionToc ~ .likesubsectionToc, .chapterToc ~ .likesectionToc ~ .subsectionToc, .chapterToc ~ .sectionToc ~ .likesubsectionToc, .chapterToc ~ .sectionToc ~ .subsectionToc, .likechapterToc ~ .likesectionToc ~ .likesubsectionToc, .likechapterToc ~ .likesectionToc ~ .subsectionToc, .likechapterToc ~ .sectionToc ~ .likesubsectionToc, .likechapterToc ~ .sectionToc ~ .subsectionToc {margin-left:4em;} +.chapterToc ~ .likesectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .chapterToc ~ .likesectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .chapterToc ~ .likesectionToc ~ .subsectionToc ~ .likesubsubsectionToc, .chapterToc ~ .likesectionToc ~ .subsectionToc ~ .subsubsectionToc, .chapterToc ~ .sectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .chapterToc ~ .sectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .chapterToc ~ .sectionToc ~ .subsectionToc ~ .likesubsubsectionToc, .chapterToc ~ .sectionToc ~ .subsectionToc ~ .subsubsectionToc, .likechapterToc ~ .likesectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .likechapterToc ~ .likesectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .likechapterToc ~ .likesectionToc ~ .subsectionToc ~ .likesubsubsectionToc, .likechapterToc ~ .likesectionToc ~ .subsectionToc ~ .subsubsectionToc, .likechapterToc ~ .sectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .likechapterToc ~ .sectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .likechapterToc ~ .sectionToc ~ .subsectionToc ~ .likesubsubsectionToc .likechapterToc ~ .sectionToc ~ .subsectionToc ~ .subsubsectionToc {margin-left:6em;} + .likesectionToc , .sectionToc {margin-left:0em;} + .likesectionToc ~ .likesubsectionToc, .likesectionToc ~ .subsectionToc, .sectionToc ~ .likesubsectionToc, .sectionToc ~ .subsectionToc {margin-left:2em;} +.likesectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .likesectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .likesectionToc ~ .subsectionToc ~ .likesubsubsectionToc, .likesectionToc ~ .subsectionToc ~ .subsubsectionToc, .sectionToc ~ .likesubsectionToc ~ .likesubsubsectionToc, .sectionToc ~ .likesubsectionToc ~ .subsubsectionToc, .sectionToc ~ .subsectionToc ~ .likesubsubsectionToc, .sectionToc ~ .subsectionToc ~ .subsubsectionToc {margin-left:4em;} + .likesubsectionToc, .subsectionToc {margin-left:0em;} + .likesubsectionToc ~ .subsubsectionToc, .subsectionToc ~ .subsubsectionToc {margin-left:2em;} +figure.float, div.figure {margin-left: auto; margin-right: auto;} +figure.figure {text-align:center;} +figcaption.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:center;} +figcaption.caption span.id{font-weight: bold; white-space: nowrap; } +p + figcaption, img + figcaption{margin-top: 1em;} +dt.enumerate{float:left; clear:left; margin-right:0.2em; margin-left:2em;} +dt.compactenum{float:left; clear:left; margin-right:0.2em; margin-left:2em;} +.equation td{text-align:center; } +.equation-star td{text-align:center; } +table.equation-star { width:100%; } +table.equation { width:100%; } +table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign {width:95%; margin-left:5%; white-space: nowrap;} +table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {margin-left:auto; margin-right:auto; white-space: nowrap;} +td.align-label { width:5%; text-align:center; } +td.align-odd { text-align:right; padding-right:0.3em;} +td.align-even { text-align:left; padding-right:0.6em;} +table.multline, table.multline-star {width:100%;} +td.gather {text-align:center; } +table.gather {width:100%;} +div.gather-star {text-align:center;} +pre.fancyvrb {white-space: pre-wrap; margin:0em;font-family:monospace,monospace;} +.rotatebox{display: inline-block;} +span.textso{letter-spacing: 0.3em; word-spacing: 0.3em} +span.textul{text-decoration:underline} +span.textst{text-decoration:line-through} +span.textcaps{font-variant:small-caps} +#TBL-2-1{border-left: 1px solid black;} +#TBL-2-1{border-right:1px solid black;} +#TBL-2-2{border-right:1px solid black;} +#TBL-2-3{border-right:1px solid black;} +tr#TBL-3-1- {border-top:0.11197em solid #000;} +tr#TBL-3-1- {border-bottom:0.06998em solid #000} +tr#TBL-3-4- {border-bottom:0.11197em solid #000} +#TBL-4-1{border-left: 1px solid black;} +#TBL-4-1{border-right:1px solid black;} +#TBL-4-2{border-right:1px solid black;} +#TBL-4-3{border-right:1px solid black;} +tr#TBL-5-1- {border-top:0.11197em solid #000;} +tr#TBL-5-1- {border-bottom:0.06998em solid #000} +tr#TBL-5-4- {border-bottom:0.11197em solid #000} +/* end css.sty */ + diff --git a/macros/generic/markdown/examples/latex-tex4ht.html b/macros/generic/markdown/examples/latex-tex4ht.html new file mode 100644 index 0000000000..225e65c8f7 --- /dev/null +++ b/macros/generic/markdown/examples/latex-tex4ht.html @@ -0,0 +1,452 @@ +
+ + + + +

An Example Markdown Document

+
Vít Novotný

+
October 30, 2022
+ +
+ +An Example Markdown Document + + + + + + + +

Chapter 1
This is an H1

+

1.1 This is an H2

+

+

+

1.1.1 This is an H3

+

+

+
This is an H4
+

This is an H5 +

+

This is an H6 + This is a text paragraph containing an ellipsis … and followed by a thematic +break. +

__________________________________________________________________ +

This is inline code. This is a link1. +This is an emphasized span of text. This is a strongly emphasized span of +text. +

+
+ + + + +
+

+

PIC

+
Figure 1.1: An example image from Martin Scharrer’s mwe package
+ +
+
+ +

+ +
+

+

+
+ + +
Name SurnameBorn
Albert Einstein 1879
Marie Curie 1867
ThomasEdison 1847
+
Table 1.1: The great minds of the 19th century rendered via a content block
+ +
+
+

This is a fenced code block: +

+
+\documentclass{article}
+ 
+\begin{document}
+ 
+  Hello world!
+ 
+\end{document}
+   
+

This is a table: +

+
+ +

+ +
+ + + + +
RightLeftDefaultCenter
1212 12 12
123123 123 123
11 1 1
+
Table 1.2: Demonstration of pipe table syntax.
+ +
+
+

This is a bullet list: +

+

that spans several paragraphs, +

+ +

This is a compact bullet list: +

+

This is an ordered list: +

+5.
The first item of an ordered list
+

that spans several paragraphs, +

+6.
the second item of an ordered list, +
+7.
the third item of an ordered list.
+

This is a fancy ordered list: +

+e)
The first item of an ordered list
+

that spans several paragraphs, +

+ f)
the second item of an ordered list, +
+g)
the third item of an ordered list.
+

This is an ordered list using hash enumerators: +

+1.
The first item of an ordered list
+ +

that spans several paragraphs, +

+1.
the second item of an ordered list, +
+2.
the third item of an ordered list.
+

This is a compact ordered list: +

+5.
The first item of an ordered list, +
+6.
the second item of an ordered list, +
+7.
the third item of an ordered list.
+

This is a compact ordered list using hash enumerators: +

+1.
The first item of an ordered list, +
+2.
the second item of an ordered list, +
+3.
the third item of an ordered list.
+

This is a compact fancy ordered list using hash enumerators: +

+1.
The first item of an ordered list, +
+2.
the second item of an ordered list, +
+3.
the third item of an ordered list.
+

This is a task list: +

+ +

This is a definition list: +

+

+Term 1

+

Definition 1 with some removed text +

+

+Term 2

+

Definition 2 +

+
+Some code, part of Definition 2
+
+

Third paragraph of Definition 2. +

Definition 3 +

+
+

This is a compact definition list: +

+Term 1
Definition 1 +
+Term 2
Definition 2 +

Definition 3 +

+
+

This is a superscript and a subscript. +

This is a block quote: +

+

This is the first level of quoting. +

+

This is nested blockquote.

+

Back to the first level.

+ +

Here is a note reference2 +and another.3 Here +is an inline note.4 +

This is raw TeX code: +

+

+
+xn + yn = zn
+
+ +

+ +

+

Chapter 2
This is an H1

+

2.1 This is an H2

+

+

+

2.1.1 This is an H3

+

+

+
This is an H4
+

This is an H5 +

+

This is an H6 + This is a text paragraph containing an ellipsis … and followed by a thematic +break. +

__________________________________________________________________ +

This is inline code. This is a link1. +This is an emphasized span of text. This is a strongly emphasized span of +text. +

+
+ + + + +
+

+

PIC

+
Figure 2.1: An example image from Martin Scharrer’s mwe package
+ +
+
+ +

+ +
+

+

+
+ + +
Name SurnameBorn
Albert Einstein 1879
Marie Curie 1867
ThomasEdison 1847
+
Table 2.1: The great minds of the 19th century rendered via a content block
+ +
+
+

This is a fenced code block: +

+
+\documentclass{article}
+ 
+\begin{document}
+ 
+  Hello world!
+ 
+\end{document}
+   
+

This is a table: +

+
+ +

+ +
+ + + + +
RightLeftDefaultCenter
1212 12 12
123123 123 123
11 1 1
+
Table 2.2: Demonstration of pipe table syntax.
+ +
+
+

This is a bullet list: +

+

that spans several paragraphs, +

+ +

This is a compact bullet list: +

+

This is an ordered list: +

+5.
The first item of an ordered list
+

that spans several paragraphs, +

+6.
the second item of an ordered list, +
+7.
the third item of an ordered list.
+

This is a fancy ordered list: +

+e)
The first item of an ordered list
+

that spans several paragraphs, +

+ f)
the second item of an ordered list, +
+g)
the third item of an ordered list.
+

This is an ordered list using hash enumerators: +

+1.
The first item of an ordered list
+ +

that spans several paragraphs, +

+1.
the second item of an ordered list, +
+2.
the third item of an ordered list.
+

This is a compact ordered list: +

+5.
The first item of an ordered list, +
+6.
the second item of an ordered list, +
+7.
the third item of an ordered list.
+

This is a compact ordered list using hash enumerators: +

+1.
The first item of an ordered list, +
+2.
the second item of an ordered list, +
+3.
the third item of an ordered list.
+

This is a compact fancy ordered list using hash enumerators: +

+1.
The first item of an ordered list, +
+2.
the second item of an ordered list, +
+3.
the third item of an ordered list.
+

This is a task list: +

+ +

This is a definition list: +

+

+Term 1

+

Definition 1 with some removed text +

+

+Term 2

+

Definition 2 +

+
+Some code, part of Definition 2
+
+

Third paragraph of Definition 2. +

Definition 3 +

+
+

This is a compact definition list: +

+Term 1
Definition 1 +
+Term 2
Definition 2 +

Definition 3 +

+
+

This is a superscript and a subscript. +

This is a block quote: +

+

This is the first level of quoting. +

+

This is nested blockquote.

+

Back to the first level.

+ +

Here is a note reference2 +and another.3 Here +is an inline note.4 +

This is raw TeX code: +

+

+
+xn + yn = zn
+
+

Here are some non-ASCII characters: ěščřžýáíé. +

Here is some HTML code mixed with Markdown. In TeX, the HTML code will be +silently ignored, whereas in TeX4ht, the HTML code will be passed through to the +output: +

+ + + + + + + + + + +
EmilTobiasLinus
161410
+

1Google: http://google.cz

+

2Here is the note.

3Here’s one with multiple blocks. +

Subsequent paragraphs are indented to show that they belong to the previous note. +

+
+Some code
+  
+

The whole paragraph can be indented, or just the first line. In this way, multi-paragraph notes +work like multi-paragraph list items.

+

4Inlines notes are easier to write, since you don’t have to pick an identifier and move down to +type the note.

+

1Google: http://google.cz

+

2Here is the note.

3Here’s one with multiple blocks. +

Subsequent paragraphs are indented to show that they belong to the previous note. +

+
+Some code
+  
+

The whole paragraph can be indented, or just the first line. In this way, multi-paragraph notes +work like multi-paragraph list items.

+

4Inlines notes are easier to write, since you don’t have to pick an identifier and move down to +type the note.

+ + + \ No newline at end of file diff --git a/macros/generic/markdown/examples/latex-xetex.pdf b/macros/generic/markdown/examples/latex-xetex.pdf new file mode 100644 index 0000000000..cfbebde5e3 Binary files /dev/null and b/macros/generic/markdown/examples/latex-xetex.pdf differ diff --git a/macros/generic/markdown/examples/latex.tex b/macros/generic/markdown/examples/latex.tex index 2403caf1e9..c14bc4bd47 100644 --- a/macros/generic/markdown/examples/latex.tex +++ b/macros/generic/markdown/examples/latex.tex @@ -16,22 +16,23 @@ \fi\fi \usepackage{booktabs} \usepackage[ - hashEnumerators, + contentBlocks, debugExtensions, definitionLists, - footnotes, - inlineFootnotes, - jekyllData, - smartEllipses, + fancy_lists, fencedCode, - contentBlocks, + hashEnumerators, + inlineNotes, + jekyllData, + notes, pipeTables, - tableCaptions, - taskLists, + rawAttribute, + smartEllipses, strikeThrough, - superscripts, subscripts, - fancyLists, + superscripts, + tableCaptions, + taskLists, ]{markdown} \begin{markdown*}{hybrid} --- diff --git a/macros/generic/markdown/latexmkrc b/macros/generic/markdown/latexmkrc new file mode 100644 index 0000000000..a9b6a23ef6 --- /dev/null +++ b/macros/generic/markdown/latexmkrc @@ -0,0 +1,5 @@ +$pdflatex = 'lualatex --shell-escape %O %S'; +$makeindex = 'makeindex -s %R.ist %O -o %D %S'; +$pdf_mode = 1; +$postscript_mode = 0; +$dvi_mode = 0; diff --git a/macros/generic/markdown/markdown.dtx b/macros/generic/markdown/markdown.dtx index 2e3e12e15d..b165924476 100644 --- a/macros/generic/markdown/markdown.dtx +++ b/macros/generic/markdown/markdown.dtx @@ -79,11 +79,11 @@ citations, definitionLists, fencedCode, - footnotes, + notes, headerAttributes, html, hybrid, - inlineFootnotes, + inlineNotes, jekyllData, relativeReferences, stripPercentSigns, @@ -109,14 +109,14 @@ % Set up the catcodes. \catcode`\_=12 % We won't be typesetting much math and Lua contains lots of `_`. -\catcode`\^^B=8 % When we occasionally need subscripts , we will use `^^B` (STX). +\catcode`\^^B=8 % When we occasionally need subscripts, we will use `^^B` (STX). % Set up the title page. \begin{markdown} --- title: A Markdown Interpreter for \TeX url: https://github.com/witiko/markdown -author: Vít Novotný +authors: [Vít Novotný] email: witiko@mail.muni.cz revision: \markdownVersion date: \markdownLastModified @@ -709,6 +709,13 @@ abbr { version = {v2.5}, url = {https://mirrors.ctan.org/macros/latex/contrib/minted/minted.pdf}, urldate = {2020-09-01}} +@online{macfarlane22, + title = {Pandoc}, + subtitle = {a universal document converter}, + author = {John MacFarlane}, + year = {2022}, + url = {https://pandoc.org/}, + urldate = {2022-10-05}} @online{novotny15, author = {Novotný, Vít}, year = {2015}, @@ -759,9 +766,16 @@ abbr { subtitle = {A \TeX nician's Reference}, isbn = {0-201-56882-0}, pagetotal = {307}, - date = {1992-02-01}, - location = {Wokingham, England}, + date = {1992-02-01}, + location = {Wokingham, England}, publisher = {Addison-Wesley}} +@inproceedings{sharif10, + author = {Sharif, Bonita and Maletic, Jonathan I.}, + booktitle = {2010 IEEE 18th International Conference on Program Comprehension}, + title = {An Eye Tracking Study on camelCase and under\_score Identifier Styles}, + year = {2010}, + pages = {196-205}, + doi = {10.1109/ICPC.2010.41}} % %<*latex-themes-witiko-markdown-techdoc> \ProvidesPackage{markdownthemewitiko_markdown_techdoc}[2022/02/23] @@ -807,7 +821,7 @@ abbr { }, }, jekyllDataRenderers = { - author = {% + /authors/* = {% \gdef\ltd@title@author{#1}% \hypersetup{pdfauthor={#1}}% }, @@ -963,15 +977,15 @@ make base `````` This should produce the following files: - * `markdown.lua`, the Lua module, - * `libraries/markdown-tinyyaml.lua`, an external library for reading \acro{yaml}, - * `markdown-cli.lua`, the Lua command-line interface, - * `markdown.tex`, the plain \TeX{} macro package, - * `markdown.sty`, the \LaTeX{} package, - * `markdownthemewitiko_dot.sty`, the `witiko/dot` \LaTeX{} theme, - * `markdownthemewitiko_graphicx_http.sty`, the `witiko/graphicx/http` \LaTeX{} theme, - * `markdownthemewitiko_tilde.sty`, the `witiko/tilde` \LaTeX{} theme, and - * `t-markdown.tex`, the \Hologo{ConTeXt} module. +* `markdown.lua`, the Lua module, +* `libraries/markdown-tinyyaml.lua`, an external library for reading \acro{yaml}, +* `markdown-cli.lua`, the Lua command-line interface, +* `markdown.tex`, the plain \TeX{} macro package, +* `markdown.sty`, the \LaTeX{} package, +* `markdownthemewitiko_dot.sty`, the `witiko/dot` \LaTeX{} theme, +* `markdownthemewitiko_graphicx_http.sty`, the `witiko/graphicx/http` \LaTeX{} theme, +* `markdownthemewitiko_tilde.sty`, the `witiko/tilde` \LaTeX{} theme, and +* `t-markdown.tex`, the \Hologo{ConTeXt} module. ### Local Installation @@ -979,15 +993,15 @@ To perform a local installation, place the above files into your \TeX{} directory structure. This is generally where the individual files should be placed: - * `⟨TEXMF⟩/tex/luatex/markdown/markdown.lua` - * `⟨TEXMF⟩/tex/luatex/markdown/markdown-tinyyaml.lua` - * `⟨TEXMF⟩/scripts/markdown/markdown-cli.lua` - * `⟨TEXMF⟩/tex/generic/markdown/markdown.tex` - * `⟨TEXMF⟩/tex/latex/markdown/markdown.sty` - * `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_dot.sty` - * `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty` - * `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_tilde.sty` - * `⟨TEXMF⟩/tex/context/third/markdown/t-markdown.tex` +* `⟨TEXMF⟩/tex/luatex/markdown/markdown.lua` +* `⟨TEXMF⟩/tex/luatex/markdown/markdown-tinyyaml.lua` +* `⟨TEXMF⟩/scripts/markdown/markdown-cli.lua` +* `⟨TEXMF⟩/tex/generic/markdown/markdown.tex` +* `⟨TEXMF⟩/tex/latex/markdown/markdown.sty` +* `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_dot.sty` +* `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty` +* `⟨TEXMF⟩/tex/latex/markdown/markdownthemewitiko_tilde.sty` +* `⟨TEXMF⟩/tex/context/third/markdown/t-markdown.tex` where `⟨TEXMF⟩` corresponds to a root of your \TeX{} distribution, such as `/usr/share/texmf` and `~/texmf` on UN\*X systems or @@ -1039,7 +1053,7 @@ local lpeg = require("lpeg") % \pkg{Selene Unicode} % %: A library that provides support for the processing of wide strings. It is -% used by the \pkg{Lunamark} library to cast image, link, and footnote tags +% used by the \pkg{Lunamark} library to cast image, link, and note tags % to the lower case. \pkg{Selene Unicode} is included in all releases of % Lua\TeX{} (\TeX Live${}\geq{}2008$). % @@ -1206,7 +1220,7 @@ local md5 = require("md5") % %: A package that provides a concise syntax for the inspection of macro % values. It is used in the `witiko/dot` \LaTeX{} theme (see Section -% <#sec:latexthemes>), and to provide default token renderer prototypes. +% <#sec:latexthemes>). % % \pkg{fancyvrb} % @@ -1620,7 +1634,7 @@ local walkable_syntax = { Block = { "Blockquote", "Verbatim", - "HorizontalRule", + "ThematicBreak", "BulletList", "OrderedList", "Heading", @@ -1888,7 +1902,7 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces. \prop_new:N \g_@@_default_lua_options_prop \seq_new:N \g_@@_option_layers_seq \tl_const:Nn \c_@@_option_layer_lua_tl { lua } -\seq_put_right:NV \g_@@_option_layers_seq \c_@@_option_layer_lua_tl +\seq_gput_right:NV \g_@@_option_layers_seq \c_@@_option_layer_lua_tl \cs_new:Nn \@@_add_lua_option:nnn { @@ -1901,14 +1915,14 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces. \cs_new:Nn \@@_add_option:nnnn { - \seq_put_right:cn + \seq_gput_right:cn { g_@@_ #1 _options_seq } { #2 } - \prop_put:cnn + \prop_gput:cnn { g_@@_ #1 _option_types_prop } { #2 } { #3 } - \prop_put:cnn + \prop_gput:cnn { g_@@_default_ #1 _options_prop } { #2 } { #4 } @@ -1967,19 +1981,19 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces. { nnnV } \seq_new:N \g_@@_option_types_seq \tl_const:Nn \c_@@_option_type_clist_tl { clist } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_clist_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_clist_tl \tl_const:Nn \c_@@_option_type_counter_tl { counter } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_counter_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_counter_tl \tl_const:Nn \c_@@_option_type_boolean_tl { boolean } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_boolean_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_boolean_tl \tl_const:Nn \c_@@_option_type_number_tl { number } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_number_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_number_tl \tl_const:Nn \c_@@_option_type_path_tl { path } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_path_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_path_tl \tl_const:Nn \c_@@_option_type_slice_tl { slice } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_slice_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_slice_tl \tl_const:Nn \c_@@_option_type_string_tl { string } -\seq_put_right:NV \g_@@_option_types_seq \c_@@_option_type_string_tl +\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_string_tl \cs_new:Nn \@@_get_option_type:nN { @@ -2110,6 +2124,49 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces. \tl_tail:n { #1 } } } +\seq_new:N \g_@@_cases_seq +\cs_new:Nn \@@_with_various_cases:nn + { + \seq_clear:N + \l_tmpa_seq + \seq_map_inline:Nn + \g_@@_cases_seq + { + \tl_set:Nn + \l_tmpa_tl + { #1 } + \use:c { ##1 } + \l_tmpa_tl + \seq_put_right:NV + \l_tmpa_seq + \l_tmpa_tl + } + \seq_map_inline:Nn + \l_tmpa_seq + { #2 } + } +\cs_new:Nn \@@_camel_case:N + { + \regex_replace_all:nnN + { _ ([a-z]) } + { \c { str_uppercase:n } \cB\{ \1 \cE\} } + #1 + \tl_set:Nx + #1 + { #1 } + } +\seq_gput_right:Nn \g_@@_cases_seq { @@_camel_case:N } +\cs_new:Nn \@@_snake_case:N + { + \regex_replace_all:nnN + { ([a-z])([A-Z]) } + { \1 _ \c { str_lowercase:n } \cB\{ \2 \cE\} } + #1 + \tl_set:Nx + #1 + { #1 } + } +\seq_gput_right:Nn \g_@@_cases_seq { @@_snake_case:N } % \end{macrocode} % \iffalse % @@ -2461,13 +2518,13 @@ defaultOptions.contentBlocksLanguageMap = "markdown-languages.json" extensible subset of the \acro{peg} grammar of markdown % (see the \luamref{walkable_syntax} hash table) after built-in syntax extensions -% (see Section <#luabuiltinextensions>) +% (see Section <#sec:luabuiltinextensions>) % \iffalse (see options \Opt{citations}, \Opt{contentBlocks}, \Opt{definitionLists}, etc.) % \fi and user-defined syntax extensions -% (see Section <#luauserextensions>) +% (see Section <#sec:luauserextensions>) % \iffalse (see option \Opt{extensions}) % \fi @@ -3730,7 +3787,7 @@ following text, where the middot (`·`) denotes a non-breaking space: > > ### References > [1] Donald·Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._ -> Addison-Wesley, 1984. +> Addison-Wesley, 1984. % %<*tex> @@ -3831,7 +3888,7 @@ following text: > > ### References > [1] Donald Ervin Knuth. _The \TeX{}book, volume A of Computers and typesetting._ -> Addison-Wesley, 1984. +> Addison-Wesley, 1984. % %<*tex> @@ -4257,23 +4314,23 @@ defaultOptions.contentBlocks = false % : true - : Produce a \acro{JSON} file that will contain the - extensible subset of the \acro{peg} grammar of markdown -% (see the \luamref{walkable_syntax} hash table) - after built-in syntax extensions -% (see Section <#luabuiltinextensions>) -% \iffalse - (see options \Opt{citations}, \Opt{contentBlocks}, - \Opt{definitionLists}, etc.) -% \fi - and user-defined syntax extensions -% (see Section <#luauserextensions>) -% \iffalse - (see option \Opt{extensions}) -% \fi - have been applied. This helps you to see how the different - extensions interact. The name of the produced \acro{JSON} file is - controlled by the \Opt{debugExtensionsFileName} option. + : Produce a \acro{JSON} file that will contain the + extensible subset of the \acro{peg} grammar of markdown +% (see the \luamref{walkable_syntax} hash table) + after built-in syntax extensions +% (see Section <#sec:luabuiltinextensions>) +% \iffalse + (see options \Opt{citations}, \Opt{contentBlocks}, + \Opt{definitionLists}, etc.) +% \fi + and user-defined syntax extensions +% (see Section <#sec:luauserextensions>) +% \iffalse + (see option \Opt{extensions}) +% \fi + have been applied. This helps you to see how the different + extensions interact. The name of the produced \acro{JSON} file is + controlled by the \Opt{debugExtensionsFileName} option. : false @@ -4290,7 +4347,7 @@ following content: ``` lua local strike_through = { api_version = 2, - grammar_version = 1, + grammar_version = 2, finalize_grammar = function(reader) local nonspacechar = lpeg.P(1) - lpeg.S("\t ") local doubleslashes = lpeg.P("//") @@ -4342,7 +4399,7 @@ be produced and contain the following text: "Block": [ "Blockquote", "Verbatim", - "HorizontalRule", + "ThematicBreak", "BulletList", "OrderedList", "Heading", @@ -4656,7 +4713,7 @@ defaultOptions.eagerCache = true % ``` lua % local strike_through = { % api_version = 2, -% grammar_version = 1, +% grammar_version = 2, % finalize_grammar = function(reader) % local nonspacechar = lpeg.P(1) - lpeg.S("\t ") % local doubleslashes = lpeg.P("//") @@ -4691,7 +4748,7 @@ defaultOptions.eagerCache = true % \fi % \begin{macrocode} metadata.user_extension_api_version = 2 -metadata.grammar_version = 1 +metadata.grammar_version = 2 % \end{macrocode} % \iffalse % @@ -4721,7 +4778,7 @@ following content: ``` lua local strike_through = { api_version = 2, - grammar_version = 1, + grammar_version = 2, finalize_grammar = function(reader) local nonspacechar = lpeg.P(1) - lpeg.S("\t ") local doubleslashes = lpeg.P("//") @@ -5087,11 +5144,11 @@ lualatex --shell-escape document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> ~~~ js +> ``` js > if (a > 3) { > moveShip(5 * gravity, DOWN); > } -> ~~~~~~ +> ``` > > ``` html >
@@ -5142,11 +5199,11 @@ context document.tex
 A PDF document named `document.pdf` should be produced and contain the
 following text:
 
-> ~~~ js
+> ``` js
 > if (a > 3) {
 >     moveShip(5 * gravity, DOWN);
 > }
-> ~~~~~~
+> ```
 > 
 > ``` html
 > 
@@ -5344,33 +5401,33 @@ defaultOptions.finalizeCache = false
 %
 %<*manual-options>
 
-#### Option `footnotes`
+#### Option `notes`
 
-`footnotes` (default value: `false`)
+`notes` (default value: `false`)
 
 % \fi
 % \begin{markdown}
 %
-% \Optitem[false]{footnotes}{\opt{true}, \opt{false}}
+% \Optitem[false]{notes}{\opt{true}, \opt{false}}
 %
 :    true
 
-     :  Enable the Pandoc footnote syntax extension:
+     :  Enable the Pandoc note syntax extension:
 
         ``` md
-        Here is a footnote reference,[^1] and another.[^longnote]
+        Here is a note reference,[^1] and another.[^longnote]
 
-        [^1]: Here is the footnote.
+        [^1]: Here is the note.
 
         [^longnote]: Here's one with multiple blocks.
 
             Subsequent paragraphs are indented to show that they
-        belong to the previous footnote.
+        belong to the previous note.
 
                 { some.code }
 
             The whole paragraph can be indented, or just the
-            first line.  In this way, multi-paragraph footnotes
+            first line.  In this way, multi-paragraph notes
             work like multi-paragraph list items.
 
         This paragraph won't be part of the note, because it
@@ -5379,7 +5436,7 @@ defaultOptions.finalizeCache = false
 
 :    false
 
-     :    Disable the Pandoc footnote syntax extension.
+     :    Disable the Pandoc note syntax extension.
 
 % \end{markdown}
 % \iffalse
@@ -5390,22 +5447,22 @@ Using a text editor, create a text document named `document.tex` with the
 following content:
 ``` tex
 \documentclass{article}
-\usepackage[footnotes]{markdown}
+\usepackage[notes]{markdown}
 \begin{document}
 \begin{markdown}
-Here is a footnote reference,[^1] and another.[^longnote]
+Here is a note reference,[^1] and another.[^longnote]
 
-[^1]: Here is the footnote.
+[^1]: Here is the note.
 
 [^longnote]: Here's one with multiple blocks.
 
     Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
+belong to the previous note.
 
         { some.code }
 
     The whole paragraph can be indented, or just the
-    first line.  In this way, multi-paragraph footnotes
+    first line.  In this way, multi-paragraph notes
     work like multi-paragraph list items.
 
 This paragraph won't be part of the note, because it
@@ -5420,19 +5477,19 @@ lualatex document.tex
 A PDF document named `document.pdf` should be produced and contain the
 following text:
 
-> Here is a footnote reference,[^1] and another.[^longnote]
+> Here is a note reference,[^1] and another.[^longnote]
 > 
-> [^1]: Here is the footnote.
+> [^1]: Here is the note.
 > 
 > [^longnote]: Here's one with multiple blocks.
 > 
 >     Subsequent paragraphs are indented to show that they
-> belong to the previous footnote.
+> belong to the previous note.
 > 
 >         { some.code }
 > 
 >     The whole paragraph can be indented, or just the
->     first line.  In this way, multi-paragraph footnotes
+>     first line.  In this way, multi-paragraph notes
 >     work like multi-paragraph list items.
 > 
 > This paragraph won't be part of the note, because it
@@ -5444,22 +5501,22 @@ Using a text editor, create a text document named `document.tex` with the
 following content:
 ``` tex
 \usemodule[t][markdown]
-\setupmarkdown[footnotes = yes]
+\setupmarkdown[notes = yes]
 \starttext
 \startmarkdown
-Here is a footnote reference,[^1] and another.[^longnote]
+Here is a note reference,[^1] and another.[^longnote]
 
-[^1]: Here is the footnote.
+[^1]: Here is the note.
 
 [^longnote]: Here's one with multiple blocks.
 
     Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
+belong to the previous note.
 
         { some.code }
 
     The whole paragraph can be indented, or just the
-    first line.  In this way, multi-paragraph footnotes
+    first line.  In this way, multi-paragraph notes
     work like multi-paragraph list items.
 
 This paragraph won't be part of the note, because it
@@ -5474,19 +5531,19 @@ context document.tex
 A PDF document named `document.pdf` should be produced and contain the
 following text:
 
-> Here is a footnote reference,[^1] and another.[^longnote]
+> Here is a note reference,[^1] and another.[^longnote]
 > 
-> [^1]: Here is the footnote.
+> [^1]: Here is the note.
 > 
 > [^longnote]: Here's one with multiple blocks.
 > 
 >     Subsequent paragraphs are indented to show that they
-> belong to the previous footnote.
+> belong to the previous note.
 > 
 >         { some.code }
 > 
 >     The whole paragraph can be indented, or just the
->     first line.  In this way, multi-paragraph footnotes
+>     first line.  In this way, multi-paragraph notes
 >     work like multi-paragraph list items.
 > 
 > This paragraph won't be part of the note, because it
@@ -5495,11 +5552,21 @@ following text:
 %
 %<*tex>
 % \fi
+% \begin{markdown}
+%
+% The footnotes option has been deprecated and will be removed in
+% Markdown 3.0.0.
+%
+% \end{markdown}
 %  \begin{macrocode}
 \@@_add_lua_option:nnn
   { footnotes }
   { boolean }
   { false }
+\@@_add_lua_option:nnn
+  { notes }
+  { boolean }
+  { false }
 %    \end{macrocode}
 % \iffalse
 %
@@ -5507,6 +5574,7 @@ following text:
 % \fi
 %  \begin{macrocode}
 defaultOptions.footnotes = false
+defaultOptions.notes = false
 %    \end{macrocode}
 % \par
 % \iffalse
@@ -6321,18 +6389,18 @@ defaultOptions.hybrid = false
 %
 %<*manual-options>
 
-#### Option `inlineFootnotes`
+#### Option `inlineNotes`
 
-`inlineFootnotes` (default value: `false`)
+`inlineNotes` (default value: `false`)
 
 % \fi
 % \begin{markdown}
 %
-% \Optitem[false]{inlineFootnotes}{\opt{true}, \opt{false}}
+% \Optitem[false]{inlineNotes}{\opt{true}, \opt{false}}
 %
 :    true
 
-     :  Enable the Pandoc inline footnote syntax extension:
+     :  Enable the Pandoc inline note syntax extension:
 
         ``` md
         Here is an inline note.^[Inlines notes are easier to
@@ -6342,7 +6410,7 @@ defaultOptions.hybrid = false
 
 :    false
 
-     :  Disable the Pandoc inline footnote syntax extension.
+     :  Disable the Pandoc inline note syntax extension.
 
 % \end{markdown}
 % \iffalse
@@ -6353,7 +6421,7 @@ Using a text editor, create a text document named `document.tex` with the
 following content:
 ``` tex
 \documentclass{article}
-\usepackage[inlineFootnotes]{markdown}
+\usepackage[inlineNotes]{markdown}
 \begin{document}
 \begin{markdown}
 Here is an inline note.^[Inlines notes are easier to
@@ -6379,7 +6447,7 @@ Using a text editor, create a text document named `document.tex` with the
 following content:
 ``` tex
 \usemodule[t][markdown]
-\setupmarkdown[inlineFootnotes = yes]
+\setupmarkdown[inlineNotes = yes]
 \starttext
 \startmarkdown
 Here is an inline note.^[Inlines notes are easier to
@@ -6402,11 +6470,21 @@ following text:
 %
 %<*tex>
 % \fi
+% \begin{markdown}
+%
+% The inlineFootnotes option has been deprecated and will be removed in
+% Markdown 3.0.0.
+%
+% \end{markdown}
 %  \begin{macrocode}
 \@@_add_lua_option:nnn
   { inlineFootnotes }
   { boolean }
   { false }
+\@@_add_lua_option:nnn
+  { inlineNotes }
+  { boolean }
+  { false }
 %    \end{macrocode}
 % \iffalse
 %
@@ -6414,6 +6492,7 @@ following text:
 % \fi
 %  \begin{macrocode}
 defaultOptions.inlineFootnotes = false
+defaultOptions.inlineNotes = false
 %    \end{macrocode}
 % \par
 % \iffalse
@@ -6733,6 +6812,97 @@ defaultOptions.preserveTabs = false
 %
 %<*manual-options>
 
+#### Option `rawAttribute`
+
+`rawAttribute` (default value: `false`)
+
+% \fi
+% \begin{markdown}
+%
+% \Optitem[false]{rawAttribute}{\opt{true}, \opt{false}}
+%
+:    true
+
+     :  Enable the Pandoc raw attribute syntax extension:
+
+        ``` md
+        `$H_2 O$`{=tex} is a liquid.
+        ```
+
+        To enable raw blocks, the \Opt{fencedCode} option must also be enabled:
+
+        ~~~~~~~~ md
+        Here is a mathematical formula:
+        ``` {=tex}
+        \[distance[i] =
+            \begin{dcases}
+                a & b \\
+                c & d
+            \end{dcases}
+        \]
+        ```
+        ~~~~~~~~~~~
+
+        The \Opt{rawAttribute} option is a good alternative to the \Opt{hybrid}
+        option. Unlike the \Opt{hybrid} option, which affects the entire
+        document, the \Opt{rawAttribute} option allows you to isolate the parts
+        of your documents that use TeX:
+
+:    false
+
+     :  Disable the Pandoc raw attribute syntax extension.
+
+% \end{markdown}
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+```` tex
+\documentclass{article}
+\usepackage[rawAttribute, fencedCode]{markdown}
+\usepackage{expl3}
+\begin{document}
+\begin{markdown}
+`$H_2 O$`{=tex} is a liquid.
+
+``` {=html}
+

Here is some HTML content that will be ignored.

+``` +\end{markdown} +\end{document} +```````` +Next, invoke LuaTeX from the terminal: +``` sh +lualatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the +following text: + +> H~2~O is a liquid. + +% +%<*tex> +% \fi +% \begin{macrocode} +\@@_add_lua_option:nnn + { rawAttribute } + { boolean } + { false } +% \end{macrocode} +% \iffalse +% +%<*lua,lua-cli> +% \fi +% \begin{macrocode} +defaultOptions.rawAttribute = true +% \end{macrocode} +% \par +% \iffalse +% +%<*manual-options> + #### Option `relativeReferences` `relativeReferences` (default value: `false`) @@ -7977,7 +8147,7 @@ following content: | 123 | 123 | 123 | 123 | | 1 | 1 | 1 | 1 | - : Demonstration of pipe table syntax. +: Demonstration of pipe table syntax. \end{markdown} \end{document} ``````` @@ -7994,7 +8164,7 @@ following text: > | 123 | 123 | 123 | 123 | > | 1 | 1 | 1 | 1 | > -> : Demonstration of pipe table syntax. +> : Demonstration of pipe table syntax. ##### \Hologo{ConTeXt} Example {.unnumbered} @@ -8015,7 +8185,7 @@ following content: | 123 | 123 | 123 | 123 | | 1 | 1 | 1 | 1 | - : Demonstration of pipe table syntax. +: Demonstration of pipe table syntax. \stopmarkdown \stoptext ```````` @@ -8032,7 +8202,7 @@ following text: > | 123 | 123 | 123 | 123 | > | 1 | 1 | 1 | 1 | > -> : Demonstration of pipe table syntax. +> : Demonstration of pipe table syntax. % %<*tex> @@ -8330,25 +8500,25 @@ following content: \begin{markdown} The following list is tight: - - first item - - second item - - third item +- first item +- second item +- third item The following list is loose: - - first item - - second item that spans +- first item +- second item that spans - multiple paragraphs - - third item + multiple paragraphs +- third item \end{markdown} \begin{markdown*}{tightLists=false} The following list is now also loose: - - first item - - second item - - third item +- first item +- second item +- third item \end{markdown*} \end{document} @@ -8362,25 +8532,25 @@ following text: > The following list is tight: > -> - first item -> - second item -> - third item +> - first item +> - second item +> - third item > > The following list is loose: > -> - first item -> - second item that spans +> - first item +> - second item that spans > -> multiple paragraphs -> - third item +> multiple paragraphs +> - third item > > The following list is now also loose: > -> - first item +> - first item > -> - second item +> - second item > -> - third item +> - third item % %<*tex> @@ -8633,7 +8803,40 @@ local function warn(s) local function error(s) io.stderr:write("Error: " .. s .. "\n") - os.exit(1) end + os.exit(1) +end +% \end{macrocode} +% \begin{markdown} +% +% To make it easier to copy-and-paste options from Pandoc [@macfarlane22] such +% as `fancy_lists`, `header_attributes`, and `pipe_tables`, we accept +% snake\\\_case in addition to camelCase variants of options. As a bonus, +% studies [@sharif10] also show that snake\\\_case is faster to read than +% camelCase. +% +% \end{markdown} +% \begin{macrocode} +local function camel_case(option_name) + local cased_option_name = option_name:gsub("_(%l)", function(match) + return match:sub(2, 2):upper() + end) + return cased_option_name +end + +local function snake_case(option_name) + local cased_option_name = option_name:gsub("%l%u", function(match) + return match:sub(1, 1) .. "_" .. match:sub(2, 2):lower() + end) + return cased_option_name +end + +local cases = {camel_case, snake_case} +local various_case_options = {} +for option_name, _ in pairs(defaultOptions) do + for _, case in ipairs(cases) do + various_case_options[case(option_name)] = option_name + end +end local process_options = true local options = {} @@ -8662,10 +8865,13 @@ for i = 1, #arg do % \begin{macrocode} elseif arg[i]:match("=") then local key, value = arg[i]:match("(.-)=(.*)") + if defaultOptions[key] == nil then + key = various_case_options[key] + end % \end{macrocode} % \begin{markdown} % The \luamref{defaultOptions} table is consulted to identify whether \meta{value} -% should be parsed as a string or as a boolean. +% should be parsed as a string, number, table, or boolean. % \end{markdown} % \begin{macrocode} local default_type = type(defaultOptions[key]) @@ -8840,8 +9046,8 @@ pdftex --shell-escape document.tex % %### Typesetting Markdown {#textypesetting} % -% The interface exposes the \mdef{markdownBegin}, \mdef{markdownEnd}, and -% \mdef{markdownInput} macros. +% The interface exposes the \mdef{markdownBegin}, \mdef{markdownEnd}, +% \mdef{markdownInput}, and \mdef{markdownEscape} macros. % % The \mref{markdownBegin} macro marks the beginning of a markdown document % fragment and the \mref{markdownEnd} macro marks its end. @@ -8899,9 +9105,9 @@ pdftex --shell-escape document.tex % \bye % ``````` % -% The \mref{markdownInput} macro accepts a single parameter containing the -% filename of a markdown document and expands to the result of the conversion -% of the input markdown document to plain \TeX{}. +% The \mref{markdownInput} macro accepts a single parameter with the filename +% of a markdown document and expands to the result of the conversion of the +% input markdown document to plain \TeX{}. % % \end{markdown} % \begin{macrocode} @@ -8922,6 +9128,19 @@ pdftex --shell-escape document.tex % \bye % ``````` % +% The \mref{markdownEscape} macro accepts a single parameter with the filename +% of a \TeX{} document and executes the \TeX{} document in the middle of a +% markdown document fragment. Unlike the `\input` built-in of \TeX, +% \mref{markdownEscape} guarantees that the standard catcode regime of your +% \TeX{} format will be used. +% +% \end{markdown} +% \begin{macrocode} +\let\markdownEscape\relax +% \end{macrocode} +% \par +% \begin{markdown} +% %### Options {#texoptions} % % The plain \TeX{} options are represented by \TeX{} commands. Some of them map @@ -8948,7 +9167,7 @@ pdftex --shell-escape document.tex \prop_new:N \g_@@_plain_tex_option_types_prop \prop_new:N \g_@@_default_plain_tex_options_prop \tl_const:Nn \c_@@_option_layer_plain_tex_tl { plain_tex } -\seq_put_right:NV \g_@@_option_layers_seq \c_@@_option_layer_plain_tex_tl +\seq_gput_right:NV \g_@@_option_layers_seq \c_@@_option_layer_plain_tex_tl \cs_new:Nn \@@_add_plain_tex_option:nnn { @@ -9400,14 +9619,14 @@ A PDF document named `document.pdf` should be produced and contain the text % % \end{markdown} % \begin{macrocode} -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_plain_tex_options_seq { stripPercentSigns } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_plain_tex_option_types_prop { stripPercentSigns } { boolean } -\prop_put:Nnx +\prop_gput:Nnx \g_@@_default_plain_tex_options_prop { stripPercentSigns } { false } @@ -9553,10 +9772,10 @@ following text: \def\markdownRendererTickedBox{% \markdownRendererTickedBoxPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { tickedBox } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { tickedBox } { 0 } @@ -9564,10 +9783,10 @@ following text: \def\markdownRendererHalfTickedBox{% \markdownRendererHalfTickedBoxPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { halfTickedBox } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { halfTickedBox } { 0 } @@ -9575,10 +9794,10 @@ following text: \def\markdownRendererUntickedBox{% \markdownRendererUntickedBoxPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { untickedBox } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { untickedBox } { 0 } @@ -9717,10 +9936,10 @@ following text: \def\markdownRendererDocumentBegin{% \markdownRendererDocumentBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { documentBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { documentBegin } { 0 } @@ -9728,10 +9947,10 @@ following text: \def\markdownRendererDocumentEnd{% \markdownRendererDocumentEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { documentEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { documentEnd } { 0 } @@ -9862,10 +10081,10 @@ following text: \def\markdownRendererInterblockSeparator{% \markdownRendererInterblockSeparatorPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { interblockSeparator } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { interblockSeparator } { 0 } @@ -10008,10 +10227,10 @@ following text: \def\markdownRendererLineBreak{% \markdownRendererLineBreakPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { lineBreak } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { lineBreak } { 0 } @@ -10119,10 +10338,10 @@ following text: \def\markdownRendererEllipsis{% \markdownRendererEllipsisPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ellipsis } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ellipsis } { 0 } @@ -10194,7 +10413,7 @@ following text: > > ### References > [1] Donald Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._ -> Addison-Wesley, 1984. +> Addison-Wesley, 1984. % %<*tex> @@ -10204,10 +10423,10 @@ following text: \def\markdownRendererNbsp{% \markdownRendererNbspPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { nbsp } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { nbsp } { 0 } @@ -10329,10 +10548,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererLeftBrace{% \markdownRendererLeftBracePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { leftBrace } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { leftBrace } { 0 } @@ -10340,10 +10559,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererRightBrace{% \markdownRendererRightBracePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { rightBrace } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { rightBrace } { 0 } @@ -10351,10 +10570,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererDollarSign{% \markdownRendererDollarSignPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dollarSign } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dollarSign } { 0 } @@ -10362,10 +10581,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererPercentSign{% \markdownRendererPercentSignPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { percentSign } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { percentSign } { 0 } @@ -10373,10 +10592,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererAmpersand{% \markdownRendererAmpersandPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ampersand } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ampersand } { 0 } @@ -10384,10 +10603,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererUnderscore{% \markdownRendererUnderscorePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { underscore } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { underscore } { 0 } @@ -10395,10 +10614,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererHash{% \markdownRendererHashPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { hash } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { hash } { 0 } @@ -10406,10 +10625,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererCircumflex{% \markdownRendererCircumflexPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { circumflex } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { circumflex } { 0 } @@ -10417,10 +10636,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererBackslash{% \markdownRendererBackslashPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { backslash } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { backslash } { 0 } @@ -10428,10 +10647,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererTilde{% \markdownRendererTildePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { tilde } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { tilde } { 0 } @@ -10439,10 +10658,10 @@ following text, where the middot (`·`) denotes a non-breaking space: \def\markdownRendererPipe{% \markdownRendererPipePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { pipe } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { pipe } { 0 } @@ -10458,8 +10677,8 @@ following text, where the middot (`·`) denotes a non-breaking space: % \begin{markdown} #### Code Span Renderer -The \mdef{markdownRendererCodeSpan} macro represents inlined code span in the -input text. It receives a single argument that corresponds to the inlined +The \mdef{markdownRendererCodeSpan} macro represents inline code span in the +input text. It receives a single argument that corresponds to the inline code span. % \end{markdown} @@ -10584,10 +10803,10 @@ following text: \def\markdownRendererCodeSpan{% \markdownRendererCodeSpanPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { codeSpan } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { codeSpan } { 1 } @@ -10708,10 +10927,10 @@ following text: \def\markdownRendererLink{% \markdownRendererLinkPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { link } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { link } { 4 } @@ -10788,7 +11007,7 @@ Bourne or Bourne again shell as the default shell of the current user. It also assumes that the `md5sum`, `wget`, and `convert` binaries are installed and that the \TeX{} engine has shell access. -> ![](https://tug.org/tugboat/noword.jpg "The Communications of the TeX Users Group") +> ![TUGboat](https://tug.org/tugboat/noword.jpg "The Communications of the TeX Users Group") % %<*tex> @@ -10798,10 +11017,10 @@ that the \TeX{} engine has shell access. \def\markdownRendererImage{% \markdownRendererImagePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { image } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { image } { 4 } @@ -10835,10 +11054,10 @@ and the title of the content block. \def\markdownRendererContentBlock{% \markdownRendererContentBlockPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { contentBlock } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { contentBlock } { 4 } @@ -10868,10 +11087,10 @@ as \mref{markdownRendererContentBlock}. \def\markdownRendererContentBlockOnlineImage{% \markdownRendererContentBlockOnlineImagePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { contentBlockOnlineImage } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { contentBlockOnlineImage } { 4 } @@ -10889,8 +11108,8 @@ as \mref{markdownRendererContentBlock}. The \mdef{markdownRendererContentBlockCode} macro represents an iA\,Writer content block that was recognized as a file in a known programming language by its filename extension $s$. If any `markdown-languages.json` file found -by \pkg{kpathsea}\footnote{Filenames other than `markdown-languages.json` may -be specified using the `contentBlocksLanguageMap` Lua option.} contains a +by \pkg{kpathsea}^[Filenames other than `markdown-languages.json` may +be specified using the `contentBlocksLanguageMap` Lua option.] contains a record $(k, v)$, then a non-online-image content block with the filename extension $s, s$`:lower()`${}=k$ is considered to be in a known programming language $v$. @@ -11063,10 +11282,10 @@ following text: \def\markdownRendererContentBlockCode{% \markdownRendererContentBlockCodePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { contentBlockCode } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { contentBlockCode } { 5 } @@ -11097,10 +11316,10 @@ list is not tight). The macro receives no arguments. \def\markdownRendererUlBegin{% \markdownRendererUlBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulBegin } { 0 } @@ -11131,10 +11350,10 @@ is disabled. The macro receives no arguments. \def\markdownRendererUlBeginTight{% \markdownRendererUlBeginTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulBeginTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulBeginTight } { 0 } @@ -11163,10 +11382,10 @@ list. The macro receives no arguments. \def\markdownRendererUlItem{% \markdownRendererUlItemPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulItem } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulItem } { 0 } @@ -11195,10 +11414,10 @@ bulleted list. The macro receives no arguments. \def\markdownRendererUlItemEnd{% \markdownRendererUlItemEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulItemEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulItemEnd } { 0 } @@ -11228,10 +11447,10 @@ tight). The macro receives no arguments. \def\markdownRendererUlEnd{% \markdownRendererUlEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulEnd } { 0 } @@ -11464,10 +11683,10 @@ following text: \def\markdownRendererUlEndTight{% \markdownRendererUlEndTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { ulEndTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { ulEndTight } { 0 } @@ -11499,10 +11718,10 @@ option is disabled. The macro receives no arguments. \def\markdownRendererOlBegin{% \markdownRendererOlBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olBegin } { 0 } @@ -11534,10 +11753,10 @@ receives no arguments. \def\markdownRendererOlBeginTight{% \markdownRendererOlBeginTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olBeginTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olBeginTight } { 0 } @@ -11571,10 +11790,10 @@ and the style of delimiters between list item labels and texts (`Default`, \def\markdownRendererFancyOlBegin{% \markdownRendererFancyOlBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlBegin } { 2 } @@ -11608,10 +11827,10 @@ the valid style values. \def\markdownRendererFancyOlBeginTight{% \markdownRendererFancyOlBeginTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlBeginTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlBeginTight } { 2 } @@ -11642,10 +11861,10 @@ arguments. \def\markdownRendererOlItem{% \markdownRendererOlItemPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olItem } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olItem } { 0 } @@ -11675,10 +11894,10 @@ option is disabled. The macro receives no arguments. \def\markdownRendererOlItemEnd{% \markdownRendererOlItemEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olItemEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olItemEnd } { 0 } @@ -11709,10 +11928,10 @@ receives a single numeric argument that corresponds to the item number. \def\markdownRendererOlItemWithNumber{% \markdownRendererOlItemWithNumberPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olItemWithNumber } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olItemWithNumber } { 1 } @@ -11743,10 +11962,10 @@ no arguments. \def\markdownRendererFancyOlItem{% \markdownRendererFancyOlItemPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlItem } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlItem } { 0 } @@ -11776,10 +11995,10 @@ option is enabled. The macro receives no arguments. \def\markdownRendererFancyOlItemEnd{% \markdownRendererFancyOlItemEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlItemEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlItemEnd } { 0 } @@ -11810,10 +12029,10 @@ argument that corresponds to the item number. \def\markdownRendererFancyOlItemWithNumber{% \markdownRendererFancyOlItemWithNumberPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlItemWithNumber } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlItemWithNumber } { 1 } @@ -11844,10 +12063,10 @@ disabled. The macro receives no arguments. \def\markdownRendererOlEnd{% \markdownRendererOlEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olEnd } { 0 } @@ -11879,10 +12098,10 @@ arguments. \def\markdownRendererOlEndTight{% \markdownRendererOlEndTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { olEndTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { olEndTight } { 0 } @@ -11913,10 +12132,10 @@ option is enabled. The macro receives no arguments. \def\markdownRendererFancyOlEnd{% \markdownRendererFancyOlEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlEnd } { 0 } @@ -12204,10 +12423,10 @@ following text: \def\markdownRendererFancyOlEndTight{% \markdownRendererFancyOlEndTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { fancyOlEndTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { fancyOlEndTight } { 0 } @@ -12241,10 +12460,10 @@ list is not tight). The macro receives no arguments. \def\markdownRendererDlBegin{% \markdownRendererDlBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlBegin } { 0 } @@ -12275,10 +12494,10 @@ list is not tight). This macro will only be produced, when the \def\markdownRendererDlBeginTight{% \markdownRendererDlBeginTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlBeginTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlBeginTight } { 0 } @@ -12308,10 +12527,10 @@ being defined. \def\markdownRendererDlItem{% \markdownRendererDlItemPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlItem } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlItem } { 1 } @@ -12340,10 +12559,10 @@ definitions for a single term. \def\markdownRendererDlItemEnd{% \markdownRendererDlItemEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlItemEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlItemEnd } { 0 } @@ -12373,10 +12592,10 @@ a single term. \def\markdownRendererDlDefinitionBegin{% \markdownRendererDlDefinitionBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlDefinitionBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlDefinitionBegin } { 0 } @@ -12406,10 +12625,10 @@ single term. \def\markdownRendererDlDefinitionEnd{% \markdownRendererDlDefinitionEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlDefinitionEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlDefinitionEnd } { 0 } @@ -12439,10 +12658,10 @@ tight). The macro receives no arguments. \def\markdownRendererDlEnd{% \markdownRendererDlEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlEnd } { 0 } @@ -12808,10 +13027,10 @@ following text: \def\markdownRendererDlEndTight{% \markdownRendererDlEndTightPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { dlEndTight } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { dlEndTight } { 0 } @@ -12928,10 +13147,10 @@ following text: \def\markdownRendererEmphasis{% \markdownRendererEmphasisPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { emphasis } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { emphasis } { 1 } @@ -12961,10 +13180,10 @@ corresponds to the emphasized span of text. \def\markdownRendererStrongEmphasis{% \markdownRendererStrongEmphasisPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { strongEmphasis } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { strongEmphasis } { 1 } @@ -12994,10 +13213,10 @@ a block quote. The macro receives no arguments. \def\markdownRendererBlockQuoteBegin{% \markdownRendererBlockQuoteBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { blockQuoteBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { blockQuoteBegin } { 0 } @@ -13139,10 +13358,10 @@ following text: \def\markdownRendererBlockQuoteEnd{% \markdownRendererBlockQuoteEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { blockQuoteEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { blockQuoteEnd } { 0 } @@ -13173,10 +13392,10 @@ filename of a file contaning the code block contents. \def\markdownRendererInputVerbatim{% \markdownRendererInputVerbatimPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { inputVerbatim } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { inputVerbatim } { 1 } @@ -13289,10 +13508,10 @@ following text except for the filename, which may differ: \def\markdownRendererInputFencedCode{% \markdownRendererInputFencedCodePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { inputFencedCode } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { inputFencedCode } { 2 } @@ -13323,10 +13542,10 @@ option is enabled. The macro receives no arguments. \def\markdownRendererJekyllDataBegin{% \markdownRendererJekyllDataBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataBegin } { 0 } @@ -13356,10 +13575,10 @@ The \mdef{markdownRendererJekyllDataEnd} macro represents the end of a \def\markdownRendererJekyllDataEnd{% \markdownRendererJekyllDataEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataEnd } { 0 } @@ -13391,10 +13610,10 @@ arguments: the scalar key in the parent structure, cast to a string following \def\markdownRendererJekyllDataMappingBegin{% \markdownRendererJekyllDataMappingBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataMappingBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataMappingBegin } { 2 } @@ -13424,10 +13643,10 @@ when the \Opt{jekyllData} option is enabled. The macro receives no arguments. \def\markdownRendererJekyllDataMappingEnd{% \markdownRendererJekyllDataMappingEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataMappingEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataMappingEnd } { 0 } @@ -13459,10 +13678,10 @@ arguments: the scalar key in the parent structure, cast to a string following \def\markdownRendererJekyllDataSequenceBegin{% \markdownRendererJekyllDataSequenceBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataSequenceBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataSequenceBegin } { 2 } @@ -13492,10 +13711,10 @@ when the \Opt{jekyllData} option is enabled. The macro receives no arguments. \def\markdownRendererJekyllDataSequenceEnd{% \markdownRendererJekyllDataSequenceEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataSequenceEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataSequenceEnd } { 0 } @@ -13527,10 +13746,10 @@ following \acro{yaml} serialization rules. \def\markdownRendererJekyllDataBoolean{% \markdownRendererJekyllDataBooleanPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataBoolean } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataBoolean } { 2 } @@ -13562,10 +13781,10 @@ following \acro{yaml} serialization rules. \def\markdownRendererJekyllDataNumber{% \markdownRendererJekyllDataNumberPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataNumber } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataNumber } { 2 } @@ -13597,10 +13816,10 @@ serialization rules, and the scalar value. \def\markdownRendererJekyllDataString{% \markdownRendererJekyllDataStringPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataString } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataString } { 2 } @@ -13636,10 +13855,10 @@ serialization rules. \def\markdownRendererJekyllDataEmpty{% \markdownRendererJekyllDataEmptyPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { jekyllDataEmpty } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { jekyllDataEmpty } { 1 } @@ -13763,10 +13982,10 @@ The macro receives a single argument that corresponds to the heading text. \def\markdownRendererHeadingOne{% \markdownRendererHeadingOnePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingOne } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingOne } { 1 } @@ -13796,10 +14015,10 @@ text. \def\markdownRendererHeadingTwo{% \markdownRendererHeadingTwoPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingTwo } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingTwo } { 1 } @@ -13829,10 +14048,10 @@ text. \def\markdownRendererHeadingThree{% \markdownRendererHeadingThreePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingThree } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingThree } { 1 } @@ -13862,10 +14081,10 @@ text. \def\markdownRendererHeadingFour{% \markdownRendererHeadingFourPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingFour } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingFour } { 1 } @@ -13895,10 +14114,10 @@ text. \def\markdownRendererHeadingFive{% \markdownRendererHeadingFivePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingFive } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingFive } { 1 } @@ -14029,10 +14248,10 @@ following text: \def\markdownRendererHeadingSix{% \markdownRendererHeadingSixPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headingSix } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headingSix } { 1 } @@ -14047,8 +14266,8 @@ following text: % % \begin{markdown} -#### Horizontal Rule Renderer -The \mdef{markdownRendererHorizontalRule} macro represents a horizontal rule. +#### Thematic Break Renderer +The \mdef{markdownRendererThematicBreak} macro represents a thematic break. The macro receives no arguments. % \end{markdown} @@ -14061,7 +14280,7 @@ Using a text editor, create a text document named `document.tex` with the following content: ``` tex \input markdown -\def\markdownRendererHorizontalRule{\vfil\break} +\def\markdownRendererThematicBreak{\vfil\break} \markdownBegin This is the first page. @@ -14093,7 +14312,7 @@ following content: \usepackage{markdown} \markdownSetup{ renderers = { - horizontalRule = \newpage, + thematicBreak = \newpage, }, } \begin{document} @@ -14125,7 +14344,7 @@ Using a text editor, create a text document named `document.tex` with the following content: ``` tex \usemodule[t][markdown] -\def\markdownRendererHorizontalRule{\page[yes]} +\def\markdownRendererThematicBreak{\page[yes]} \starttext \startmarkdown This is the first page. @@ -14152,18 +14371,58 @@ following text: % %<*tex> % \fi +% \begin{markdown} +% +% The \mdef{markdownRendererHorizontalRule} and +% \mdef{markdownRendererHorizontalRulePrototype} macros have been deprecated +% and will be removed in Markdown 3.0.0. % +% \end{markdown} % \begin{macrocode} -\def\markdownRendererHorizontalRule{% - \markdownRendererHorizontalRulePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\cs_new:Npn + \markdownRendererThematicBreak + { + \cs_if_exist:NTF + \markdownRendererHorizontalRule + { + \markdownWarning + { + Horizontal~rule~renderer~has~been~deprecated,~ + to~be~removed~in~Markdown~3.0.0 + } + \markdownRendererHorizontalRule + } + { + \cs_if_exist:NTF + \markdownRendererHorizontalRulePrototype + { + \markdownWarning + { + Horizontal~rule~renderer~prototype~has~been~deprecated,~ + to~be~removed~in~Markdown~3.0.0 + } + \markdownRendererHorizontalRulePrototype + } + { + \markdownRendererThematicBreakPrototype + } + } + } +\seq_gput_right:Nn \g_@@_renderers_seq { horizontalRule } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { horizontalRule } { 0 } +\seq_gput_right:Nn + \g_@@_renderers_seq + { thematicBreak } +\prop_gput:Nnn + \g_@@_renderer_arities_prop + { thematicBreak } + { 0 } \ExplSyntaxOff % \end{macrocode} % \par @@ -14175,10 +14434,10 @@ following text: % % \begin{markdown} -#### Footnote Renderer -The \mdef{markdownRendererFootnote} macro represents a footnote. This macro -will only be produced, when the \Opt{footnotes} option is enabled. The -macro receives a single argument that corresponds to the footnote text. +#### Note Renderer +The \mdef{markdownRendererNote} macro represents a note. This macro +will only be produced, when the \Opt{notes} option is enabled. The +macro receives a single argument that corresponds to the note text. % \end{markdown} % @@ -14190,14 +14449,14 @@ Using a text editor, create a text document named `document.tex` with the following content: ``` tex \input markdown -\def\markdownOptionFootnotes{true} -\def\markdownRendererFootnote#1{ (and \lowercase{#1})} +\def\markdownOptionNotes{true} +\def\markdownRendererNote#1{ (and \lowercase{#1})} \markdownBegin This is some text[^1] and this is some other text[^2]. - [^1]: this is a footnote + [^1]: this is a note - [^2]: this is some other footnote + [^2]: this is some other note \markdownEnd \bye ``````` @@ -14208,8 +14467,8 @@ luatex document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> This is some text (and this is a footnote) and this is some other -> text (and this is some other footnote). +> This is some text (and this is a note) and this is some other +> text (and this is some other note). ##### \LaTeX{} Example {.unnumbered} @@ -14217,19 +14476,19 @@ Using a text editor, create a text document named `document.tex` with the following content: ``` tex \documentclass{article} -\usepackage[footnotes]{markdown} +\usepackage[notes]{markdown} \markdownSetup{ renderers = { - footnote = { (and \MakeLowercase{#1})}, + note = { (and \MakeLowercase{#1})}, }, } \begin{document} \begin{markdown} This is some text[^1] and this is some other text[^2]. - [^1]: this is a footnote + [^1]: this is a note - [^2]: this is some other footnote + [^2]: this is some other note \end{markdown} \end{document} ``````` @@ -14240,8 +14499,8 @@ lualatex document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> This is some text (and this is a footnote) and this is some other -> text (and this is some other footnote). +> This is some text (and this is a note) and this is some other +> text (and this is some other note). ##### \Hologo{ConTeXt} Example {.unnumbered} @@ -14249,15 +14508,15 @@ Using a text editor, create a text document named `document.tex` with the following content: ``` tex \usemodule[t][markdown] -\setupmarkdown[footnotes = yes] -\def\markdownRendererFootnote#1{ (and \lowercase{#1})} +\setupmarkdown[notes = yes] +\def\markdownRendererNote#1{ (and \lowercase{#1})} \starttext \startmarkdown This is some text[^1] and this is some other text[^2]. - [^1]: this is a footnote + [^1]: this is a note - [^2]: this is some other footnote + [^2]: this is some other note \stopmarkdown \stoptext ``````` @@ -14268,24 +14527,64 @@ context document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> This is some text (and this is a footnote) and this is some other -> text (and this is some other footnote). +> This is some text (and this is a note) and this is some other +> text (and this is some other note). % %<*tex> % \fi +% \begin{markdown} % +% The \mdef{markdownRendererFootnote} and +% \mdef{markdownRendererFootnotePrototype} macros have been deprecated +% and will be removed in Markdown 3.0.0. +% +% \end{markdown} % \begin{macrocode} -\def\markdownRendererFootnote{% - \markdownRendererFootnotePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\cs_new:Npn + \markdownRendererNote + { + \cs_if_exist:NTF + \markdownRendererFootnote + { + \markdownWarning + { + Footnote~renderer~has~been~deprecated,~ + to~be~removed~in~Markdown~3.0.0 + } + \markdownRendererFootnote + } + { + \cs_if_exist:NTF + \markdownRendererFootnotePrototype + { + \markdownWarning + { + Footnote~renderer~prototype~has~been~deprecated,~ + to~be~removed~in~Markdown~3.0.0 + } + \markdownRendererFootnotePrototype + } + { + \markdownRendererNotePrototype + } + } + } +\seq_gput_right:Nn \g_@@_renderers_seq { footnote } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { footnote } { 1 } +\seq_gput_right:Nn + \g_@@_renderers_seq + { note } +\prop_gput:Nnn + \g_@@_renderer_arities_prop + { note } + { 1 } \ExplSyntaxOff % \end{macrocode} % \par @@ -14376,10 +14675,10 @@ following text: \def\markdownRendererCite{% \markdownRendererCitePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { cite } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { cite } { 1 } @@ -14468,10 +14767,10 @@ following text: \def\markdownRendererTextCite{% \markdownRendererTextCitePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { textCite } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { textCite } { 1 } @@ -14595,10 +14894,10 @@ following text: \def\markdownRendererTable{% \markdownRendererTablePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { table } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { table } { 3 } @@ -14647,7 +14946,7 @@ following content: \begin{markdown} A useful use of inline HTML comments are side notes. +passages, which makes them *easier for the reader to find* than notes. --> We can render block HTML comments as blockquotes: @@ -14679,7 +14978,7 @@ following body text: The horizontal margins should contain the following text: > Side notes are displayed in the horizontal margins next to the relevant -> passages, which makes them *easier for the reader to find* than footnotes. +> passages, which makes them *easier for the reader to find* than notes. % %<*tex> @@ -14689,10 +14988,10 @@ The horizontal margins should contain the following text: \def\markdownRendererInlineHtmlComment{% \markdownRendererInlineHtmlCommentPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { inlineHtmlComment } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { inlineHtmlComment } { 1 } @@ -14700,10 +14999,10 @@ The horizontal margins should contain the following text: \def\markdownRendererBlockHtmlCommentBegin{% \markdownRendererBlockHtmlCommentBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { blockHtmlCommentBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { blockHtmlCommentBegin } { 0 } @@ -14711,10 +15010,10 @@ The horizontal margins should contain the following text: \def\markdownRendererBlockHtmlCommentEnd{% \markdownRendererBlockHtmlCommentEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { blockHtmlCommentEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { blockHtmlCommentEnd } { 0 } @@ -14788,10 +15087,10 @@ following body text: \def\markdownRendererInlineHtmlTag{% \markdownRendererInlineHtmlTagPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { inlineHtmlTag } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { inlineHtmlTag } { 1 } @@ -14799,10 +15098,10 @@ following body text: \def\markdownRendererInputBlockHtmlElement{% \markdownRendererInputBlockHtmlElementPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { inputBlockHtmlElement } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { inputBlockHtmlElement } { 1 } @@ -14906,10 +15205,10 @@ following text: \def\markdownRendererAttributeIdentifier{% \markdownRendererAttributeIdentifierPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { attributeIdentifier } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { attributeIdentifier } { 1 } @@ -14917,10 +15216,10 @@ following text: \def\markdownRendererAttributeClassName{% \markdownRendererAttributeClassNamePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { attributeClassName } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { attributeClassName } { 1 } @@ -14928,10 +15227,10 @@ following text: \def\markdownRendererAttributeKeyValue{% \markdownRendererAttributeKeyValuePrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { attributeKeyValue } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { attributeKeyValue } { 2 } @@ -15021,10 +15320,10 @@ following text: \def\markdownRendererHeaderAttributeContextBegin{% \markdownRendererHeaderAttributeContextBeginPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headerAttributeContextBegin } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headerAttributeContextBegin } { 0 } @@ -15032,10 +15331,10 @@ following text: \def\markdownRendererHeaderAttributeContextEnd{% \markdownRendererHeaderAttributeContextEndPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { headerAttributeContextEnd } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { headerAttributeContextEnd } { 0 } @@ -15142,10 +15441,10 @@ following text: \def\markdownRendererStrikeThrough{% \markdownRendererStrikeThroughPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { strikeThrough } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { strikeThrough } { 1 } @@ -15250,10 +15549,10 @@ following text: \def\markdownRendererSuperscript{% \markdownRendererSuperscriptPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { superscript } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { superscript } { 1 } @@ -15298,7 +15597,7 @@ luatex document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> H (2 moles) and O is liquid. +> H (2 moles) and O is a liquid. ##### \LaTeX{} Example {.unnumbered} @@ -15325,7 +15624,7 @@ lualatex document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> H (2 moles) and O is liquid. +> H (2 moles) and O is a liquid. ##### \Hologo{ConTeXt} Example {.unnumbered} @@ -15348,7 +15647,7 @@ context document.tex A PDF document named `document.pdf` should be produced and contain the following text: -> H (2 moles) and O is liquid. +> H (2 moles) and O is a liquid. % %<*tex> @@ -15358,13 +15657,130 @@ following text: \def\markdownRendererSubscript{% \markdownRendererSubscriptPrototype}% \ExplSyntaxOn -\seq_put_right:Nn +\seq_gput_right:Nn \g_@@_renderers_seq { subscript } -\prop_put:Nnn +\prop_gput:Nnn \g_@@_renderer_arities_prop { subscript } { 1 } +% \end{macrocode} +% \par +% +% \iffalse +% +%<*manual-tokens> +% \fi +% +% \begin{markdown} + +#### Raw Content Renderers +The \mdef{markdownRendererInputRawInline} macro represents an inline raw span. +The macro receives two arguments: the filename of a file contaning the inline +raw span contents and the raw attribute that designates the format of the +inline raw span. This macro will only be produced, when the \Opt{rawAttribute} +option is enabled. + +% \end{markdown} +% +% \iffalse +% +%<*tex> +% \fi +% +% \begin{macrocode} +\def\markdownRendererInputRawInline{% + \markdownRendererInputRawInlinePrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g_@@_renderers_seq + { inputRawInline } +\prop_gput:Nnn + \g_@@_renderer_arities_prop + { inputRawInline } + { 2 } +\ExplSyntaxOff +% \end{macrocode} +% \par +% +% \iffalse +% +%<*manual-tokens> +% \fi +% +% \begin{markdown} + +The \mdef{markdownRendererInputRawBlock} macro represents a raw block. The +macro receives two arguments: the filename of a file contaning the raw block +and the raw attribute that designates the format of the raw block. This macro +will only be produced, when the \Opt{rawAttribute} and \Opt{fencedCode} options +are enabled. + +% \end{markdown} +% +% \iffalse + +##### \LaTeX{} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +```` tex +\documentclass{article} +\usepackage[rawAttribute, fencedCode]{markdown} +\usepackage{expl3} +\ExplSyntaxOn +\cs_new:Nn + \display_raw_content:nn + { + % If the raw attribute is TeX, execute the content as a TeX document. + \str_if_eq:nnTF + { #2 } + { tex } + { \markdownEscape { #1 } } + % Otherwise, ignore the content. + { } + } +\markdownSetup{ + renderers = { + rawInline = { \display_raw_content:nn { #1 } { #2 } }, + rawBlock = { \display_raw_content:nn { #1 } { #2 } } + }, +} +\ExplSyntaxOff +\begin{document} +\begin{markdown} +`$H_2 O$`{=tex} is a liquid. + +``` {=html} +

Here is some HTML content that will be ignored.

+``` +\end{markdown} +\end{document} +```` +Next, invoke LuaTeX from the terminal: +``` sh +lualatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the +following text: + +> H~2~O is a liquid. + +% +%<*tex> +% \fi +% +% \begin{macrocode} +\def\markdownRendererInputRawBlock{% + \markdownRendererInputRawBlockPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g_@@_renderers_seq + { inputRawBlock } +\prop_gput:Nnn + \g_@@_renderer_arities_prop + { inputRawBlock } + { 2 } \ExplSyntaxOff % \end{macrocode} % \par @@ -15494,7 +15910,7 @@ following text: By default, the renderer prototypes for YAML metadata provide a high-level interface that can be programmed using the `markdown/jekyllData` key--values -from the l3keys module of the \LaTeX3 kernel. +from the l3keys module of the \LaTeX{}3 kernel. % \end{markdown} % \iffalse @@ -15616,7 +16032,6 @@ following text: { } \ExplSyntaxOff % \end{macrocode} -% % \begin{markdown} % % The following \TeX{} macros provide definitions for the token renderers (see @@ -15638,8 +16053,30 @@ following text: \let\markdownRendererBlockHtmlCommentBegin=\iffalse \let\markdownRendererBlockHtmlCommentEndPrototype=\fi \let\markdownRendererBlockHtmlCommentEnd=\fi - } -\cs_new:Nn \@@_plaintex_define_renderer_prototype:n +% \end{macrocode} +% \begin{markdown} +% +% The \mdef{markdownRendererFootnote} and +% \mdef{markdownRendererFootnotePrototype} macros have been deprecated +% and will be removed in Markdown 3.0.0. +% +% \end{markdown} +% \begin{macrocode} + \cs_undefine:N \markdownRendererFootnote + \cs_undefine:N \markdownRendererFootnotePrototype +% \end{macrocode} +% \begin{markdown} +% +% The \mdef{markdownRendererHorizontalRule} and +% \mdef{markdownRendererHorizontalRulePrototype} macros have been deprecated +% and will be removed in Markdown 3.0.0. +% +% \end{markdown} +% \begin{macrocode} + \cs_undefine:N \markdownRendererHorizontalRule + \cs_undefine:N \markdownRendererHorizontalRulePrototype + } +\cs_new:Nn \@@_plaintex_define_renderer_prototype:n { \@@_renderer_prototype_tl_to_csname:nN { #1 } @@ -16094,7 +16531,7 @@ document: \prop_new:N \g_@@_latex_option_types_prop \prop_new:N \g_@@_default_latex_options_prop \tl_const:Nn \c_@@_option_layer_latex_tl { latex } -\seq_put_right:NV \g_@@_option_layers_seq \c_@@_option_layer_latex_tl +\seq_gput_right:NV \g_@@_option_layers_seq \c_@@_option_layer_latex_tl \cs_new:Nn \@@_add_latex_option:nnn { @@ -16479,7 +16916,7 @@ A PDF document named `document.pdf` should be produced and contain the following image: > ![img](https://github.com/witiko/markdown/raw/main/markdown.png -> "The banner of the Markdown package") +> "The banner of the Markdown package") % %<*latex-themes-witiko-graphicx-http> @@ -16661,13 +17098,29 @@ The following ordered list will be preceded by roman numerals: \seq_map_inline:cn { g_@@_ ##1 _options_seq } { - \@@_latex_define_option_keyval:nn - { ##1 } +% \end{macrocode} +% \begin{markdown} +% +% To make it easier to copy-and-paste options from Pandoc [@macfarlane22] such +% as `fancy_lists`, `header_attributes`, and `pipe_tables`, we accept +% snake\\\_case in addition to camelCase variants of options. As a bonus, +% studies [@sharif10] also show that snake\\\_case is faster to read than +% camelCase. +% +% \end{markdown} +% \begin{macrocode} + \@@_with_various_cases:nn { ####1 } + { + \@@_latex_define_option_keyval:nnn + { ##1 } + { ####1 } + { ########1 } + } } } } -\cs_new:Nn \@@_latex_define_option_keyval:nn +\cs_new:Nn \@@_latex_define_option_keyval:nnn { \prop_get:cnN { g_@@_ #1 _option_types_prop } @@ -16676,7 +17129,7 @@ The following ordered list will be preceded by roman numerals: \keys_define:nn { markdown/latex-options } { - #2 .code:n = { + #3 .code:n = { \@@_set_option_value:nn { #2 } { ##1 } @@ -16689,7 +17142,7 @@ The following ordered list will be preceded by roman numerals: \keys_define:nn { markdown/latex-options } { - #2 .default:n = { true }, + #3 .default:n = { true }, } } % \end{macrocode} @@ -16710,7 +17163,7 @@ The following ordered list will be preceded by roman numerals: { \tl_set:Nn \l_tmpa_tl - { #2 } + { #3 } \tl_reverse:N \l_tmpa_tl \str_if_eq:enF @@ -16723,7 +17176,7 @@ The following ordered list will be preceded by roman numerals: \msg_error:nnn { @@ } { malformed-name-for-clist-option } - { #2 } + { #3 } } \tl_set:Nx \l_tmpa_tl @@ -16865,16 +17318,20 @@ The following ordered list will be preceded by roman numerals: } \cs_new:Nn \@@_latex_define_renderer:nNn { - \keys_define:nn - { markdown/latex-options/renderers } + \@@_with_various_cases:nn + { #1 } { - #1 .code:n = { - \cs_generate_from_arg_count:NNnn - #2 - \cs_set:Npn - { #3 } - { ##1 } - }, + \keys_define:nn + { markdown/latex-options/renderers } + { + ##1 .code:n = { + \cs_generate_from_arg_count:NNnn + #2 + \cs_set:Npn + { #3 } + { ####1 } + }, + } } } \cs_generate_variant:Nn @@ -16929,16 +17386,20 @@ The following ordered list will be preceded by roman numerals: } \cs_new:Nn \@@_latex_define_renderer_prototype:nNn { - \keys_define:nn - { markdown/latex-options/renderer-prototypes } + \@@_with_various_cases:nn + { #1 } { - #1 .code:n = { - \cs_generate_from_arg_count:NNnn - #2 - \cs_set:Npn - { #3 } - { ##1 } - }, + \keys_define:nn + { markdown/latex-options/renderer-prototypes } + { + ##1 .code:n = { + \cs_generate_from_arg_count:NNnn + #2 + \cs_set:Npn + { #3 } + { ####1 } + }, + } } } \cs_generate_variant:Nn @@ -17160,13 +17621,48 @@ texexec --passon=--shell-escape document.tex \seq_map_inline:cn { g_@@_ ##1 _options_seq } { - \@@_context_define_option_keyval:nn - { ##1 } +% \end{macrocode} +% \begin{markdown} +% +% To make it easier to copy-and-paste options from Pandoc [@macfarlane22] such +% as `fancy_lists`, `header_attributes`, and `pipe_tables`, we accept +% snake\\\_case in addition to camelCase variants of options. As a bonus, +% studies [@sharif10] also show that snake\\\_case is faster to read than +% camelCase. +% +% \end{markdown} +% \begin{macrocode} + \@@_with_various_cases:nn { ####1 } + { + \@@_context_define_option_keyval:nnn + { ##1 } + { ####1 } + { ########1 } + } } } } -\cs_new:Nn \@@_context_define_option_keyval:nn +% \end{macrocode} +% \begin{markdown} +% +% Furthermore, we also accept caseless variants of options in line with the +% style of \Hologo{ConTeXt}. +% +% \end{markdown} +% \begin{macrocode} +\cs_new:Nn \@@_caseless:N + { + \regex_replace_all:nnN + { ([a-z])([A-Z]) } + { \1 \c { str_lowercase:n } \cB\{ \2 \cE\} } + #1 + \tl_set:Nx + #1 + { #1 } + } +\seq_gput_right:Nn \g_@@_cases_seq { @@_caseless:N } +\cs_new:Nn \@@_context_define_option_keyval:nnn { \prop_get:cnN { g_@@_ #1 _option_types_prop } @@ -17175,7 +17671,7 @@ texexec --passon=--shell-escape document.tex \keys_define:nn { markdown/context-options } { - #2 .code:n = { + #3 .code:n = { \tl_set:Nx \l_tmpa_tl { @@ -17199,7 +17695,7 @@ texexec --passon=--shell-escape document.tex \keys_define:nn { markdown/context-options } { - #2 .default:n = { true }, + #3 .default:n = { true }, } } } @@ -17312,6 +17808,21 @@ end % \par % \begin{markdown} % +% The \luamdef{util.cache_verbatim} method strips whitespaces from the +% end of `string` and calls \luamref{util.cache} with `dir`, `string`, +% no salt or transformations, and the `.verbatim` suffix. +% +% \end{markdown} +% \begin{macrocode} +function util.cache_verbatim(dir, string) + string = string:gsub('[\r\n%s]*$', '') + local name = util.cache(dir, string, nil, nil, ".verbatim") + return name +end +% \end{macrocode} +% \par +% \begin{markdown} +% % The \luamdef{util.table_copy} method creates a shallow copy of a table `t` % and its metatable. % @@ -19868,13 +20379,14 @@ function M.writer.new(options) % \par % \begin{markdown} % -% Define \luamdef{writer->hrule} as the output format of a horizontal rule. +% Define \luamdef{writer->thematic_break} as the output format of a thematic +% break. % % \end{markdown} % \begin{macrocode} - function self.hrule() + function self.thematic_break() if not self.is_writing then return "" end - return "\\markdownRendererHorizontalRule{}" + return "\\markdownRendererThematicBreak{}" end % \end{macrocode} % \par @@ -19961,7 +20473,7 @@ function M.writer.new(options) % \begin{markdown} % % Define \luamdef{writer->code} as a function that will transform an input -% inlined code span `s` to the output format. +% inline code span `s` to the output format. % % \end{markdown} % \begin{macrocode} @@ -20212,8 +20724,7 @@ function M.writer.new(options) % \begin{macrocode} function self.verbatim(s) if not self.is_writing then return "" end - s = string.gsub(s, '[\r\n%s]*$', '') - local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim") + local name = util.cache_verbatim(options.cacheDir, s) return {"\\markdownRendererInputVerbatim{",name,"}"} end % \end{macrocode} @@ -20633,6 +21144,20 @@ parsers.attribute_value = ( (parsers.dquote / "") + ( parsers.anyescaped - parsers.dquote - parsers.rbrace - parsers.space)^0 +parsers.attribute = (parsers.dash * Cc(".unnumbered")) + + C((parsers.hash + parsers.period) + * parsers.attribute_key) + + Cs( parsers.attribute_key + * parsers.optionalspace * parsers.equal * parsers.optionalspace + * parsers.attribute_value) +parsers.attributes = parsers.lbrace + * parsers.optionalspace + * parsers.attribute + * (parsers.spacechar^1 + * parsers.attribute)^0 + * parsers.optionalspace + * parsers.rbrace + -- block followed by 0 or more optionally -- indented blocks with first line indented. parsers.indented_blocks = function(bl) @@ -20707,8 +21232,8 @@ local function captures_geq_length(_,i,a,b) return #a >= #b and i end -parsers.infostring = (parsers.linechar - (parsers.backtick - + parsers.space^1 * (parsers.newline + parsers.eof)))^0 +parsers.infostring = (parsers.linechar - (parsers.backtick + + parsers.space^1 * (parsers.newline + parsers.eof)))^0 local fenceindent parsers.fencehead = function(char) @@ -20977,6 +21502,16 @@ parsers.urlchar = parsers.anyescaped - parsers.newline - parsers.more % % \end{markdown} % \begin{macrocode} +parsers.TildeFencedCode + = parsers.fencehead(parsers.tilde) + * Cs(parsers.fencedline(parsers.tilde)^0) + * parsers.fencetail(parsers.tilde) + +parsers.BacktickFencedCode + = parsers.fencehead(parsers.backtick) + * Cs(parsers.fencedline(parsers.backtick)^0) + * parsers.fencetail(parsers.backtick) + parsers.lineof = function(c) return (parsers.leader * (P(c) * parsers.optionalspace)^3 * (parsers.newline * parsers.blankline^1 @@ -20990,26 +21525,12 @@ end % % \end{markdown} % \begin{macrocode} -parsers.heading_attribute = (parsers.dash * Cc(".unnumbered")) - + C((parsers.hash + parsers.period) - * parsers.attribute_key) - + Cs( parsers.attribute_key - * parsers.optionalspace * parsers.equal * parsers.optionalspace - * parsers.attribute_value) -parsers.HeadingAttributes = parsers.lbrace - * parsers.optionalspace - * parsers.heading_attribute - * (parsers.spacechar^1 - * parsers.heading_attribute)^0 - * parsers.optionalspace - * parsers.rbrace - -- parse Atx heading start and return level -parsers.HeadingStart = #parsers.hash * C(parsers.hash^-6) - * -parsers.hash / length +parsers.heading_start = #parsers.hash * C(parsers.hash^-6) + * -parsers.hash / length -- parse setext header ending and return level -parsers.HeadingLevel = parsers.equal^1 * Cc(1) + parsers.dash^1 * Cc(2) +parsers.heading_level = parsers.equal^1 * Cc(1) + parsers.dash^1 * Cc(2) local function strip_atx_end(s) return s:gsub("[#%s]*\n$","") @@ -21188,8 +21709,8 @@ function M.reader.new(writer, options) % \end{markdown} % \begin{macrocode} if toplevel and (options.texComments or options.hybrid) then - str = lpeg.match(Ct(parsers.commented_line^1), str) - str = util.rope_to_string(str) + str = lpeg.match(Ct(parsers.commented_line^1), str) + str = util.rope_to_string(str) end local res = lpeg.match(grammar(), str) if res == nil then @@ -21274,7 +21795,7 @@ function M.reader.new(writer, options) * (-(parsers.leader * parsers.more + parsers.blankline) * parsers.linechar^1 * parsers.newline)^0 - + if not options.breakableBlockquotes then parsers.blockquote_body = parsers.blockquote_body * (parsers.blankline^0 / "") @@ -21283,7 +21804,7 @@ function M.reader.new(writer, options) % \par % \begin{markdown} % -%#### Parsers Used for Footnotes (local) +%#### Parsers Used for Notes (local) % % \end{markdown} % \begin{macrocode} @@ -21550,10 +22071,10 @@ function M.reader.new(writer, options) / self.parser_functions.parse_blocks_nested / writer.blockquote - parsers.HorizontalRule = ( parsers.lineof(parsers.asterisk) - + parsers.lineof(parsers.dash) - + parsers.lineof(parsers.underscore) - ) / writer.hrule + parsers.ThematicBreak = ( parsers.lineof(parsers.asterisk) + + parsers.lineof(parsers.dash) + + parsers.lineof(parsers.underscore) + ) / writer.thematic_break parsers.Reference = parsers.define_reference_parser / register_link @@ -21604,14 +22125,14 @@ function M.reader.new(writer, options) * parsers.ListBlock parsers.TightListItem = function(starter) - return -parsers.HorizontalRule + return -parsers.ThematicBreak * (Cs(starter / "" * parsers.tickbox^-1 * parsers.ListBlock * parsers.NestedList^-1) / self.parser_functions.parse_blocks_nested) * -(parsers.blanklines * parsers.indent) end parsers.LooseListItem = function(starter) - return -parsers.HorizontalRule + return -parsers.ThematicBreak * Cs( starter / "" * parsers.tickbox^-1 * parsers.ListBlock * Cc("\n") * (parsers.NestedList + parsers.ListContinuationBlock^0) * (parsers.blanklines / "\n\n") @@ -21664,7 +22185,7 @@ function M.reader.new(writer, options) % \end{markdown} % \begin{macrocode} -- parse atx header - parsers.AtxHeading = Cg(parsers.HeadingStart,"level") + parsers.AtxHeading = Cg(parsers.heading_start, "level") * parsers.optionalspace * (C(parsers.line) / strip_atx_end @@ -21676,7 +22197,7 @@ function M.reader.new(writer, options) * Ct(parsers.linechar^1 / self.parser_functions.parse_inlines) * parsers.newline - * parsers.HeadingLevel + * parsers.heading_level * parsers.optionalspace * parsers.newline / writer.heading @@ -21794,7 +22315,7 @@ function M.reader.new(writer, options) Blockquote = parsers.Blockquote, Verbatim = parsers.Verbatim, - HorizontalRule = parsers.HorizontalRule, + ThematicBreak = parsers.ThematicBreak, BulletList = parsers.BulletList, OrderedList = parsers.OrderedList, Heading = parsers.Heading, @@ -21969,7 +22490,7 @@ function M.reader.new(writer, options) % \begin{markdown} % % Although the interface of the \luamref{reader->insert_pattern} method does -% document this (see Section <#luauserextensions>), we allow the +% document this (see Section <#sec:luauserextensions>), we allow the % \luamref{reader->insert_pattern} and \luamref{reader->update_rule} % methods to insert not just \acro{peg} patterns, but also rule names that % reference the \acro{peg} grammar of Markdown. @@ -22654,74 +23175,22 @@ M.extensions.fenced_code = function(blank_before_code_fence) % % \end{markdown} % \begin{macrocode} - function self.fencedCode(i, s) + function self.fencedCode(s, i) if not self.is_writing then return "" end - s = string.gsub(s, '[\r\n%s]*$', '') - local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim") - return {"\\markdownRendererInputFencedCode{",name,"}{",i,"}"} + local name = util.cache_verbatim(options.cacheDir, s) + return {"\\markdownRendererInputFencedCode{", + name,"}{",self.string(i),"}"} end end, extend_reader = function(self) local parsers = self.parsers local writer = self.writer - local function captures_geq_length(_,i,a,b) - return #a >= #b and i - end - - local infostring = (parsers.linechar - (parsers.backtick - + parsers.space^1 * (parsers.newline + parsers.eof)))^0 - - local fenceindent - local fencehead = function(char) - return C(parsers.nonindentspace) / function(s) fenceindent = #s end - * Cg(char^3, "fencelength") - * parsers.optionalspace * C(infostring) - * parsers.optionalspace * (parsers.newline + parsers.eof) - end - - local fencetail = function(char) - return parsers.nonindentspace - * Cmt(C(char^3) * Cb("fencelength"), captures_geq_length) - * parsers.optionalspace * (parsers.newline + parsers.eof) - + parsers.eof - end - - local fencedline = function(char) - return C(parsers.line - fencetail(char)) - / function(s) - local i = 1 - local remaining = fenceindent - while true do - local c = s:sub(i, i) - if c == " " and remaining > 0 then - remaining = remaining - 1 - i = i + 1 - elseif c == "\t" and remaining > 3 then - remaining = remaining - 4 - i = i + 1 - else - break - end - end - return s:sub(i) - end - end - - local TildeFencedCode - = fencehead(parsers.tilde) - * Cs(fencedline(parsers.tilde)^0) - * fencetail(parsers.tilde) - - local BacktickFencedCode - = fencehead(parsers.backtick) - * Cs(fencedline(parsers.backtick)^0) - * fencetail(parsers.backtick) - - local FencedCode = (TildeFencedCode - + BacktickFencedCode) + local FencedCode = (parsers.TildeFencedCode + + parsers.BacktickFencedCode) / function(infostring, code) - return writer.fencedCode(writer.string(infostring), - self.expandtabs(code)) + local expanded_code = self.expandtabs(code) + return writer.fencedCode(expanded_code, + infostring) end self.insert_pattern("Block after Verbatim", @@ -22731,8 +23200,8 @@ M.extensions.fenced_code = function(blank_before_code_fence) if blank_before_code_fence then fencestart = parsers.fail else - fencestart = fencehead(parsers.backtick) - + fencehead(parsers.tilde) + fencestart = parsers.fencehead(parsers.backtick) + + parsers.fencehead(parsers.tilde) end local EndlineExceptions = parsers.EndlineExceptions + fencestart @@ -22745,38 +23214,38 @@ end % \end{macrocode} % \begin{markdown} % -%#### Footnotes +%#### Notes % -% The \luamdef{extensions.footnotes} function implements the Pandoc footnote -% and inline footnote syntax extensions. When the `footnote` parameter is -% `true`, the Pandoc footnote syntax extension will be enabled. When the -% `inline_footnotes` parameter is `true`, the Pandoc inline footnote syntax +% The \luamdef{extensions.notes} function implements the Pandoc note +% and inline note syntax extensions. When the `note` parameter is +% `true`, the Pandoc note syntax extension will be enabled. When the +% `inline_notes` parameter is `true`, the Pandoc inline note syntax % extension will be enabled. % % \end{markdown} % \begin{macrocode} -M.extensions.footnotes = function(footnotes, inline_footnotes) - assert(footnotes or inline_footnotes) +M.extensions.notes = function(notes, inline_notes) + assert(notes or inline_notes) return { - name = "built-in footnotes syntax extension", + name = "built-in notes syntax extension", extend_writer = function(self) % \end{macrocode} % \par % \begin{markdown} % % Define \luamdef{writer->note} as a function that will transform an -% input footnote `s` to the output format. +% input note `s` to the output format. % % \end{markdown} % \begin{macrocode} function self.note(s) - return {"\\markdownRendererFootnote{",s,"}"} + return {"\\markdownRendererNote{",s,"}"} end end, extend_reader = function(self) local parsers = self.parsers local writer = self.writer - if inline_footnotes then + if inline_notes then local InlineNote = parsers.circumflex * (parsers.tag / self.parser_functions.parse_inlines_no_inline_note) @@ -22785,7 +23254,7 @@ M.extensions.footnotes = function(footnotes, inline_footnotes) self.insert_pattern("Inline after Emph", InlineNote, "InlineNote") end - if footnotes then + if notes then local function strip_first_char(s) return s:sub(2) end @@ -22851,49 +23320,49 @@ M.extensions.header_attributes = function() local parsers = self.parsers local writer = self.writer - parsers.AtxHeading = Cg(parsers.HeadingStart,"level") - * parsers.optionalspace - * (C(((parsers.linechar - - ((parsers.hash^1 - * parsers.optionalspace - * parsers.HeadingAttributes^-1 - + parsers.HeadingAttributes) - * parsers.optionalspace - * parsers.newline)) - * (parsers.linechar - - parsers.hash - - parsers.lbrace)^0)^1) - / self.parser_functions.parse_inlines) - * Cg(Ct(parsers.newline - + (parsers.hash^1 - * parsers.optionalspace - * parsers.HeadingAttributes^-1 - + parsers.HeadingAttributes) + local AtxHeading = Cg(parsers.heading_start, "level") + * parsers.optionalspace + * (C(((parsers.linechar + - ((parsers.hash^1 * parsers.optionalspace - * parsers.newline), "attributes") - * Cb("level") - * Cb("attributes") - / writer.heading - - parsers.SetextHeading = #(parsers.line * S("=-")) - * (C(((parsers.linechar - - (parsers.HeadingAttributes - * parsers.optionalspace - * parsers.newline)) - * (parsers.linechar - - parsers.lbrace)^0)^1) - / self.parser_functions.parse_inlines) - * Cg(Ct(parsers.newline - + (parsers.HeadingAttributes - * parsers.optionalspace - * parsers.newline)), "attributes") - * parsers.HeadingLevel - * Cb("attributes") - * parsers.optionalspace - * parsers.newline - / writer.heading - - local Heading = parsers.AtxHeading + parsers.SetextHeading + * parsers.attributes^-1 + + parsers.attributes) + * parsers.optionalspace + * parsers.newline)) + * (parsers.linechar + - parsers.hash + - parsers.lbrace)^0)^1) + / self.parser_functions.parse_inlines) + * Cg(Ct(parsers.newline + + (parsers.hash^1 + * parsers.optionalspace + * parsers.attributes^-1 + + parsers.attributes) + * parsers.optionalspace + * parsers.newline), "attributes") + * Cb("level") + * Cb("attributes") + / writer.heading + + local SetextHeading = #(parsers.line * S("=-")) + * (C(((parsers.linechar + - (parsers.attributes + * parsers.optionalspace + * parsers.newline)) + * (parsers.linechar + - parsers.lbrace)^0)^1) + / self.parser_functions.parse_inlines) + * Cg(Ct(parsers.newline + + (parsers.attributes + * parsers.optionalspace + * parsers.newline)), "attributes") + * parsers.heading_level + * Cb("attributes") + * parsers.optionalspace + * parsers.newline + / writer.heading + + local Heading = AtxHeading + SetextHeading self.update_rule("Heading", Heading) end } @@ -23035,14 +23504,14 @@ M.extensions.jekyll_data = function(expect_jekyll_data) local UnexpectedJekyllData = P("---") * parsers.blankline / 0 - * #(-parsers.blankline) -- if followed by blank, it's an hrule + * #(-parsers.blankline) -- if followed by blank, it's thematic break * JekyllData * (P("---") + P("...")) local ExpectedJekyllData = ( P("---") * parsers.blankline / 0 - * #(-parsers.blankline) -- if followed by blank, it's an hrule + * #(-parsers.blankline) -- if followed by blank, it's thematic break )^-1 * JekyllData * (P("---") + P("..."))^-1 @@ -23221,6 +23690,93 @@ end % \end{macrocode} % \begin{markdown} % +%#### Raw Attributes +% +% The \luamdef{extensions.raw_attribute} function implements the Pandoc +% raw attribute syntax extension. +% +% \end{markdown} +% \begin{macrocode} +M.extensions.raw_attribute = function() + return { + name = "built-in raw_attribute syntax extension", + extend_writer = function(self) + local options = self.options + +% \end{macrocode} +% \par +% \begin{markdown} +% +% Define \luamdef{writer->rawInline} as a function that will transform an +% input inline raw span `s` with the raw attribute `i` to the output format. +% +% \end{markdown} +% \begin{macrocode} + function self.rawInline(s, attr) + if not self.is_writing then return "" end + local name = util.cache_verbatim(options.cacheDir, s) + return {"\\markdownRendererInputRawInline{", + name,"}{", self.string(attr),"}"} + end + + if options.fencedCode then +% \end{macrocode} +% \par +% \begin{markdown} +% +% Define \luamdef{writer->rawBlock} as a function that will transform an +% input raw block `s` with the raw attribute `i` to the output format. +% +% \end{markdown} +% \begin{macrocode} + function self.rawBlock(s, attr) + if not self.is_writing then return "" end + local name = util.cache_verbatim(options.cacheDir, s) + return {"\\markdownRendererInputRawBlock{", + name,"}{", self.string(attr),"}"} + end + end + end, extend_reader = function(self) + local options = self.options + local writer = self.writer + + local raw_attribute = parsers.lbrace + * parsers.optionalspace + * parsers.equal + * C(parsers.attribute_key) + * parsers.optionalspace + * parsers.rbrace + + local RawInline = parsers.inticks + * raw_attribute + / writer.rawInline + + self.insert_pattern("Inline before Code", + RawInline, "RawInline") + + if options.fencedCode then + local RawBlock = (parsers.TildeFencedCode + + parsers.BacktickFencedCode) + / function(infostring, code) + local expanded_code = self.expandtabs(code) + local attr = lpeg.match(raw_attribute, infostring) + if attr then + return writer.rawBlock(expanded_code, attr) + else + return writer.fencedCode(expanded_code, + infostring) + end + end + + self.insert_pattern("Block after Verbatim", + RawBlock, "RawBlock") + end + end + } +end +% \end{macrocode} +% \begin{markdown} +% %#### Strike-Through % % The \luamdef{extensions.strike_through} function implements the Pandoc @@ -23456,14 +24012,14 @@ M.extensions.fancy_lists = function() * ListBlock local TightListItem = function(starter) - return -parsers.HorizontalRule + return -parsers.ThematicBreak * (Cs(starter / "" * parsers.tickbox^-1 * ListBlock * NestedList^-1) / self.parser_functions.parse_blocks_nested) * -(parsers.blanklines * parsers.indent) end local LooseListItem = function(starter) - return -parsers.HorizontalRule + return -parsers.ThematicBreak * Cs( starter / "" * parsers.tickbox^-1 * ListBlock * Cc("\n") * (NestedList + ListContinuationBlock^0) * (parsers.blanklines / "\n\n") @@ -23550,7 +24106,7 @@ end % % The \luamref{new} function returns a conversion function that takes a % markdown string and turns it into a plain \TeX{} output. See Section -% <#luaconversion>. +% <#sec:luaconversion>. % % \end{markdown} % \begin{macrocode} @@ -23611,6 +24167,11 @@ function M.new(options) table.insert(extensions, pipe_tables_extension) end + if options.rawAttribute then + local raw_attribute_extension = M.extensions.raw_attribute() + table.insert(extensions, raw_attribute_extension) + end + if options.strikeThrough then local strike_through_extension = M.extensions.strike_through() table.insert(extensions, strike_through_extension) @@ -23626,10 +24187,20 @@ function M.new(options) table.insert(extensions, superscript_extension) end - if options.footnotes or options.inlineFootnotes then - local footnotes_extension = M.extensions.footnotes( - options.footnotes, options.inlineFootnotes) - table.insert(extensions, footnotes_extension) +% \end{macrocode} +% \begin{markdown} +% +% The footnotes and inlineFootnotes option has been deprecated and will be +% removed in Markdown 3.0.0. +% +% \end{markdown} +% \begin{macrocode} + if options.footnotes or options.inlineFootnotes or + options.notes or options.inlineNotes then + local notes_extension = M.extensions.notes( + options.footnotes or options.notes, + options.inlineFootnotes or options.inlineNotes) + table.insert(extensions, notes_extension) end if options.citations then @@ -23724,7 +24295,7 @@ function M.new(options) % % Finally, cast the user-defined syntax extension to the internal format % of user extensions used by the Markdown package (see Section -% <#luabuiltinextensions>.) +% <#sec:luabuiltinextensions>.) % % \end{markdown} % \begin{macrocode} @@ -23930,8 +24501,8 @@ end \def\markdownRendererHeadingFourPrototype#1{#1}% \def\markdownRendererHeadingFivePrototype#1{#1}% \def\markdownRendererHeadingSixPrototype#1{#1}% -\def\markdownRendererHorizontalRulePrototype{}% -\def\markdownRendererFootnotePrototype#1{#1}% +\def\markdownRendererThematicBreakPrototype{}% +\def\markdownRendererNotePrototype#1{#1}% \def\markdownRendererCitePrototype#1{}% \def\markdownRendererTextCitePrototype#1{}% \def\markdownRendererTickedBoxPrototype{[X]}% @@ -23944,6 +24515,33 @@ end % \par % \begin{markdown} % +%#### Raw Attribute Renderer Prototypes +% +% In the raw block and inline raw span renderer prototypes, execute the content +% with TeX when the raw attribute is `tex`, display the content as markdown when +% the raw attribute is `md`, and ignore the content otherwise. +% +% \end{markdown} +% \begin{macrocode} +\ExplSyntaxOn +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \str_case:nn + { #2 } + { + { tex } { \markdownEscape{#1} } + { md } { \markdownInput{#1} } + } + } +\cs_gset_eq:NN + \markdownRendererInputRawBlockPrototype + \markdownRendererInputRawInlinePrototype +\ExplSyntaxOff +% \end{macrocode} +% \par +% \begin{markdown} +% %#### YAML Metadata Renderer Prototypes {#expl3yamlmetadataimplementation} % % To keep track of the current type of structure we inhabit when we are @@ -24867,6 +25465,22 @@ end }% |endgroup % \end{macrocode} +% \par +% \begin{markdown} +% The \mref{markdownEscape} macro resets the category codes of the percent sign +% and the hash sign back to comment and parameter, respectively, before using +% the `\input` built-in of \TeX{} to execute a \TeX{} document in the middle of +% a markdown document fragment. +% \end{markdown} +% \begin{macrocode} +\gdef\markdownEscape#1{% + \catcode`\%=14\relax + \catcode`\#=6\relax + \input #1\relax + \catcode`\%=12\relax + \catcode`\#=12\relax +}% +% \end{macrocode} % \iffalse % %<*latex> @@ -24983,13 +25597,13 @@ end % \begin{macrocode} \newcommand\markdownLaTeXThemeName{} \seq_new:N \g_@@_latex_themes_seq -\seq_put_right:NV +\seq_gput_right:NV \g_@@_latex_themes_seq \markdownLaTeXThemeName \newcommand\markdownLaTeXThemeLoad[2]{ \def\@tempa{% \def\markdownLaTeXThemeName{#2} - \seq_put_right:NV + \seq_gput_right:NV \g_@@_latex_themes_seq \markdownLaTeXThemeName \RequirePackage{#1} @@ -25266,11 +25880,20 @@ end { markdown/latex-options/renderers } { #1 } }, - rendererPrototypes .code:n = { - \keys_set:nn - { markdown/latex-options/renderer-prototypes } - { #1 } - }, + } +\@@_with_various_cases:nn + { rendererPrototypes } + { + \keys_define:nn + { markdown/latex-options } + { + #1 .code:n = { + \keys_set:nn + { markdown/latex-options/renderer-prototypes } + { ##1 } + }, + } + } % \end{macrocode} % \begin{markdown} % @@ -25279,7 +25902,11 @@ end % % \end{markdown} % \begin{macrocode} +\keys_define:nn + { markdown/latex-options } + { code .code:n = { #1 }, + } % \end{macrocode} % \begin{markdown} % @@ -25289,11 +25916,36 @@ end % % \end{markdown} % \begin{macrocode} - jekyllDataRenderers .code:n = { - \keys_set:nn - { markdown/latex-options/jekyll-data-renderers } - { #1 } - }, +\@@_with_various_cases:nn + { jekyllDataRenderers } + { + \keys_define:nn + { markdown/latex-options } + { + #1 .code:n = { + \tl_set:Nn + \l_tmpa_tl + { ##1 } +% \end{macrocode} +% \begin{markdown} +% +% To ensure that keys containing forward slashes get passed correctly, we +% replace all forward slashes in the nput with backslash tokens with category +% code letter and then undo the replacement. This means that if any unbraced +% backslash tokens with category code letter exist in the input, they will be +% replaced with forward slashes. However, this should be extremely rare. +% +% \end{markdown} +% \begin{macrocode} + \tl_replace_all:NnV + \l_tmpa_tl + { / } + \c_backslash_str + \keys_set:nV + { markdown/latex-options/jekyll-data-renderers } + \l_tmpa_tl + }, + } } \keys_define:nn { markdown/latex-options/jekyll-data-renderers } @@ -25302,6 +25954,10 @@ end \tl_set_eq:NN \l_tmpa_tl \l_keys_key_str + \tl_replace_all:NVn + \l_tmpa_tl + \c_backslash_str + { / } \tl_put_right:Nn \l_tmpa_tl { @@ -25315,6 +25971,12 @@ end \cs_generate_variant:Nn \keys_define:nn { nV } +\cs_generate_variant:Nn + \tl_replace_all:Nnn + { NVn } +\cs_generate_variant:Nn + \tl_replace_all:Nnn + { NnV } \ExplSyntaxOff % \end{macrocode} % \par @@ -25483,7 +26145,7 @@ end dlEndTight = {\markdownRendererDlEnd}}} } \ExplSyntaxOff -\RequirePackage{amsmath,ifthen} +\RequirePackage{amsmath} % \end{macrocode} % \par % \begin{markdown} @@ -25540,29 +26202,33 @@ end \else \texttt{#1}% \fi + }}} +\ExplSyntaxOn +\markdownSetup{ + rendererPrototypes = { + contentBlock = { + \str_case:nnF + { #1 } + { + { csv } + { + \begin{table} + \begin{center} + \csvautotabular{#3} + \end{center} + \tl_if_empty:nF + { #4 } + { \caption{#4} } + \end{table} + } + { tex } { \markdownEscape{#3} } + } + { \markdownInput{#3} } + }, }, - contentBlock = {% - \ifthenelse{\equal{#1}{csv}}{% - \begin{table}% - \begin{center}% - \csvautotabular{#3}% - \end{center} - \ifx\empty#4\empty\else - \caption{#4}% - \fi - \end{table}% - }{% - \ifthenelse{\equal{#1}{tex}}{% - \catcode`\%=14\relax - \catcode`\#=6\relax - \input #3\relax - \catcode`\%=12\relax - \catcode`\#=12\relax - }{% - \markdownInput{#3}% - }% - }% - }, +} +\ExplSyntaxOff +\markdownSetup{rendererPrototypes={ image = {% \begin{figure}% \begin{center}% @@ -25653,8 +26319,8 @@ end \catcode`\#=12\relax }% \fi}, - horizontalRule = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, - footnote = {\footnote{#1}}}} + thematicBreak = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, + note = {\footnote{#1}}}} % \end{macrocode} % \par % \begin{markdown} @@ -26177,7 +26843,6 @@ end \addto@hook\markdownLaTeXTable{#1\\}% \expandafter\@gobble \fi\markdownLaTeXRenderTableCell} -\fi % \end{macrocode} % \par % \begin{markdown} @@ -26257,6 +26922,35 @@ end % \par % \begin{markdown} % +%#### Raw Attribute Renderer Prototypes +% +% In the raw block and inline raw span renderer prototypes, execute the content +% with TeX when the raw attribute is `tex` or `latex`, display the content as +% markdown when the raw attribute is `md`, and ignore the content otherwise. +% +% \end{markdown} +% \begin{macrocode} +\ExplSyntaxOn +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \str_case:nn + { #2 } + { + { tex } { \markdownEscape{#1} } + { latex } { \markdownEscape{#1} } + { md } { \markdownInput{#1} } + } + } +\cs_gset_eq:NN + \markdownRendererInputRawBlockPrototype + \markdownRendererInputRawInlinePrototype +\ExplSyntaxOff +\fi % Closes `\markdownIfOption{Plain}{\iffalse}{iftrue}` +% \end{macrocode} +% \par +% \begin{markdown} +% %### Miscellanea % When buffering user input, we should disable the bytes with the high bit set, % since these are made active by the \pkg{inputenc} package. We will do this by @@ -26504,9 +27198,9 @@ end \def\markdownRendererHeadingFourPrototype#1{\subsubsection{#1}}% \def\markdownRendererHeadingFivePrototype#1{\subsubsubsection{#1}}% \def\markdownRendererHeadingSixPrototype#1{\subsubsubsubsection{#1}}% -\def\markdownRendererHorizontalRulePrototype{% +\def\markdownRendererThematicBreakPrototype{% \blackrule[height=1pt, width=\hsize]}% -\def\markdownRendererFootnotePrototype#1{\footnote{#1}}% +\def\markdownRendererNotePrototype#1{\footnote{#1}}% \def\markdownRendererTickedBoxPrototype{$\boxtimes$} \def\markdownRendererHalfTickedBoxPrototype{$\boxdot$} \def\markdownRendererUntickedBoxPrototype{$\square$} @@ -26587,6 +27281,34 @@ end \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax\else \expandafter\gobbleoneargument \fi\markdownConTeXtRenderTableCell} +% \end{macrocode} +% \par +% \begin{markdown} +% +%#### Raw Attribute Renderer Prototypes +% +% In the raw block and inline raw span renderer prototypes, execute the content +% with TeX when the raw attribute is `tex` or `context`, display the content as +% markdown when the raw attribute is `md`, and ignore the content otherwise. +% +% \end{markdown} +% \begin{macrocode} +\ExplSyntaxOn +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \str_case:nn + { #2 } + { + { tex } { \markdownEscape{#1} } + { context } { \markdownEscape{#1} } + { md } { \markdownInput{#1} } + } + } +\cs_gset_eq:NN + \markdownRendererInputRawBlockPrototype + \markdownRendererInputRawInlinePrototype +\ExplSyntaxOff \stopmodule\protect % \end{macrocode} % \iffalse diff --git a/macros/generic/markdown/markdown.html b/macros/generic/markdown/markdown.html index edd58f157d..8f66e86c6e 100644 --- a/macros/generic/markdown/markdown.html +++ b/macros/generic/markdown/markdown.html @@ -84,7 +84,7 @@

Markdown Package User Manual

Vít Novotný

-

2.17.1-0-g8ca83f5 2022-10-03

+

2.18.0-0-gd8ae860 2022-10-30