kramdown-rfc2629 1.3.15 → 1.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/kdrfc +4 -0
- data/data/math.json +1 -0
- data/kramdown-rfc2629.gemspec +3 -2
- data/lib/kramdown-rfc2629.rb +101 -16
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f5ee9d2385757e8121af0b12406be16995f0a221fbc2d7feca3e0b778168c2f
|
4
|
+
data.tar.gz: 2a76e6613d01eef256c192728dfe71e327c73656a4fc74547da51e60290bcca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e75e8d942f4d068dce0be7cc1ccf79a5add0b31a0bd3e211737c0ffa0a3dd9cb03b7ca2e66324ceb14ba36d335a71a671d3e4b529ca8308507f7c96dde0c7a
|
7
|
+
data.tar.gz: '0937c152d0f6032072a53c442e9f6404b05f1c5aad1df9e91a62f93b2390abba9666ad70f7d99c7c238a4832dac1699e842c591b9ab5dfe03da25176e7caaaa0'
|
data/bin/kdrfc
CHANGED
@@ -121,6 +121,9 @@ BANNER
|
|
121
121
|
opts.on("-p", "--[no-]prep", "Convert xml to prepped xml") do |v|
|
122
122
|
$options.prep = v
|
123
123
|
end
|
124
|
+
opts.on("-c", "--[no-]convert", "Convert xml to v3 xml") do |v|
|
125
|
+
$options.v2v3 = v
|
126
|
+
end
|
124
127
|
opts.on("-h", "--[no-]html", "Convert to html as well") do |v|
|
125
128
|
$options.html = v
|
126
129
|
end
|
@@ -135,6 +138,7 @@ op.parse!
|
|
135
138
|
|
136
139
|
def process_the_xml(fn, base)
|
137
140
|
process_xml(fn, "#{base}.prepped.xml", "--preptool") if $options.prep
|
141
|
+
process_xml(fn, "#{base}.v2v3.xml", "--v2v3") if $options.v2v3
|
138
142
|
process_xml(fn, "#{base}.txt") if $options.txt
|
139
143
|
process_xml(fn, "#{base}.html", "--html") if $options.html
|
140
144
|
end
|
data/data/math.json
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"replacements":[["\\textfractionsolidus","⁄"],["\\leftrightsquigarrow","↭"],["\\textpertenthousand","‱"],["\\blacktriangleright","▸"],["\\blacktriangledown","▾"],["\\blacktriangleleft","◂"],["\\twoheadrightarrow","↠"],["\\leftrightharpoons","⇋"],["\\rightleftharpoons","⇌"],["\\textreferencemark","※"],["\\circlearrowright","↻"],["\\rightrightarrows","⇉"],["\\vartriangleright","⊳"],["\\textordmasculine","º"],["\\textvisiblespace","␣"],["\\twoheadleftarrow","↞"],["\\downharpoonright","⇂"],["\\ntrianglerighteq","⋭"],["\\rightharpoondown","⇁"],["\\textperthousand","‰"],["\\leftrightarrows","⇆"],["\\textmusicalnote","♪"],["\\nleftrightarrow","↮"],["\\rightleftarrows","⇄"],["\\bigtriangledown","▽"],["\\textordfeminine","ª"],["\\ntrianglelefteq","⋬"],["\\rightthreetimes","⋌"],["\\trianglerighteq","⊵"],["\\vartriangleleft","⊲"],["\\rightsquigarrow","⇝"],["\\downharpoonleft","⇃"],["\\curvearrowright","↷"],["\\circlearrowleft","↺"],["\\leftharpoondown","↽"],["\\nLeftrightarrow","⇎"],["\\curvearrowleft","↶"],["\\guilsinglright","›"],["\\leftthreetimes","⋋"],["\\leftrightarrow","↔"],["\\rightharpoonup","⇀"],["\\guillemotright","»"],["\\downdownarrows","⇊"],["\\hookrightarrow","↪"],["\\hspace{0.25em}"," "],["\\dashrightarrow","⇢"],["\\leftleftarrows","⇇"],["\\trianglelefteq","⊴"],["\\ntriangleright","⋫"],["\\doublebarwedge","⌆"],["\\upharpoonright","↾"],["\\rightarrowtail","↣"],["\\looparrowright","↬"],["\\Leftrightarrow","⇔"],["\\sphericalangle","∢"],["\\divideontimes","⋇"],["\\measuredangle","∡"],["\\blacktriangle","▴"],["\\ntriangleleft","⋪"],["\\mathchar\"1356","⁁"],["\\texttrademark","™"],["\\mathchar\"2208","⌖"],["\\triangleright","▹"],["\\leftarrowtail","↢"],["\\guilsinglleft","‹"],["\\upharpoonleft","↿"],["\\mathbb{gamma}","ℽ"],["\\fallingdotseq","≒"],["\\looparrowleft","↫"],["\\textbrokenbar","¦"],["\\hookleftarrow","↩"],["\\smallsetminus","﹨"],["\\dashleftarrow","⇠"],["\\guillemotleft","«"],["\\leftharpoonup","↼"],["\\mathbb{Gamma}","ℾ"],["\\bigtriangleup","△"],["\\textcircledP","℗"],["\\risingdotseq","≓"],["\\triangleleft","◃"],["\\mathsterling","£"],["\\textcurrency","¤"],["\\triangledown","▿"],["\\blacklozenge",""],["\\sfrac{5}{6}","⅚"],["\\preccurlyeq","≼"],["\\Rrightarrow","⇛"],["\\circledcirc","⊚"],["\\nRightarrow","⇏"],["\\sfrac{3}{8}","⅜"],["\\sfrac{1}{3}","⅓"],["\\sfrac{2}{5}","⅖"],["\\vartriangle","▵"],["\\Updownarrow","⇕"],["\\nrightarrow","↛"],["\\sfrac{1}{2}","½"],["\\sfrac{3}{5}","⅗"],["\\succcurlyeq","≽"],["\\sfrac{4}{5}","⅘"],["\\diamondsuit","♦"],["\\hphantom{0}"," "],["\\sfrac{1}{6}","⅙"],["\\curlyeqsucc","⋟"],["\\blacksquare","▪"],["\\hphantom{,}"," "],["\\curlyeqprec","⋞"],["\\sfrac{1}{8}","⅛"],["\\sfrac{7}{8}","⅞"],["\\sfrac{1}{5}","⅕"],["\\sfrac{2}{3}","⅔"],["\\updownarrow","↕"],["\\backepsilon","∍"],["\\circleddash","⊝"],["\\eqslantless","⋜"],["\\sfrac{3}{4}","¾"],["\\sfrac{5}{8}","⅝"],["\\hspace{1pt}"," "],["\\sfrac{1}{4}","¼"],["\\mathbb{Pi}","ℿ"],["\\mathcal{M}","ℳ"],["\\mathcal{o}","ȓ4"],["\\mathcal{O}","ᵊA"],["\\nsupseteqq","⊉"],["\\mathcal{B}","ℬ"],["\\textrecipe","℞"],["\\nsubseteqq","⊈"],["\\subsetneqq","⊊"],["\\mathcal{I}","ℑ"],["\\upuparrows","⇈"],["\\mathcal{e}","ℯ"],["\\mathcal{L}","ℒ"],["\\nleftarrow","↚"],["\\mathcal{H}","ℋ"],["\\mathcal{E}","ℰ"],["\\eqslantgtr","⋝"],["\\curlywedge","⋏"],["\\varepsilon","ε"],["\\supsetneqq","⊋"],["\\rightarrow","→"],["\\mathcal{R}","ℛ"],["\\sqsubseteq","⊑"],["\\mathcal{g}","ℊ"],["\\sqsupseteq","⊒"],["\\complement","∁"],["\\Rightarrow","⇒"],["\\gtreqqless","⋛"],["\\lesseqqgtr","⋚"],["\\circledast","⊛"],["\\nLeftarrow","⇍"],["\\Lleftarrow","⇚"],["\\varnothing","∅"],["\\mathcal{N}","𝒩"],["\\Leftarrow","⇐"],["\\gvertneqq","≩"],["\\mathbb{C}","ℂ"],["\\supsetneq","⊋"],["\\leftarrow","←"],["\\nleqslant","≰"],["\\mathbb{Q}","ℚ"],["\\mathbb{Z}","ℤ"],["\\llbracket","〚"],["\\mathbb{H}","ℍ"],["\\spadesuit","♠"],["\\mathit{o}","ℴ"],["\\mathbb{P}","ℙ"],["\\rrbracket","〛"],["\\supseteqq","⊇"],["\\copyright","©"],["\\textsc{k}","ĸ"],["\\gtreqless","⋛"],["\\mathbb{j}","ⅉ"],["\\pitchfork","⋔"],["\\estimated","℮"],["\\ngeqslant","≱"],["\\mathbb{e}","ⅇ"],["\\therefore","∴"],["\\triangleq","≜"],["\\varpropto","∝"],["\\subsetneq","⊊"],["\\heartsuit","♥"],["\\mathbb{d}","ⅆ"],["\\lvertneqq","≨"],["\\checkmark","✓"],["\\nparallel","∦"],["\\mathbb{R}","ℝ"],["\\lesseqgtr","⋚"],["\\downarrow","↓"],["\\mathbb{D}","ⅅ"],["\\mathbb{i}","ⅈ"],["\\backsimeq","⋍"],["\\mathbb{N}","ℕ"],["\\Downarrow","⇓"],["\\subseteqq","⊆"],["\\setminus","∖"],["\\succnsim","⋩"],["\\doteqdot","≑"],["\\clubsuit","♣"],["\\emptyset","∅"],["\\sqsupset","⊐"],["\\fbox{~~}","▭"],["\\curlyvee","⋎"],["\\varkappa","ϰ"],["\\llcorner","⌞"],["\\varsigma","ς"],["\\approxeq","≊"],["\\backcong","≌"],["\\supseteq","⊇"],["\\circledS","Ⓢ"],["\\circledR","®"],["\\textcent","¢"],["\\urcorner","⌝"],["\\lrcorner","⌟"],["\\boxminus","⊟"],["\\texteuro","€"],["\\vartheta","ϑ"],["\\barwedge","⊼"],["\\ding{86}","✶"],["\\sqsubset","⊏"],["\\subseteq","⊆"],["\\intercal","⊺"],["\\ding{73}","☆"],["\\ulcorner","⌜"],["\\recorder","⌕"],["\\precnsim","⋨"],["\\parallel","∥"],["\\boxtimes","⊠"],["\\ding{55}","✗"],["\\multimap","⊸"],["\\maltese","✠"],["\\nearrow","↗"],["\\swarrow","↙"],["\\lozenge","◊"],["\\sqrt[3]","∛"],["\\succsim","≿"],["\\dotplus","∔"],["\\tilde{}","~"],["\\check{}","ˇ"],["\\lessgtr","≶"],["\\Upsilon","ϒ"],["\\Cdprime","Ъ"],["\\gtrless","≷"],["\\backsim","∽"],["\\nexists","∄"],["\\dotplus","∔"],["\\searrow","↘"],["\\lessdot","⋖"],["\\boxplus","⊞"],["\\upsilon","υ"],["\\epsilon","ε"],["\\diamond","⋄"],["\\bigstar","★"],["\\ddagger","‡"],["\\cdprime","ъ"],["\\Uparrow","⇑"],["\\sqrt[4]","∜"],["\\between","≬"],["\\sqangle","∟"],["\\digamma","Ϝ"],["\\uparrow","↑"],["\\nwarrow","↖"],["\\precsim","≾"],["\\breve{}","˘"],["\\because","∵"],["\\bigcirc","◯"],["\\acute{}","´"],["\\grave{}","`"],["\\check{}","ˇ"],["\\lesssim","≲"],["\\partial","∂"],["\\natural","♮"],["\\supset","⊃"],["\\hstrok","ħ"],["\\Tstrok","Ŧ"],["\\coprod","∐"],["\\models","⊧"],["\\otimes","⊗"],["\\degree","°"],["\\gtrdot","⋗"],["\\preceq","≼"],["\\Lambda","Λ"],["\\lambda","λ"],["\\cprime","ь"],["\\varrho","ϱ"],["\\Bumpeq","≎"],["\\hybull","⁃"],["\\lmidot","ŀ"],["\\nvdash","⊬"],["\\lbrace","{"],["\\bullet","•"],["\\varphi","φ"],["\\bumpeq","≏"],["\\ddot{}","¨"],["\\Lmidot","Ŀ"],["\\Cprime","Ь"],["\\female","♀"],["\\rtimes","⋊"],["\\gtrsim","≳"],["\\mapsto","↦"],["\\daleth","ℸ"],["\\square","■"],["\\nVDash","⊯"],["\\rangle","〉"],["\\tstrok","ŧ"],["\\oslash","⊘"],["\\ltimes","⋉"],["\\lfloor","⌊"],["\\marker","▮"],["\\Subset","⋐"],["\\Vvdash","⊪"],["\\propto","∝"],["\\Hstrok","Ħ"],["\\dlcrop","⌍"],["\\forall","∀"],["\\nVdash","⊮"],["\\Supset","⋑"],["\\langle","〈"],["\\ominus","⊖"],["\\rfloor","⌋"],["\\circeq","≗"],["\\eqcirc","≖"],["\\drcrop","⌌"],["\\veebar","⊻"],["\\ulcrop","⌏"],["\\nvDash","⊭"],["\\urcrop","⌎"],["\\exists","∃"],["\\approx","≈"],["\\dagger","†"],["\\boxdot","⊡"],["\\succeq","≽"],["\\bowtie","⋈"],["\\subset","⊂"],["\\Sigma","Σ"],["\\Omega","Ω"],["\\nabla","∇"],["\\colon",":"],["\\boxHu","╧"],["\\boxHd","╤"],["\\aleph","ℵ"],["\\gnsim","⋧"],["\\boxHU","╩"],["\\boxHD","╦"],["\\equiv","≡"],["\\lneqq","≨"],["\\alpha","α"],["\\amalg","∐"],["\\boxhU","╨"],["\\boxhD","╥"],["\\uplus","⊎"],["\\boxhu","┴"],["\\kappa","κ"],["\\sigma","σ"],["\\boxDL","╗"],["\\Theta","Θ"],["\\Vdash","⊩"],["\\boxDR","╔"],["\\boxDl","╖"],["\\sqcap","⊓"],["\\boxDr","╓"],["\\bar{}","¯"],["\\dashv","⊣"],["\\vDash","⊨"],["\\boxdl","┐"],["\\boxVl","╢"],["\\boxVh","╫"],["\\boxVr","╟"],["\\boxdr","┌"],["\\boxdL","╕"],["\\boxVL","╣"],["\\boxVH","╬"],["\\boxVR","╠"],["\\boxdR","╒"],["\\theta","θ"],["\\lhblk","▄"],["\\uhblk","▀"],["\\ldotp","."],["\\ldots","…"],["\\boxvL","╡"],["\\boxvH","╪"],["\\boxvR","╞"],["\\boxvl","┤"],["\\boxvh","┼"],["\\boxvr","├"],["\\Delta","Δ"],["\\boxUR","╚"],["\\boxUL","╝"],["\\oplus","⊕"],["\\boxUr","╙"],["\\boxUl","╜"],["\\doteq","≐"],["\\happy","㋡"],["\\varpi","ϖ"],["\\smile","☺"],["\\boxul","┘"],["\\simeq","≃"],["\\boxuR","╘"],["\\boxuL","╛"],["\\boxhd","┬"],["\\gimel","ℷ"],["\\Gamma","Γ"],["\\lnsim","⋦"],["\\sqcup","⊔"],["\\omega","ω"],["\\sharp","♯"],["\\times","×"],["\\block","█"],["\\hat{}","^"],["\\wedge","∧"],["\\vdash","⊢"],["\\angle","∠"],["\\infty","∞"],["\\gamma","γ"],["\\asymp","≍"],["\\rceil","⌉"],["\\dot{}","˙"],["\\lceil","⌈"],["\\delta","δ"],["\\gneqq","≩"],["\\frown","⌢"],["\\phone","☎"],["\\vdots","⋮"],["\\boxr","└"],["\\k{i}","į"],["\\`{I}","Ì"],["\\perp","⊥"],["\\\"{o}","ö"],["\\={I}","Ī"],["\\`{a}","à"],["\\v{T}","Ť"],["\\surd","√"],["\\H{O}","Ő"],["\\vert","|"],["\\k{I}","Į"],["\\\"{y}","ÿ"],["\\\"{O}","Ö"],["\\'{Y}","Ý"],["\\u{u}","ў"],["\\u{G}","Ğ"],["\\.{E}","Ė"],["\\.{z}","ż"],["\\v{t}","ť"],["\\prec","≺"],["\\H{o}","ő"],["\\mldr","…"],["\\'{y}","ý"],["\\cong","≅"],["\\.{e}","ė"],["\\'{L}","Ĺ"],["\\star","*"],["\\.{Z}","Ż"],["\\'{e}","é"],["\\geqq","≧"],["\\cdot","⋅"],["\\`{U}","Ù"],["\\'{l}","ĺ"],["\\v{L}","Ľ"],["\\c{s}","ş"],["\\'{s}","ś"],["\\~{A}","Ã"],["\\Vert","‖"],["\\k{e}","ę"],["\\lnot","¬"],["\\'{z}","ź"],["\\leqq","≦"],["\\beta","β"],["\\beth","ℶ"],["\\'{E}","É"],["\\~{n}","ñ"],["\\u{i}","й"],["\\c{S}","Ş"],["\\c{N}","Ņ"],["\\H{u}","ű"],["\\v{n}","ň"],["\\'{S}","Ś"],["\\={U}","Ū"],["\\~{O}","Õ"],["\\'{Z}","Ź"],["\\v{E}","Ě"],["\\'{R}","Ŕ"],["\\H{U}","Ű"],["\\v{N}","Ň"],["\\prod","∏"],["\\v{s}","š"],["\\\"{U}","Ü"],["\\c{n}","ņ"],["\\k{U}","Ų"],["\\c{R}","Ŗ"],["\\'{A}","Á"],["\\~{o}","õ"],["\\v{e}","ě"],["\\v{S}","Š"],["\\u{A}","Ă"],["\\circ","∘"],["\\\"{u}","ü"],["\\flat","♭"],["\\v{z}","ž"],["\\r{U}","Ů"],["\\`{O}","Ò"],["\\={u}","ū"],["\\oint","∮"],["\\c{K}","Ķ"],["\\k{u}","ų"],["\\not<","≮"],["\\not>","≯"],["\\`{o}","ò"],["\\\"{I}","Ï"],["\\v{D}","Ď"],["\\.{G}","Ġ"],["\\r{u}","ů"],["\\not=","≠"],["\\`{u}","ù"],["\\v{c}","č"],["\\c{k}","ķ"],["\\.{g}","ġ"],["\\'{N}","Ń"],["\\odot","⊙"],["\\`{e}","э"],["\\c{T}","Ţ"],["\\v{d}","ď"],["\\\"{e}","ё"],["\\'{I}","Í"],["\\v{R}","Ř"],["\\k{a}","ą"],["\\nldr","‥"],["\\`{A}","À"],["\\'{n}","ń"],["\\~{N}","Ñ"],["\\nmid","∤"],["\\.{C}","Ċ"],["\\zeta","ζ"],["\\~{u}","ũ"],["\\`{E}","Э"],["\\~{a}","ã"],["\\c{t}","ţ"],["\\={o}","ō"],["\\v{r}","ř"],["\\={A}","Ā"],["\\.{c}","ċ"],["\\~{U}","Ũ"],["\\k{A}","Ą"],["\\\"{a}","ä"],["\\u{U}","Ў"],["\\iota","ι"],["\\={O}","Ō"],["\\c{C}","Ç"],["\\gneq","≩"],["\\'{c}","ć"],["\\boxH","═"],["\\hbar","ℏ"],["\\\"{A}","Ä"],["\\boxv","│"],["\\boxh","─"],["\\male","♂"],["\\'{u}","ú"],["\\sqrt","√"],["\\succ","≻"],["\\c{c}","ç"],["\\'{C}","Ć"],["\\v{l}","ľ"],["\\u{a}","ă"],["\\v{Z}","Ž"],["\\'{o}","ó"],["\\c{G}","Ģ"],["\\v{C}","Č"],["\\lneq","≨"],["\\\"{E}","Ё"],["\\={a}","ā"],["\\c{l}","ļ"],["\\'{a}","á"],["\\={E}","Ē"],["\\boxV","║"],["\\u{g}","ğ"],["\\'{O}","Ó"],["\\'{g}","ǵ"],["\\u{I}","Й"],["\\c{L}","Ļ"],["\\k{E}","Ę"],["\\.{I}","İ"],["\\~{I}","Ĩ"],["\\quad"," "],["\\c{r}","ŗ"],["\\'{r}","ŕ"],["\\\"{Y}","Ÿ"],["\\={e}","ē"],["\\'{U}","Ú"],["\\leq","≤"],["\\Cup","⋓"],["\\Psi","Ψ"],["\\neq","≠"],["\\k{}","˛"],["\\={}","‾"],["\\H{}","˝"],["\\cup","∪"],["\\geq","≥"],["\\mho","℧"],["\\Dzh","Џ"],["\\cap","∩"],["\\bot","⊥"],["\\psi","ψ"],["\\chi","χ"],["\\c{}","¸"],["\\Phi","Φ"],["\\ast","*"],["\\ell","ℓ"],["\\top","⊤"],["\\lll","⋘"],["\\tau","τ"],["\\Cap","⋒"],["\\sad","☹"],["\\iff","⇔"],["\\eta","η"],["\\eth","ð"],["\\d{}","̣"],["\\rho","ρ"],["\\dzh","џ"],["\\div","÷"],["\\phi","ϕ"],["\\Rsh","↱"],["\\vee","∨"],["\\b{}","ˍ"],["\\t{}","͡"],["\\int","∫"],["\\sim","∼"],["\\r{}","˚"],["\\Lsh","↰"],["\\yen","¥"],["\\ggg","⋙"],["\\mid","∣"],["\\sum","∑"],["\\Dz","Ѕ"],["\\Re","ℜ"],["\\oe","œ"],["\\DH","Ð"],["\\ll","≪"],["\\ng","ŋ"],["\\'G","Ѓ"],["\\wr","≀"],["\\wp","℘"],["\\=I","І"],["\\:)","☺"],["\\:(","☹"],["\\AE","Æ"],["\\AA","Å"],["\\ss","ß"],["\\dz","ѕ"],["\\ae","æ"],["\\aa","å"],["\\th","þ"],["\\to","→"],["\\Pi","Π"],["\\mp","∓"],["\\Im","ℑ"],["\\pm","±"],["\\pi","π"],["\\\"I","Ї"],["\\'C","Ћ"],["\\in","∈"],["\\'K","Ќ"],["\\'k","ќ"],["\\'c","ћ"],["\\'g","ѓ"],["\\ni","∋"],["\\ne","≠"],["\\TH","Þ"],["\\Xi","Ξ"],["\\nu","ν"],["\\NG","Ŋ"],["\\:G","㋡"],["\\xi","ξ"],["\\OE","Œ"],["\\gg","≫"],["\\DJ","Đ"],["\\=e","є"],["\\=E","Є"],["\\mu","μ"],["\\dj","đ"],["\\:"," "],["\\;"," "],["\\&","&"],["\\$","$"],["\\%","%"],["\\#","#"],["\\,"," "],["\\-",""],["\\S","§"],["\\P","¶"],["\\O","Ø"],["\\L","Ł"],["\\}","}"],["\\o","ø"],["\\l","ł"],["\\h","ℎ"],["\\i","ℹ"],["-","−"]],"combiningmarks":[["\\doubleunderline","̳"],["\\strikethrough","̵"],["\\underline","̲"],["\\overline","̅"],["\\tilde","̃"],["\\grave","̀"],["\\acute","́"],["\\slash","̸"],["\\breve","̆"],["\\ddot","̈"],["\\dot","̇"],["\\bar","̅"],["\\vec","⃗"],["\\hat","̂"]],"subsuperscripts":[["_x","ₓ"],["_v","ᵥ"],["_u","ᵤ"],["_t","ₜ"],["_s","ₛ"],["_r","ᵣ"],["_p","ₚ"],["_o","ₒ"],["_n","ₙ"],["_m","ₘ"],["_l","ₗ"],["_k","ₖ"],["_j","ⱼ"],["_i","ᵢ"],["_h","ₕ"],["_e","ₑ"],["_a","ₐ"],["^∫","ᶴ"],["_>","˲"],["_=","₌"],["_<","˱"],["_9","₉"],["_8","₈"],["_7","₇"],["_6","₆"],["_5","₅"],["_4","₄"],["_3","₃"],["_2","₂"],["_1","₁"],["_0","₀"],["_-","₋"],["_−","₋"],["_+","₊"],["_)","₎"],["_(","₍"],["_ρ","ᵨ"],["_χ","ᵪ"],["_φ","ᵩ"],["_β","ᵦ"],["_γ","ᵧ"],["^φ","ᵠ"],["^χ","ᵡ"],["^δ","ᵟ"],["^γ","ᵞ"],["^β","ᵝ"],["^8","⁸"],["^9","⁹"],["^<","˂"],["^=","⁼"],["^>","˃"],["^0","⁰"],["^1","¹"],["^2","²"],["^3","³"],["^4","⁴"],["^5","⁵"],["^6","⁶"],["^7","⁷"],["^(","⁽"],["^)","⁾"],["^*","*"],["^+","⁺"],["^-","⁻"],["^−","⁻"],["^P","ᴾ"],["^R","ᴿ"],["^T","ᵀ"],["^U","ᵁ"],["^V","ᄑ"],["^W","ᵂ"],["^H","ᴴ"],["^I","ᴵ"],["^J","ᴶ"],["^K","ᴷ"],["^L","ᴸ"],["^M","ᴹ"],["^N","ᴺ"],["^O","ᴼ"],["^A","ᴬ"],["^B","ᴮ"],["^D","ᴰ"],["^E","ᴱ"],["^G","ᴳ"],["^x","ˣ"],["^y","ʸ"],["^z","ᶻ"],["^p","ᵖ"],["^r","ʳ"],["^s","ˢ"],["^t","ᵗ"],["^u","ᵘ"],["^v","ᵛ"],["^w","ʷ"],["^h","ʰ"],["^i","ⁱ"],["^j","ʲ"],["^k","ᵏ"],["^l","ˡ"],["^m","ᵐ"],["^n","ⁿ"],["^o","ᵒ"],["^a","ᵃ"],["^b","ᵇ"],["^c","ᶜ"],["^d","ᵈ"],["^e","ᵉ"],["^f","ᶠ"],["^g","ᵍ"]]}
|
data/kramdown-rfc2629.gemspec
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
3
|
-
s.version = '1.3.
|
3
|
+
s.version = '1.3.20'
|
4
4
|
s.summary = "Kramdown extension for generating RFC 7749 XML."
|
5
5
|
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
7
7
|
s.add_dependency('kramdown', '~> 1.17.0')
|
8
8
|
s.add_dependency('certified', '~> 1.0')
|
9
|
-
s.
|
9
|
+
s.add_dependency('json', '~> 2.0')
|
10
|
+
s.files = Dir['lib/**/*.rb'] + %w(README.md LICENSE kramdown-rfc2629.gemspec bin/kdrfc bin/kramdown-rfc2629 bin/doilit bin/kramdown-rfc-extract-markdown data/kramdown-rfc2629.erb data/encoding-fallbacks.txt data/math.json)
|
10
11
|
s.require_path = 'lib'
|
11
12
|
s.executables = ['kramdown-rfc2629', 'doilit', 'kramdown-rfc-extract-markdown', 'kdrfc']
|
12
13
|
s.required_ruby_version = '>= 2.3.0'
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
# This derived work is also licensed under the MIT license, see LICENSE.
|
9
9
|
#++
|
10
10
|
#
|
11
|
+
require 'shellwords'
|
11
12
|
|
12
13
|
raise "sorry, 1.8 was last decade" unless RUBY_VERSION >= '1.9'
|
13
14
|
|
@@ -18,6 +19,7 @@ Kramdown::Parser::Html::Constants::HTML_SPAN_ELEMENTS.concat my_span_elements
|
|
18
19
|
|
19
20
|
require 'rexml/parsers/baseparser'
|
20
21
|
require 'open3' # for math
|
22
|
+
require 'json' # for math
|
21
23
|
|
22
24
|
class Object
|
23
25
|
def deep_clone
|
@@ -235,6 +237,14 @@ COLORS
|
|
235
237
|
out
|
236
238
|
end
|
237
239
|
|
240
|
+
def capture_croak(t, err)
|
241
|
+
if err != ''
|
242
|
+
err.lines do |l|
|
243
|
+
warn "*** [#{t}:] #{l.chomp}"
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
238
248
|
def svg_tool_process(t, result)
|
239
249
|
require 'tempfile'
|
240
250
|
file = Tempfile.new("kramdown-rfc")
|
@@ -242,27 +252,34 @@ COLORS
|
|
242
252
|
file.close
|
243
253
|
case t
|
244
254
|
when "goat"
|
245
|
-
result1, _s = Open3.
|
255
|
+
result1, err, _s = Open3.capture3("goat #{file.path}", stdin_data: result);
|
246
256
|
when "ditaa" # XXX: This needs some form of option-setting
|
247
|
-
result1, _s = Open3.
|
257
|
+
result1, err, _s = Open3.capture3("ditaa #{file.path} --svg -o -", stdin_data: result);
|
248
258
|
when "mscgen"
|
249
|
-
result1, _s = Open3.
|
259
|
+
result1, err, _s = Open3.capture3("mscgen -T svg -i #{file.path} -o -", stdin_data: result);
|
250
260
|
when "mermaid"
|
251
|
-
result1, _s = Open3.
|
261
|
+
result1, err, _s = Open3.capture3("mmdc -i #{file.path}", stdin_data: result); # -b transparent
|
252
262
|
outpath = file.path + ".svg"
|
253
263
|
result1 = File.read(outpath)
|
254
264
|
File.unlink(outpath)
|
255
265
|
when "plantuml", "plantuml-utxt"
|
256
266
|
plantuml = "@startuml\n#{result}\n@enduml"
|
257
|
-
result1, _s = Open3.
|
258
|
-
result, _s = Open3.
|
259
|
-
|
267
|
+
result1, err, _s = Open3.capture3("plantuml -pipe -tsvg", stdin_data: plantuml);
|
268
|
+
result, err1, _s = Open3.capture3("plantuml -pipe -tutxt", stdin_data: plantuml) if t == "plantuml-utxt"
|
269
|
+
err << err1
|
270
|
+
when "math"
|
271
|
+
result1, err, _s = Open3.capture3("tex2svg --font STIX --speech=false #{Shellwords.escape(' ' << result)}");
|
272
|
+
result, err1, _s = Open3.capture3("asciitex -f #{file.path}")
|
273
|
+
err << err1
|
274
|
+
end
|
275
|
+
capture_croak(t, err)
|
260
276
|
# warn ["goat:", result1.inspect]
|
261
277
|
file.unlink
|
262
278
|
result1 = svg_clean(result1) unless t == "goat"
|
263
|
-
result1, _s = Open3.
|
279
|
+
result1, err, _s = Open3.capture3("svgcheck -qa", stdin_data: result1);
|
280
|
+
capture_croak("svgcheck", err)
|
264
281
|
# warn ["svgcheck:", result1.inspect]
|
265
|
-
[result, result1]
|
282
|
+
[result, result1] # text, svg
|
266
283
|
end
|
267
284
|
|
268
285
|
def convert_codeblock(el, indent, opts)
|
@@ -309,7 +326,7 @@ COLORS
|
|
309
326
|
end
|
310
327
|
end
|
311
328
|
case t
|
312
|
-
when "goat", "ditaa", "mscgen", "plantuml", "plantuml-utxt", "mermaid"
|
329
|
+
when "goat", "ditaa", "mscgen", "plantuml", "plantuml-utxt", "mermaid", "math"
|
313
330
|
result, result1 = memoize(:svg_tool_process, t, result)
|
314
331
|
"#{' '*indent}<figure#{el_html_attributes(el)}><artset><artwork #{html_attributes(artwork_attr.merge("type"=> "svg"))}>#{result1.sub(/.*?<svg/m, "<svg")}</artwork><artwork #{html_attributes(artwork_attr.merge("type"=> "ascii-art"))}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></artwork></artset></figure>\n"
|
315
332
|
else
|
@@ -356,8 +373,15 @@ COLORS
|
|
356
373
|
if options[:auto_ids] && !el.attr['anchor']
|
357
374
|
el.attr['anchor'] = saner_generate_id(el.options[:raw_text])
|
358
375
|
end
|
376
|
+
if $options.v3
|
377
|
+
if sl = el.attr.delete('slugifiedName') # could do general name- play
|
378
|
+
attrstring = html_attributes({'slugifiedName' => sl})
|
379
|
+
end
|
380
|
+
irefs = "<name#{attrstring}>#{inner(el, indent, opts)}</name>" #
|
381
|
+
else
|
359
382
|
clean, irefs = clean_pcdata(inner_a(el, indent, opts))
|
360
383
|
el.attr['title'] = clean
|
384
|
+
end
|
361
385
|
"#{end_sections(el.options[:level], indent)}#{' '*indent}<section#{@sec_level += 1; el_html_attributes(el)}>#{irefs}\n"
|
362
386
|
end
|
363
387
|
|
@@ -377,7 +401,18 @@ COLORS
|
|
377
401
|
end
|
378
402
|
end
|
379
403
|
alias :convert_ol :convert_ul
|
380
|
-
|
404
|
+
|
405
|
+
def convert_dl(el, indent, opts)
|
406
|
+
if $options.v3
|
407
|
+
vspace = el.attr.delete('vspace')
|
408
|
+
if vspace && !el.attr['newline']
|
409
|
+
el.attr['newline'] = 'true'
|
410
|
+
end
|
411
|
+
"#{' '*indent}<dl#{el_html_attributes(el)}>\n#{inner(el, indent, opts.dup)}#{' '*indent}</dl>\n"
|
412
|
+
else
|
413
|
+
convert_ul(el, indent, opts)
|
414
|
+
end
|
415
|
+
end
|
381
416
|
|
382
417
|
def convert_li(el, indent, opts)
|
383
418
|
res_a = inner_a(el, indent, opts)
|
@@ -392,7 +427,16 @@ COLORS
|
|
392
427
|
end
|
393
428
|
"#{' '*indent}<t#{el_html_attributes(el)}>#{res}#{(res =~ /\n\Z/ ? ' '*indent : '')}</t>\n"
|
394
429
|
end
|
430
|
+
|
395
431
|
def convert_dd(el, indent, opts)
|
432
|
+
if $options.v3
|
433
|
+
out = ''
|
434
|
+
if !opts[:haddt]
|
435
|
+
out ="#{' '*indent}<dt/>\n" # you can't make this one up
|
436
|
+
end
|
437
|
+
opts[:haddt] = false
|
438
|
+
out << "#{' '*indent}<dd#{el_html_attributes(el)}>\n#{inner(el, indent, opts)}#{' '*indent}</dd>\n"
|
439
|
+
else
|
396
440
|
output = ' '*indent
|
397
441
|
if @in_dt == 1
|
398
442
|
@in_dt = 0
|
@@ -406,15 +450,25 @@ COLORS
|
|
406
450
|
# output << "\n" << res << ' '*indent
|
407
451
|
# end
|
408
452
|
output << "</t>\n"
|
453
|
+
end
|
409
454
|
end
|
410
455
|
|
411
456
|
def convert_dt(el, indent, opts) # SERIOUSLY BAD HACK:
|
457
|
+
if $options.v3
|
458
|
+
out = ''
|
459
|
+
if opts[:haddt]
|
460
|
+
out ="#{' '*indent}<dd><t/></dd>\n" # you can't make this one up
|
461
|
+
end
|
462
|
+
opts[:haddt] = true
|
463
|
+
out << "#{' '*indent}<dt#{el_html_attributes(el)}>\n#{inner(el, indent, opts)}#{' '*indent}</dt>\n"
|
464
|
+
else
|
412
465
|
close = "#{' '*indent}</t>\n" * @in_dt
|
413
466
|
@in_dt = 1
|
414
467
|
vspace = opts[:vspace]
|
415
468
|
vspaceel = "<vspace blankLines='#{vspace}'/>" if vspace
|
416
469
|
ht = escape_html(inner(el, indent, opts), :attribute) # XXX this may leave gunk
|
417
|
-
"#{close}#{' '*indent}<t#{el_html_attributes(el)} hangText
|
470
|
+
"#{close}#{' '*indent}<t#{el_html_attributes(el)} hangText=\"#{ht}\">#{vspaceel}\n"
|
471
|
+
end
|
418
472
|
end
|
419
473
|
|
420
474
|
HTML_TAGS_WITH_BODY=['div', 'script']
|
@@ -705,9 +759,14 @@ COLORS
|
|
705
759
|
EMPH = { em: "emph", strong: "strong"}
|
706
760
|
|
707
761
|
def convert_em(el, indent, opts)
|
762
|
+
if $options.v3
|
763
|
+
gi = el.type
|
764
|
+
"<#{gi}#{el_html_attributes(el)}>#{inner(el, indent, opts)}</#{gi}>"
|
765
|
+
else
|
708
766
|
attrstring = el_html_attributes_with(el, {"style" => EMPH[el.type]})
|
709
767
|
span, irefs = clean_pcdata(inner_a(el, indent, opts))
|
710
768
|
"<spanx#{attrstring}>#{span}</spanx>#{irefs}"
|
769
|
+
end
|
711
770
|
end
|
712
771
|
alias :convert_strong :convert_em
|
713
772
|
|
@@ -736,6 +795,23 @@ COLORS
|
|
736
795
|
entity_to_str(smart_quote_entity(el))
|
737
796
|
end
|
738
797
|
|
798
|
+
MATH_LATEX_FILENAME = File.expand_path '../../data/math.json', __FILE__
|
799
|
+
MATH_LATEX = JSON.parse(File.read(MATH_LATEX_FILENAME, encoding: Encoding::UTF_8))
|
800
|
+
MATH_REPLACEMENTS = MATH_LATEX["replacements"]
|
801
|
+
MATH_COMBININGMARKS = MATH_LATEX["combiningmarks"]
|
802
|
+
|
803
|
+
def munge_latex(s)
|
804
|
+
MATH_REPLACEMENTS.each do |o, n|
|
805
|
+
s.gsub!(o, n)
|
806
|
+
end
|
807
|
+
MATH_COMBININGMARKS.each do |m, n|
|
808
|
+
re = /\\#{m[1..-1]}\{(\X)\}/
|
809
|
+
s.gsub!(re) { "#$1#{n}" }
|
810
|
+
end
|
811
|
+
s
|
812
|
+
end
|
813
|
+
# XXX: This is missing sup/sub support, which needs to be added
|
814
|
+
|
739
815
|
def convert_math(el, indent, opts) # XXX: This is wrong
|
740
816
|
el = el.deep_clone
|
741
817
|
if el.options[:category] == :block
|
@@ -748,15 +824,24 @@ COLORS
|
|
748
824
|
artwork_attr[md[1]] = v
|
749
825
|
end
|
750
826
|
end
|
751
|
-
result, _s = Open3.
|
827
|
+
result, err, _s = Open3.capture3("tex2mail -noindent -ragged -by_par -linelength=69", stdin_data: el.value);
|
752
828
|
# warn "*** tex2mail not in path?" unless s.success? -- doesn't have useful status
|
829
|
+
capture_croak("tex2mail", err)
|
753
830
|
"#{' '*indent}<figure#{el_html_attributes(el)}><artwork#{html_attributes(artwork_attr)}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></artwork></figure>\n"
|
754
831
|
|
755
832
|
else
|
756
|
-
warn "*** no support for inline math in XML2RFCv2"
|
757
833
|
type = 'spanx'
|
758
|
-
|
759
|
-
|
834
|
+
if $options.v3
|
835
|
+
type = 'contact'
|
836
|
+
result = munge_latex(el.value)
|
837
|
+
attrstring = el_html_attributes_with(el, {"fullname" => result.chomp, "asciiFullname" => ''})
|
838
|
+
else
|
839
|
+
warn "*** no support for inline math in XML2RFCv2"
|
840
|
+
type = 'spanx'
|
841
|
+
attrstring = el_html_attributes_with(el, {"style" => 'verb'})
|
842
|
+
content = escape_html(el.value, :text)
|
843
|
+
end
|
844
|
+
"<#{type}#{attrstring}>#{content}</#{type}>"
|
760
845
|
end
|
761
846
|
end
|
762
847
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown-rfc2629
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
41
55
|
description: |-
|
42
56
|
An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
43
57
|
"kramdown" markdown parser. Mostly useful for RFC writers.
|
@@ -58,6 +72,7 @@ files:
|
|
58
72
|
- bin/kramdown-rfc2629
|
59
73
|
- data/encoding-fallbacks.txt
|
60
74
|
- data/kramdown-rfc2629.erb
|
75
|
+
- data/math.json
|
61
76
|
- kramdown-rfc2629.gemspec
|
62
77
|
- lib/kramdown-rfc/gzip-clone.rb
|
63
78
|
- lib/kramdown-rfc/parameterset.rb
|
@@ -82,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
97
|
- !ruby/object:Gem::Version
|
83
98
|
version: '0'
|
84
99
|
requirements: []
|
85
|
-
rubygems_version: 3.1.
|
100
|
+
rubygems_version: 3.1.4
|
86
101
|
signing_key:
|
87
102
|
specification_version: 4
|
88
103
|
summary: Kramdown extension for generating RFC 7749 XML.
|