kramdown-rfc2629 1.3.16 → 1.3.22
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 +156 -17
- 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: c27c4d709e85cd390f830f4eefcc99f9f133a6b7ba6bf9a35bd9545588c373a9
|
4
|
+
data.tar.gz: edb598ba6639f55f473ef8dde927a435522d8b22b7fda4d46f14134ce4aaca8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 966de445a5c3b61db77e61fc500ba9eed670cfb67fe710f80bf23ec33f1bf96f67891a4b50112c957198f83c2a8aa7f798342d9002bde3fc77722d82e10436da
|
7
|
+
data.tar.gz: 92983b9282b11a77a5633ee8d172d4cdfd2f03a852f788b447be84f750256c4bbba81e38518dfbf5c5dfdf4f2480f17fdbf3fce7f33fb7e1614b582d4426f722
|
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.22'
|
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
|
@@ -37,7 +39,36 @@ module Kramdown
|
|
37
39
|
@span_parsers.unshift(:iref)
|
38
40
|
end
|
39
41
|
|
40
|
-
|
42
|
+
SECTIONS_RE = /Section(?:s (?:[\w.]+, )*[\w.]+,? and)? [\w.]+/
|
43
|
+
|
44
|
+
def handle_bares(s, attr, format, href)
|
45
|
+
sa = s.sub(/\A\S+\s/, '').split(/,? and /)
|
46
|
+
sa[0..0] = *sa[0].split(', ')
|
47
|
+
sz = sa.size
|
48
|
+
if sz != 1 # we have to redo xml2rfc's work here
|
49
|
+
@tree.children << Element.new(:text, "Sections ", {}) # XXX needs to split into Section/Appendix
|
50
|
+
sa.each_with_index do |sec, i|
|
51
|
+
attr1 = {"target" => href, "section" => sec, "sectionFormat" => "bare"}
|
52
|
+
@tree.children << Element.new(:xref, nil, attr1)
|
53
|
+
text = if i == 0 && sz == 2
|
54
|
+
" and "
|
55
|
+
elsif i == sz-1
|
56
|
+
" of "
|
57
|
+
elsif i == sz-2
|
58
|
+
", and "
|
59
|
+
else
|
60
|
+
", "
|
61
|
+
end
|
62
|
+
@tree.children << Element.new(:text, text, {})
|
63
|
+
end
|
64
|
+
# attr stays unchanged, no section added
|
65
|
+
else
|
66
|
+
attr['section'] = sa[-1]
|
67
|
+
attr['sectionFormat'] = format
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
XREF_START = /\{\{(?:(?:\{(.*?)\}(?:\{(.*?)\})?)|(\X*?))((?:\}\})|\})/u
|
41
72
|
|
42
73
|
# Introduce new {{target}} syntax for empty xrefs, which would
|
43
74
|
# otherwise be an ugly  or 
|
@@ -55,8 +86,28 @@ module Kramdown
|
|
55
86
|
el = Element.new(:contact, nil, attr)
|
56
87
|
else
|
57
88
|
href = @src[3]
|
89
|
+
attr = {}
|
90
|
+
if $options.v3
|
91
|
+
# match Section ... of ...; set section, sectionFormat
|
92
|
+
case href.gsub(/[\u00A0\s]+/, ' ') # may need nbsp and/or newlines
|
93
|
+
when /\A(#{SECTIONS_RE}) of (.*)\z/
|
94
|
+
href = $2
|
95
|
+
handle_bares($1, attr, "of", href)
|
96
|
+
when /\A(.*), (#{SECTIONS_RE})\z/
|
97
|
+
href = $1
|
98
|
+
handle_bares($2, attr, "comma", href)
|
99
|
+
when /\A(.*) \((#{SECTIONS_RE})\)\z/
|
100
|
+
href = $1
|
101
|
+
handle_bares($2, attr, "parens", href)
|
102
|
+
when /\A([\w.]+)<(.*)\z/
|
103
|
+
href = $2
|
104
|
+
attr['section'] = $1
|
105
|
+
attr['sectionFormat'] = 'bare'
|
106
|
+
end
|
107
|
+
end
|
58
108
|
href = href.gsub(/\A[0-9]/) { "_#{$&}" } # can't start an IDREF with a number
|
59
|
-
|
109
|
+
attr['target'] = href
|
110
|
+
el = Element.new(:xref, nil, attr)
|
60
111
|
end
|
61
112
|
@tree.children << el
|
62
113
|
end
|
@@ -235,6 +286,14 @@ COLORS
|
|
235
286
|
out
|
236
287
|
end
|
237
288
|
|
289
|
+
def capture_croak(t, err)
|
290
|
+
if err != ''
|
291
|
+
err.lines do |l|
|
292
|
+
warn "*** [#{t}:] #{l.chomp}"
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
238
297
|
def svg_tool_process(t, result)
|
239
298
|
require 'tempfile'
|
240
299
|
file = Tempfile.new("kramdown-rfc")
|
@@ -242,27 +301,34 @@ COLORS
|
|
242
301
|
file.close
|
243
302
|
case t
|
244
303
|
when "goat"
|
245
|
-
result1, _s = Open3.
|
304
|
+
result1, err, _s = Open3.capture3("goat #{file.path}", stdin_data: result);
|
246
305
|
when "ditaa" # XXX: This needs some form of option-setting
|
247
|
-
result1, _s = Open3.
|
306
|
+
result1, err, _s = Open3.capture3("ditaa #{file.path} --svg -o -", stdin_data: result);
|
248
307
|
when "mscgen"
|
249
|
-
result1, _s = Open3.
|
308
|
+
result1, err, _s = Open3.capture3("mscgen -T svg -i #{file.path} -o -", stdin_data: result);
|
250
309
|
when "mermaid"
|
251
|
-
result1, _s = Open3.
|
310
|
+
result1, err, _s = Open3.capture3("mmdc -i #{file.path}", stdin_data: result); # -b transparent
|
252
311
|
outpath = file.path + ".svg"
|
253
312
|
result1 = File.read(outpath)
|
254
313
|
File.unlink(outpath)
|
255
314
|
when "plantuml", "plantuml-utxt"
|
256
315
|
plantuml = "@startuml\n#{result}\n@enduml"
|
257
|
-
result1, _s = Open3.
|
258
|
-
result, _s = Open3.
|
259
|
-
|
316
|
+
result1, err, _s = Open3.capture3("plantuml -pipe -tsvg", stdin_data: plantuml);
|
317
|
+
result, err1, _s = Open3.capture3("plantuml -pipe -tutxt", stdin_data: plantuml) if t == "plantuml-utxt"
|
318
|
+
err << err1
|
319
|
+
when "math"
|
320
|
+
result1, err, _s = Open3.capture3("tex2svg --font STIX --speech=false #{Shellwords.escape(' ' << result)}");
|
321
|
+
result, err1, _s = Open3.capture3("asciitex -f #{file.path}")
|
322
|
+
err << err1
|
323
|
+
end
|
324
|
+
capture_croak(t, err)
|
260
325
|
# warn ["goat:", result1.inspect]
|
261
326
|
file.unlink
|
262
327
|
result1 = svg_clean(result1) unless t == "goat"
|
263
|
-
result1, _s = Open3.
|
328
|
+
result1, err, _s = Open3.capture3("svgcheck -qa", stdin_data: result1);
|
329
|
+
capture_croak("svgcheck", err)
|
264
330
|
# warn ["svgcheck:", result1.inspect]
|
265
|
-
[result, result1]
|
331
|
+
[result, result1] # text, svg
|
266
332
|
end
|
267
333
|
|
268
334
|
def convert_codeblock(el, indent, opts)
|
@@ -309,7 +375,7 @@ COLORS
|
|
309
375
|
end
|
310
376
|
end
|
311
377
|
case t
|
312
|
-
when "goat", "ditaa", "mscgen", "plantuml", "plantuml-utxt", "mermaid"
|
378
|
+
when "goat", "ditaa", "mscgen", "plantuml", "plantuml-utxt", "mermaid", "math"
|
313
379
|
result, result1 = memoize(:svg_tool_process, t, result)
|
314
380
|
"#{' '*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
381
|
else
|
@@ -356,8 +422,15 @@ COLORS
|
|
356
422
|
if options[:auto_ids] && !el.attr['anchor']
|
357
423
|
el.attr['anchor'] = saner_generate_id(el.options[:raw_text])
|
358
424
|
end
|
425
|
+
if $options.v3
|
426
|
+
if sl = el.attr.delete('slugifiedName') # could do general name- play
|
427
|
+
attrstring = html_attributes({'slugifiedName' => sl})
|
428
|
+
end
|
429
|
+
irefs = "<name#{attrstring}>#{inner(el, indent, opts)}</name>" #
|
430
|
+
else
|
359
431
|
clean, irefs = clean_pcdata(inner_a(el, indent, opts))
|
360
432
|
el.attr['title'] = clean
|
433
|
+
end
|
361
434
|
"#{end_sections(el.options[:level], indent)}#{' '*indent}<section#{@sec_level += 1; el_html_attributes(el)}>#{irefs}\n"
|
362
435
|
end
|
363
436
|
|
@@ -377,7 +450,23 @@ COLORS
|
|
377
450
|
end
|
378
451
|
end
|
379
452
|
alias :convert_ol :convert_ul
|
380
|
-
|
453
|
+
|
454
|
+
def convert_dl(el, indent, opts)
|
455
|
+
if $options.v3
|
456
|
+
hangindent = el.attr.delete('hangIndent')
|
457
|
+
if hangindent && !$hangindent_seen
|
458
|
+
warn "** Ignoring @hangIndent on <dl> for v3, see https://u.nu/hangindent-dl"
|
459
|
+
$hangindent_seen = true
|
460
|
+
end
|
461
|
+
vspace = el.attr.delete('vspace')
|
462
|
+
if vspace && !el.attr['newline']
|
463
|
+
el.attr['newline'] = 'true'
|
464
|
+
end
|
465
|
+
"#{' '*indent}<dl#{el_html_attributes(el)}>\n#{inner(el, indent, opts.dup)}#{' '*indent}</dl>\n"
|
466
|
+
else
|
467
|
+
convert_ul(el, indent, opts)
|
468
|
+
end
|
469
|
+
end
|
381
470
|
|
382
471
|
def convert_li(el, indent, opts)
|
383
472
|
res_a = inner_a(el, indent, opts)
|
@@ -392,7 +481,16 @@ COLORS
|
|
392
481
|
end
|
393
482
|
"#{' '*indent}<t#{el_html_attributes(el)}>#{res}#{(res =~ /\n\Z/ ? ' '*indent : '')}</t>\n"
|
394
483
|
end
|
484
|
+
|
395
485
|
def convert_dd(el, indent, opts)
|
486
|
+
if $options.v3
|
487
|
+
out = ''
|
488
|
+
if !opts[:haddt]
|
489
|
+
out ="#{' '*indent}<dt/>\n" # you can't make this one up
|
490
|
+
end
|
491
|
+
opts[:haddt] = false
|
492
|
+
out << "#{' '*indent}<dd#{el_html_attributes(el)}>\n#{inner(el, indent, opts)}#{' '*indent}</dd>\n"
|
493
|
+
else
|
396
494
|
output = ' '*indent
|
397
495
|
if @in_dt == 1
|
398
496
|
@in_dt = 0
|
@@ -406,15 +504,25 @@ COLORS
|
|
406
504
|
# output << "\n" << res << ' '*indent
|
407
505
|
# end
|
408
506
|
output << "</t>\n"
|
507
|
+
end
|
409
508
|
end
|
410
509
|
|
411
510
|
def convert_dt(el, indent, opts) # SERIOUSLY BAD HACK:
|
511
|
+
if $options.v3
|
512
|
+
out = ''
|
513
|
+
if opts[:haddt]
|
514
|
+
out ="#{' '*indent}<dd><t/></dd>\n" # you can't make this one up
|
515
|
+
end
|
516
|
+
opts[:haddt] = true
|
517
|
+
out << "#{' '*indent}<dt#{el_html_attributes(el)}>\n#{inner(el, indent, opts)}#{' '*indent}</dt>\n"
|
518
|
+
else
|
412
519
|
close = "#{' '*indent}</t>\n" * @in_dt
|
413
520
|
@in_dt = 1
|
414
521
|
vspace = opts[:vspace]
|
415
522
|
vspaceel = "<vspace blankLines='#{vspace}'/>" if vspace
|
416
523
|
ht = escape_html(inner(el, indent, opts), :attribute) # XXX this may leave gunk
|
417
524
|
"#{close}#{' '*indent}<t#{el_html_attributes(el)} hangText=\"#{ht}\">#{vspaceel}\n"
|
525
|
+
end
|
418
526
|
end
|
419
527
|
|
420
528
|
HTML_TAGS_WITH_BODY=['div', 'script']
|
@@ -705,9 +813,14 @@ COLORS
|
|
705
813
|
EMPH = { em: "emph", strong: "strong"}
|
706
814
|
|
707
815
|
def convert_em(el, indent, opts)
|
816
|
+
if $options.v3
|
817
|
+
gi = el.type
|
818
|
+
"<#{gi}#{el_html_attributes(el)}>#{inner(el, indent, opts)}</#{gi}>"
|
819
|
+
else
|
708
820
|
attrstring = el_html_attributes_with(el, {"style" => EMPH[el.type]})
|
709
821
|
span, irefs = clean_pcdata(inner_a(el, indent, opts))
|
710
822
|
"<spanx#{attrstring}>#{span}</spanx>#{irefs}"
|
823
|
+
end
|
711
824
|
end
|
712
825
|
alias :convert_strong :convert_em
|
713
826
|
|
@@ -736,6 +849,23 @@ COLORS
|
|
736
849
|
entity_to_str(smart_quote_entity(el))
|
737
850
|
end
|
738
851
|
|
852
|
+
MATH_LATEX_FILENAME = File.expand_path '../../data/math.json', __FILE__
|
853
|
+
MATH_LATEX = JSON.parse(File.read(MATH_LATEX_FILENAME, encoding: Encoding::UTF_8))
|
854
|
+
MATH_REPLACEMENTS = MATH_LATEX["replacements"]
|
855
|
+
MATH_COMBININGMARKS = MATH_LATEX["combiningmarks"]
|
856
|
+
|
857
|
+
def munge_latex(s)
|
858
|
+
MATH_REPLACEMENTS.each do |o, n|
|
859
|
+
s.gsub!(o, n)
|
860
|
+
end
|
861
|
+
MATH_COMBININGMARKS.each do |m, n|
|
862
|
+
re = /\\#{m[1..-1]}\{(\X)\}/
|
863
|
+
s.gsub!(re) { "#$1#{n}" }
|
864
|
+
end
|
865
|
+
s
|
866
|
+
end
|
867
|
+
# XXX: This is missing sup/sub support, which needs to be added
|
868
|
+
|
739
869
|
def convert_math(el, indent, opts) # XXX: This is wrong
|
740
870
|
el = el.deep_clone
|
741
871
|
if el.options[:category] == :block
|
@@ -748,15 +878,24 @@ COLORS
|
|
748
878
|
artwork_attr[md[1]] = v
|
749
879
|
end
|
750
880
|
end
|
751
|
-
result, _s = Open3.
|
881
|
+
result, err, _s = Open3.capture3("tex2mail -noindent -ragged -by_par -linelength=69", stdin_data: el.value);
|
752
882
|
# warn "*** tex2mail not in path?" unless s.success? -- doesn't have useful status
|
883
|
+
capture_croak("tex2mail", err)
|
753
884
|
"#{' '*indent}<figure#{el_html_attributes(el)}><artwork#{html_attributes(artwork_attr)}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></artwork></figure>\n"
|
754
885
|
|
755
886
|
else
|
756
|
-
warn "*** no support for inline math in XML2RFCv2"
|
757
887
|
type = 'spanx'
|
758
|
-
|
759
|
-
|
888
|
+
if $options.v3
|
889
|
+
type = 'contact'
|
890
|
+
result = munge_latex(el.value)
|
891
|
+
attrstring = el_html_attributes_with(el, {"fullname" => result.chomp, "asciiFullname" => ''})
|
892
|
+
else
|
893
|
+
warn "*** no support for inline math in XML2RFCv2"
|
894
|
+
type = 'spanx'
|
895
|
+
attrstring = el_html_attributes_with(el, {"style" => 'verb'})
|
896
|
+
content = escape_html(el.value, :text)
|
897
|
+
end
|
898
|
+
"<#{type}#{attrstring}>#{content}</#{type}>"
|
760
899
|
end
|
761
900
|
end
|
762
901
|
|
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.22
|
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-21 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.
|