Attachment 'moin2-mathml.diff'

Download

   1 diff -r 94a0eceff038 MoinMoin/converter2/html_out.py
   2 --- a/MoinMoin/converter2/html_out.py	Tue Aug 10 14:22:42 2010 +0200
   3 +++ b/MoinMoin/converter2/html_out.py	Sat Aug 14 20:32:16 2010 +0200
   4 @@ -13,7 +13,8 @@
   5  from emeraldtree import ElementTree as ET
   6  
   7  from MoinMoin import wikiutil
   8 -from MoinMoin.util.tree import html, moin_page, xlink, xml
   9 +from MoinMoin.util.tree import moin_page, xlink, xml
  10 +from MoinMoin.util.tree import html, svg, mathml
  11  
  12  
  13  class ElementException(RuntimeError):
  14 @@ -34,6 +35,8 @@
  15  class Attributes(object):
  16      namespaces_valid_output = frozenset([
  17          html,
  18 +        svg,
  19 +        mathml,
  20      ])
  21  
  22      visit_class = Attribute('class')
  23 diff -r 94a0eceff038 MoinMoin/converter2/image_in.py
  24 --- a/MoinMoin/converter2/image_in.py	Tue Aug 10 14:22:42 2010 +0200
  25 +++ b/MoinMoin/converter2/image_in.py	Sat Aug 14 20:32:16 2010 +0200
  26 @@ -34,7 +34,7 @@
  27  
  28  from . import default_registry
  29  from MoinMoin.util.mime import Type, type_moin_document
  30 -default_registry.register(Converter._factory, Type('image/svg+xml'), type_moin_document)
  31 +#default_registry.register(Converter._factory, Type('image/svg+xml'), type_moin_document)
  32  default_registry.register(Converter._factory, Type('image/png'), type_moin_document)
  33  default_registry.register(Converter._factory, Type('image/jpeg'), type_moin_document)
  34  default_registry.register(Converter._factory, Type('image/gif'), type_moin_document)
  35 diff -r 94a0eceff038 MoinMoin/converter2/mathmlentities.py
  36 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  37 +++ b/MoinMoin/converter2/mathmlentities.py	Sat Aug 14 20:32:16 2010 +0200
  38 @@ -0,0 +1,762 @@
  39 +entitydefs = {
  40 +"Larr": "↞",
  41 +"DownArrowUpArrow": "⇵",
  42 +"xharr": "⟷",
  43 +"DoubleVerticalBar": "∥",
  44 +"HumpDownHump": "≎",
  45 +"eparsl": "⧣",
  46 +"bull": "•",
  47 +"DiacriticalGrave": "`",
  48 +"boxdl": "┐",
  49 +"nvrArr": "⇏",
  50 +"blacktriangledown": "▾",
  51 +"otimes": "⊗",
  52 +"gl": "≷",
  53 +"lAarr": "⇚",
  54 +"lessapprox": "≲",
  55 +"UpperLeftArrow": "↖",
  56 +"lEg": "⋚",
  57 +"lsquor": "‚",
  58 +"NotLessTilde": "≴",
  59 +"Longleftarrow": "⟸",
  60 +"boxdL": "╕",
  61 +"EmptySmallSquare": "◻",
  62 +"nrtrie": "⋭",
  63 +"utrif": "▴",
  64 +"bNot": "⫭",
  65 +"Not": "⫬",
  66 +"smile": "⌣",
  67 +"angmsd": "∡",
  68 +"Lscr": "ℒ",
  69 +"harrcir": "⥈",
  70 +"Wedge": "⋀",
  71 +"ocirc": "ô",
  72 +"dHar": "⥥",
  73 +"rsquor": "’",
  74 +"suplarr": "⥻",
  75 +"equivDD": "⩸",
  76 +"OverBar": "¯",
  77 +"Qscr": "𝒬",
  78 +"Rang": "》",
  79 +"larrtl": "↢",
  80 +"ohbar": "⦵",
  81 +"LeftArrow": "←",
  82 +"ntriangleleft": "⋪",
  83 +"DoubleRightArrow": "⇒",
  84 +"Backslash": "∖",
  85 +"Gg": "⋙",
  86 +"NotGreaterEqual": "≱",
  87 +"harrw": "↭",
  88 +"lsime": "⪍",
  89 +"nparallel": "∦",
  90 +"epar": "⋕",
  91 +"NestedLessLess": "≪",
  92 +"iinfin": "⧜",
  93 +"PrecedesEqual": "⪯",
  94 +"boxDL": "╗",
  95 +"cularr": "↶",
  96 +"nlsim": "≴",
  97 +"DoubleLeftRightArrow": "⇔",
  98 +"angrtvbd": "⦝",
  99 +"lparlt": "⦓",
 100 +"Gscr": "𝒢",
 101 +"UpTeeArrow": "↥",
 102 +"elsdot": "⪗",
 103 +"sext": "✶",
 104 +"LessFullEqual": "≦",
 105 +"SquareSubsetEqual": "⊑",
 106 +"ldca": "⤶",
 107 +"boxDl": "╖",
 108 +"hscr": "𝒽",
 109 +"blacktriangleleft": "◂",
 110 +"npolint": "⨔",
 111 +"OpenCurlyQuote": "‘",
 112 +"utri": "▵",
 113 +"EmptyVerySmallSquare": "▫",
 114 +"rightleftharpoons": "⇌",
 115 +"rarrb": "⇥",
 116 +"leg": "⋚",
 117 +"lharul": "⥪",
 118 +"lesdot": "⩿",
 119 +"LowerRightArrow": "↘",
 120 +"leq": "≤",
 121 +"les": "⩽",
 122 +"vltri": "⊲",
 123 +"rarrtl": "↣",
 124 +"Udblac": "Ű",
 125 +"GreaterEqual": "≥",
 126 +"supmult": "⫂",
 127 +"Iscr": "ℐ",
 128 +"angmsdac": "⦪",
 129 +"angmsdab": "⦩",
 130 +"angmsdaa": "⦨",
 131 +"ReverseElement": "∋",
 132 +"angmsdaf": "⦭",
 133 +"angmsdae": "⦬",
 134 +"angmsdad": "⦫",
 135 +"squf": "▪",
 136 +"angmsdah": "⦯",
 137 +"oscr": "ℴ",
 138 +"dblac": "˝",
 139 +"rppolint": "⨒",
 140 +"gesdotol": "⪄",
 141 +"DoubleLeftTee": "⫤",
 142 +"circleddash": "⊝",
 143 +"DoubleLongRightArrow": "⟹",
 144 +"CupCap": "≍",
 145 +"Vee": "⋁",
 146 +"boxVl": "╢",
 147 +"Therefore": "∴",
 148 +"DownArrow": "↓",
 149 +"LeftRightArrow": "↔",
 150 +"NotSquareSubsetEqual": "⋢",
 151 +"lesdotor": "⪃",
 152 +"Star": "⋆",
 153 +"angrt": "∟",
 154 +"pscr": "𝓅",
 155 +"trisb": "⧍",
 156 +"gE": "≧",
 157 +"boxVL": "╣",
 158 +"GreaterLess": "≷",
 159 +"Fscr": "ℱ",
 160 +"ForAll": "∀",
 161 +"andv": "⩚",
 162 +"Zscr": "𝒵",
 163 +"UnderBracket": "⎵",
 164 +"Icirc": "Î",
 165 +"Lang": "《",
 166 +"latail": "⤙",
 167 +"LeftUpVector": "↿",
 168 +"RuleDelayed": "⧴",
 169 +"UpDownArrow": "↕",
 170 +"bigtriangleup": "△",
 171 +"lsim": "≲",
 172 +"phone": "☎",
 173 +"RightUpVectorBar": "⥔",
 174 +"boxvL": "╡",
 175 +"icirc": "î",
 176 +"vrtri": "⊳",
 177 +"SuchThat": "∋",
 178 +"jscr": "𝒿",
 179 +"parsim": "⫳",
 180 +"GreaterEqualLess": "⋛",
 181 +"ldrushar": "⥋",
 182 +"LeftCeiling": "⌈",
 183 +"Int": "∬",
 184 +"malt": "✠",
 185 +"NotTildeEqual": "≄",
 186 +"GreaterSlantEqual": "⩾",
 187 +"boxvl": "┤",
 188 +"lobrk": "〚",
 189 +"yscr": "𝓎",
 190 +"nvlt": "≮",
 191 +"male": "♂",
 192 +"rarrfs": "⤞",
 193 +"OverBracket": "⎴",
 194 +"vangrt": "⊾",
 195 +"RightDownTeeVector": "⥝",
 196 +"Prime": "″",
 197 +"RightVector": "⇀",
 198 +"Ll": "⋘",
 199 +"OpenCurlyDoubleQuote": "“",
 200 +"submult": "⫁",
 201 +"Lt": "≪",
 202 +"NotSuperset": "⊅",
 203 +"topcir": "⫱",
 204 +"CapitalDifferentialD": "ⅅ",
 205 +"smte": "⪬",
 206 +"LeftTriangle": "⊲",
 207 +"uHar": "⥣",
 208 +"LeftDownVector": "⇃",
 209 +"Rscr": "ℛ",
 210 +"trianglelefteq": "⊴",
 211 +"LeftAngleBracket": "〈",
 212 +"roplus": "⨮",
 213 +"dharl": "⇃",
 214 +"lbbrk": "〔",
 215 +"Jscr": "𝒥",
 216 +"ntgl": "≹",
 217 +"nharr": "↮",
 218 +"CirclePlus": "⊕",
 219 +"tprime": "‴",
 220 +"Hcirc": "Ĥ",
 221 +"ltrie": "⊴",
 222 +"ltrif": "◂",
 223 +"Uarrocir": "⥉",
 224 +"NotGreaterTilde": "≵",
 225 +"DownTee": "⊤",
 226 +"blacktriangleright": "▸",
 227 +"maltese": "✠",
 228 +"lap": "≲",
 229 +"larrsim": "⥳",
 230 +"lbrke": "⦋",
 231 +"xhArr": "⟺",
 232 +"tritime": "⨻",
 233 +"NotRightTriangle": "⋫",
 234 +"profline": "⌒",
 235 +"PlusMinus": "±",
 236 +"laemptyv": "⦴",
 237 +"lE": "≦",
 238 +"LeftTeeVector": "⥚",
 239 +"cularrp": "⤽",
 240 +"CounterClockwiseContourIntegral": "∳",
 241 +"leftrightharpoons": "⇋",
 242 +"otimesas": "⨶",
 243 +"Hscr": "ℋ",
 244 +"lozf": "⧫",
 245 +"circledast": "⊛",
 246 +"NotLeftTriangle": "⋪",
 247 +"cudarrl": "⤸",
 248 +"LeftTriangleBar": "⧏",
 249 +"NotSucceedsSlantEqual": "⋡",
 250 +"le": "≤",
 251 +"RightCeiling": "⌉",
 252 +"Lleftarrow": "⇚",
 253 +"GreaterGreater": "⪢",
 254 +"cscr": "𝒸",
 255 +"upharpoonleft": "↿",
 256 +"Breve": "˘",
 257 +"Odblac": "Ő",
 258 +"RightArrowBar": "⇥",
 259 +"jcirc": "ĵ",
 260 +"multimap": "⊸",
 261 +"odiv": "⨸",
 262 +"hybull": "⁃",
 263 +"UnderBrace": "︸",
 264 +"Cap": "⋒",
 265 +"CircleTimes": "⊗",
 266 +"ContourIntegral": "∮",
 267 +"gscr": "ℊ",
 268 +"SucceedsSlantEqual": "≽",
 269 +"LeftUpVectorBar": "⥘",
 270 +"pluscir": "⨢",
 271 +"Succeeds": "≻",
 272 +"gesles": "⪔",
 273 +"Integral": "∫",
 274 +"rAarr": "⇛",
 275 +"larrfs": "⤝",
 276 +"leftharpoondown": "↽",
 277 +"NotTilde": "≁",
 278 +"operp": "⦹",
 279 +"NotLess": "≮",
 280 +"xutri": "△",
 281 +"NotCongruent": "≢",
 282 +"squarf": "▪",
 283 +"el": "⪙",
 284 +"leqq": "≦",
 285 +"female": "♀",
 286 +"dlcorn": "⌞",
 287 +"UpTee": "⊥",
 288 +"looparrowleft": "↫",
 289 +"nless": "≮",
 290 +"oast": "⊛",
 291 +"Ocirc": "Ô",
 292 +"harr": "↔",
 293 +"Gcirc": "Ĝ",
 294 +"lesseqqgtr": "⋚",
 295 +"angmsdag": "⦮",
 296 +"lcub": "{",
 297 +"UnderParenthesis": "︶",
 298 +"smt": "⪪",
 299 +"midcir": "⫰",
 300 +"LongRightArrow": "⟶",
 301 +"RightTeeVector": "⥛",
 302 +"reg": "®",
 303 +"LeftTriangleEqual": "⊴",
 304 +"CloseCurlyQuote": "’",
 305 +"ycirc": "ŷ",
 306 +"orv": "⩛",
 307 +"DoubleRightTee": "⊨",
 308 +"uharl": "↿",
 309 +"NotTildeTilde": "≉",
 310 +"lsimg": "⪏",
 311 +"boxUl": "╜",
 312 +"rtriltri": "⧎",
 313 +"PartialD": "∂",
 314 +"ntrianglelefteq": "⋬",
 315 +"ange": "⦤",
 316 +"bscr": "𝒷",
 317 +"Barwed": "⌆",
 318 +"rangle": "〉",
 319 +"times": "×",
 320 +"measuredangle": "∡",
 321 +"gtreqqless": "⋛",
 322 +"Escr": "ℰ",
 323 +"DoubleContourIntegral": "∯",
 324 +"Tilde": "∼",
 325 +"LeftUpTeeVector": "⥠",
 326 +"SquareIntersection": "⊓",
 327 +"omid": "⦶",
 328 +"boxUL": "╝",
 329 +"rang": "〉",
 330 +"OverBrace": "︷",
 331 +"scpolint": "⨓",
 332 +"RightUpDownVector": "⥏",
 333 +"lrhar": "⇋",
 334 +"RightFloor": "⌋",
 335 +"wscr": "𝓌",
 336 +"mldr": "…",
 337 +"raemptyv": "⦳",
 338 +"OverParenthesis": "︵",
 339 +"lthree": "⋋",
 340 +"Diamond": "⋄",
 341 +"Longleftrightarrow": "⟺",
 342 +"LeftDownVectorBar": "⥙",
 343 +"parallel": "∥",
 344 +"Delta": "Δ",
 345 +"LeftArrowRightArrow": "⇆",
 346 +"LessGreater": "≶",
 347 +"ltrPar": "⦖",
 348 +"RightTeeArrow": "↦",
 349 +"LeftVector": "↼",
 350 +"NotSubsetEqual": "⊈",
 351 +"cemptyv": "⦲",
 352 +"TripleDot": "⃛",
 353 +"DiacriticalAcute": "´",
 354 +"LongLeftRightArrow": "⟷",
 355 +"ogt": "⧁",
 356 +"triangleleft": "◃",
 357 +"gtreqless": "⋛",
 358 +"ntrianglerighteq": "⋭",
 359 +"ascr": "𝒶",
 360 +"gtrless": "≷",
 361 +"Coproduct": "∐",
 362 +"lesges": "⪓",
 363 +"xcirc": "◯",
 364 +"lsqb": "[",
 365 +"llarr": "⇇",
 366 +"ocir": "⊚",
 367 +"LeftDoubleBracket": "〚",
 368 +"ulcorn": "⌜",
 369 +"Dagger": "‡",
 370 +"lharu": "↼",
 371 +"SquareSuperset": "⊐",
 372 +"Ucirc": "Û",
 373 +"Mscr": "ℳ",
 374 +"rscr": "𝓇",
 375 +"UnionPlus": "⊎",
 376 +"hcirc": "ĥ",
 377 +"leftthreetimes": "⋋",
 378 +"lhard": "↽",
 379 +"CircleDot": "⊙",
 380 +"DownLeftRightVector": "⥐",
 381 +"xoplus": "⊕",
 382 +"ang": "∠",
 383 +"DiacriticalDoubleAcute": "˝",
 384 +"SucceedsTilde": "≿",
 385 +"nleftrightarrow": "↮",
 386 +"SmallCircle": "∘",
 387 +"urtri": "◹",
 388 +"uscr": "𝓊",
 389 +"leftharpoonup": "↼",
 390 +"blacktriangle": "▴",
 391 +"Lmidot": "Ŀ",
 392 +"xscr": "𝓍",
 393 +"smeparsl": "⧤",
 394 +"angle": "∠",
 395 +"DownTeeArrow": "↧",
 396 +"NotLessEqual": "≰",
 397 +"kscr": "𝓀",
 398 +"qprime": "⁗",
 399 +"rlhar": "⇌",
 400 +"Scirc": "Ŝ",
 401 +"SquareUnion": "⊔",
 402 +"LeftUpDownVector": "⥑",
 403 +"larrpl": "⤹",
 404 +"olcross": "⦻",
 405 +"LessTilde": "≲",
 406 +"gcirc": "ĝ",
 407 +"mumap": "⊸",
 408 +"RightArrowLeftArrow": "⇄",
 409 +"dscr": "𝒹",
 410 +"Equal": "⩵",
 411 +"Nscr": "𝒩",
 412 +"larrhk": "↩",
 413 +"RightTriangleEqual": "⊵",
 414 +"middot": "·",
 415 +"nrtri": "⋫",
 416 +"DiacriticalTilde": "˜",
 417 +"lopar": "〘",
 418 +"lscr": "ℓ",
 419 +"plusacir": "⨣",
 420 +"lnap": "⪉",
 421 +"SupersetEqual": "⊇",
 422 +"loplus": "⨭",
 423 +"lltri": "◺",
 424 +"raquo": "»",
 425 +"odsold": "⦼",
 426 +"gsiml": "⪐",
 427 +"ltcc": "⪦",
 428 +"emptyv": "∅",
 429 +"rtrie": "⊵",
 430 +"Ccirc": "Ĉ",
 431 +"ldrdhar": "⥧",
 432 +"nlt": "≮",
 433 +"Union": "⋃",
 434 +"leftarrowtail": "↢",
 435 +"UnderBar": "̲",
 436 +"Wcirc": "Ŵ",
 437 +"nvHarr": "⇎",
 438 +"nle": "≰",
 439 +"nlarr": "↚",
 440 +"RightDoubleBracket": "〛",
 441 +"Hat": "̂",
 442 +"LessEqualGreater": "⋚",
 443 +"DiacriticalDot": "˙",
 444 +"doublebarwedge": "⌆",
 445 +"npar": "∦",
 446 +"rtrif": "▸",
 447 +"vartriangleright": "⊳",
 448 +"ApplyFunction": "⁡",
 449 +"vartriangleleft": "⊲",
 450 +"triangleright": "▹",
 451 +"RightUpVector": "↾",
 452 +"xotime": "⊗",
 453 +"LeftDownTeeVector": "⥡",
 454 +"DownRightVector": "⇁",
 455 +"Bscr": "ℬ",
 456 +"triangle": "▵",
 457 +"xlArr": "⟸",
 458 +"apacir": "⩯",
 459 +"DownArrowBar": "⤓",
 460 +"PrecedesSlantEqual": "≼",
 461 +"LeftArrowBar": "⇤",
 462 +"Vvdash": "⊪",
 463 +"mapstoleft": "↤",
 464 +"leqslant": "⩽",
 465 +"gel": "⋛",
 466 +"ClockwiseContourIntegral": "∲",
 467 +"llhard": "⥫",
 468 +"lceil": "⌈",
 469 +"Because": "∵",
 470 +"LessLess": "⪡",
 471 +"NotSupersetEqual": "⊉",
 472 +"ReverseEquilibrium": "⇋",
 473 +"NotSubset": "⊄",
 474 +"larrbfs": "⤟",
 475 +"sdot": "⋅",
 476 +"Otimes": "⨷",
 477 +"lfloor": "⌊",
 478 +"NotEqual": "≠",
 479 +"dtri": "▿",
 480 +"ulcrop": "⌏",
 481 +"PrecedesTilde": "≾",
 482 +"Proportion": "∷",
 483 +"Yscr": "𝒴",
 484 +"Cscr": "𝒞",
 485 +"NotPrecedesEqual": "⪯",
 486 +"ldsh": "↲",
 487 +"rAtail": "⤜",
 488 +"lne": "≨",
 489 +"leftrightarrows": "⇆",
 490 +"lescc": "⪨",
 491 +"LeftVectorBar": "⥒",
 492 +"Uscr": "𝒰",
 493 +"odot": "⊙",
 494 +"longleftrightarrow": "⟷",
 495 +"rlarr": "⇄",
 496 +"circledcirc": "⊚",
 497 +"boxuL": "╛",
 498 +"comp": "∁",
 499 +"lnE": "≨",
 500 +"lrtri": "⊿",
 501 +"CircleMinus": "⊖",
 502 +"NotDoubleVerticalBar": "∦",
 503 +"NotPrecedesSlantEqual": "⋠",
 504 +"ldquor": "„",
 505 +"lrarr": "⇆",
 506 +"lg": "≶",
 507 +"SubsetEqual": "⊆",
 508 +"complement": "∁",
 509 +"langd": "⦑",
 510 +"eqvparsl": "⧥",
 511 +"langle": "〈",
 512 +"Hacek": "ˇ",
 513 +"ofcir": "⦿",
 514 +"EqualTilde": "≂",
 515 +"lfisht": "⥼",
 516 +"Exists": "∃",
 517 +"tridot": "◬",
 518 +"nabla": "∇",
 519 +"opar": "⦷",
 520 +"TildeEqual": "≃",
 521 +"RightVectorBar": "⥓",
 522 +"larrlp": "↫",
 523 +"boxhD": "╥",
 524 +"lang": "〈",
 525 +"UpArrowBar": "⤒",
 526 +"UpEquilibrium": "⥮",
 527 +"gtcir": "⩺",
 528 +"NotGreaterLess": "≹",
 529 +"nvlArr": "⇍",
 530 +"glE": "⪒",
 531 +"boxhU": "╨",
 532 +"ReverseUpEquilibrium": "⥯",
 533 +"lAtail": "⤛",
 534 +"boxhd": "┬",
 535 +"ccirc": "ĉ",
 536 +"Vscr": "𝒱",
 537 +"Dscr": "𝒟",
 538 +"bigtriangledown": "▽",
 539 +"wcirc": "ŵ",
 540 +"MinusPlus": "∓",
 541 +"boxhu": "┴",
 542 +"dtrif": "▾",
 543 +"Conint": "∯",
 544 +"bemptyv": "⦰",
 545 +"intlarhk": "⨗",
 546 +"luruhar": "⥦",
 547 +"lpar": "(",
 548 +"complexes": "ℂ",
 549 +"hamilt": "ℋ",
 550 +"leftrightsquigarrow": "↭",
 551 +"ltri": "◃",
 552 +"dlcrop": "⌍",
 553 +"lbrksld": "⦏",
 554 +"els": "⋜",
 555 +"tint": "∭",
 556 +"lbrkslu": "⦍",
 557 +"Oscr": "𝒪",
 558 +"And": "⩓",
 559 +"RightDownVectorBar": "⥕",
 560 +"VerticalSeparator": "❘",
 561 +"lgE": "⪑",
 562 +"ultri": "◸",
 563 +"Wscr": "𝒲",
 564 +"DoubleLongLeftArrow": "⟸",
 565 +"gla": "⪥",
 566 +"Proportional": "∝",
 567 +"boxul": "┘",
 568 +"simlE": "⪟",
 569 +"udblac": "ű",
 570 +"SucceedsEqual": "≽",
 571 +"rdsh": "↳",
 572 +"DoubleUpDownArrow": "⇕",
 573 +"RoundImplies": "⥰",
 574 +"ucirc": "û",
 575 +"it": "⁢",
 576 +"eqslantless": "⋜",
 577 +"ltlarr": "⥶",
 578 +"telrec": "⌕",
 579 +"NotReverseElement": "∌",
 580 +"UpArrowDownArrow": "⇅",
 581 +"ic": "⁣",
 582 +"leftleftarrows": "⇇",
 583 +"par": "∥",
 584 +"profsurf": "⌓",
 585 +"DoubleUpArrow": "⇑",
 586 +"leftarrow": "←",
 587 +"lotimes": "⨴",
 588 +"Ascr": "𝒜",
 589 +"nldr": "‥",
 590 +"circlearrowright": "↻",
 591 +"ntlg": "≸",
 592 +"triplus": "⨹",
 593 +"acirc": "â",
 594 +"odash": "⊝",
 595 +"boxHd": "╤",
 596 +"Implies": "⇒",
 597 +"iscr": "𝒾",
 598 +"nltri": "⋪",
 599 +"longleftarrow": "⟵",
 600 +"ecir": "≖",
 601 +"boxHu": "╧",
 602 +"rotimes": "⨵",
 603 +"boxHD": "╦",
 604 +"DoubleDownArrow": "⇓",
 605 +"angzarr": "⍼",
 606 +"compfn": "∘",
 607 +"NestedGreaterGreater": "≫",
 608 +"exponentiale": "ⅇ",
 609 +"ltdot": "⋖",
 610 +"boxHU": "╩",
 611 +"NotLeftTriangleEqual": "⋬",
 612 +"curvearrowleft": "↶",
 613 +"lBarr": "⤎",
 614 +"lurdshar": "⥊",
 615 +"nltrie": "⋬",
 616 +"gEl": "⋛",
 617 +"Xscr": "𝒳",
 618 +"GreaterFullEqual": "≧",
 619 +"demptyv": "⦱",
 620 +"LeftTee": "⊣",
 621 +"Jcirc": "Ĵ",
 622 +"siml": "⪝",
 623 +"Equilibrium": "⇌",
 624 +"sscr": "𝓈",
 625 +"LeftTeeArrow": "↤",
 626 +"DifferentialD": "ⅆ",
 627 +"olarr": "↺",
 628 +"GreaterTilde": "≳",
 629 +"RightUpTeeVector": "⥜",
 630 +"Congruent": "≡",
 631 +"Kscr": "𝒦",
 632 +"TildeFullEqual": "≅",
 633 +"ecirc": "ê",
 634 +"LeftFloor": "⌊",
 635 +"mscr": "𝓂",
 636 +"SquareSubset": "⊏",
 637 +"nleftarrow": "↚",
 638 +"LeftRightVector": "⥎",
 639 +"ntriangleright": "⋫",
 640 +"dwangle": "⦦",
 641 +"VerticalTilde": "≀",
 642 +"lessgtr": "≶",
 643 +"NotRightTriangleEqual": "⋭",
 644 +"Or": "⩔",
 645 +"oslash": "ø",
 646 +"laquo": "«",
 647 +"xlarr": "⟵",
 648 +"RightTriangleBar": "⧐",
 649 +"xdtri": "▽",
 650 +"VerticalBar": "∣",
 651 +"Colone": "⩴",
 652 +"lsquo": "‘",
 653 +"VerticalLine": "|",
 654 +"leftrightarrow": "↔",
 655 +"tscr": "𝓉",
 656 +"rdquo": "”",
 657 +"lesssim": "≲",
 658 +"Sub": "⋐",
 659 +"Sum": "∑",
 660 +"sstarf": "⋆",
 661 +"rarrbfs": "⤠",
 662 +"cirscir": "⧂",
 663 +"olt": "⧀",
 664 +"cirE": "⧃",
 665 +"circlearrowleft": "↺",
 666 +"larr": "←",
 667 +"DownRightTeeVector": "⥟",
 668 +"Ycirc": "Ŷ",
 669 +"RightTee": "⊢",
 670 +"NotPrecedes": "⊀",
 671 +"circ": "^",
 672 +"cire": "≗",
 673 +"FilledSmallSquare": "◼",
 674 +"Intersection": "⋂",
 675 +"twoheadleftarrow": "↞",
 676 +"RightTriangle": "⊳",
 677 +"RightDownVector": "⇂",
 678 +"NotTildeFullEqual": "≇",
 679 +"daleth": "ℸ",
 680 +"loang": "",
 681 +"InvisibleTimes": "⁢",
 682 +"RightAngleBracket": "〉",
 683 +"scirc": "ŝ",
 684 +"hookleftarrow": "↩",
 685 +"triminus": "⨺",
 686 +"lesdoto": "⪁",
 687 +"oS": "Ⓢ",
 688 +"nhpar": "⫲",
 689 +"trianglerighteq": "⊵",
 690 +"Square": "□",
 691 +"DotEqual": "≐",
 692 +"nleq": "≰",
 693 +"ruluhar": "⥨",
 694 +"downharpoonleft": "⇃",
 695 +"qint": "⨌",
 696 +"range": "⦥",
 697 +"rangd": "⦒",
 698 +"Precedes": "≺",
 699 +"NotExists": "∄",
 700 +"profalar": "⌮",
 701 +"qscr": "𝓆",
 702 +"TildeTilde": "≈",
 703 +"Cup": "⋓",
 704 +"lessdot": "⋖",
 705 +"triangledown": "▿",
 706 +"LowerLeftArrow": "↙",
 707 +"Sqrt": "√",
 708 +"Cconint": "∰",
 709 +"ltimes": "⋉",
 710 +"NotCupCap": "≭",
 711 +"gtlPar": "⦕",
 712 +"osol": "⊘",
 713 +"RightArrow": "→",
 714 +"HorizontalLine": "─",
 715 +"ltquest": "⩻",
 716 +"starf": "★",
 717 +"CenterDot": "·",
 718 +"zscr": "𝓏",
 719 +"circledS": "Ⓢ",
 720 +"LongLeftArrow": "⟵",
 721 +"Pscr": "𝒫",
 722 +"lmidot": "ŀ",
 723 +"odblac": "ő",
 724 +"DoubleLongLeftRightArrow": "⟺",
 725 +"Cedilla": "¸",
 726 +"CloseCurlyDoubleQuote": "”",
 727 +"lnsim": "⋦",
 728 +"larrb": "⇤",
 729 +"esdot": "≐",
 730 +"DownLeftVector": "↽",
 731 +"SquareSupersetEqual": "⊒",
 732 +"Del": "∇",
 733 +"delta": "δ",
 734 +"Cayleys": "ℭ",
 735 +"timesb": "⊠",
 736 +"NotElement": "∉",
 737 +"ldquo": "“",
 738 +"Assign": "≔",
 739 +"bullet": "•",
 740 +"NotVerticalBar": "∤",
 741 +"rsquo": "’",
 742 +"nscr": "𝓃",
 743 +"cir": "○",
 744 +"NotGreater": "≯",
 745 +"lHar": "⥢",
 746 +"ovbar": "⌽",
 747 +"Sscr": "𝒮",
 748 +"HumpEqual": "≏",
 749 +"DoubleDot": "¨",
 750 +"trie": "≜",
 751 +"glj": "⪤",
 752 +"olcir": "⦾",
 753 +"Cross": "⨯",
 754 +"DownLeftTeeVector": "⥞",
 755 +"DownBreve": "̑",
 756 +"escr": "ℯ",
 757 +"exist": "∃",
 758 +"angsph": "∢",
 759 +"lbarr": "⤌",
 760 +"DownLeftVectorBar": "⥖",
 761 +"LessSlantEqual": "⩽",
 762 +"oplus": "⊕",
 763 +"triangleq": "≜",
 764 +"Acirc": "Â",
 765 +"orarr": "↻",
 766 +"rect": "▭",
 767 +"FilledVerySmallSquare": "▪",
 768 +"DownRightVectorBar": "⥗",
 769 +"ltcir": "⩹",
 770 +"cirmid": "⫯",
 771 +"lesseqgtr": "⋚",
 772 +"DoubleLeftArrow": "⇐",
 773 +"Ecirc": "Ê",
 774 +"Superset": "⊃",
 775 +"rdldhar": "⥩",
 776 +"NotSucceeds": "⊁",
 777 +"loarr": "⇽",
 778 +"xodot": "⊙",
 779 +"vscr": "𝓋",
 780 +"ominus": "⊖",
 781 +"Element": "∈",
 782 +"rightleftarrows": "⇄",
 783 +"fscr": "𝒻",
 784 +"InvisibleComma": "⁣",
 785 +"Tscr": "𝒯",
 786 +"Subset": "⋐",
 787 +"timesbar": "⨱",
 788 +"prurel": "⊰",
 789 +"rtri": "▹",
 790 +"NotSquareSupersetEqual": "⋣",
 791 +"UpArrow": "↑",
 792 +"Product": "∏",
 793 +"NotLessGreater": "≸",
 794 +"Colon": "∷",
 795 +"UpperRightArrow": "↗",
 796 +"circledR": "®",
 797 +"uwangle": "⦧",
 798 +"aleph": "ℵ",
 799 +}
 800 +
 801 diff -r 94a0eceff038 MoinMoin/converter2/xml_in.py
 802 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 803 +++ b/MoinMoin/converter2/xml_in.py	Sat Aug 14 20:32:16 2010 +0200
 804 @@ -0,0 +1,39 @@
 805 +"""
 806 +MoinMoin - XML input converter
 807 +
 808 +Parses XML input directly into DOM tree (no change).
 809 +
 810 +@copyright: 2010 MoinMoin:ThomasWaldmann
 811 +@license: GNU GPL, see COPYING for details.
 812 +"""
 813 +
 814 +from emeraldtree.tree import parse, XMLParser, TreeBuilder
 815 +from mathmlentities import entitydefs
 816 +
 817 +class MathMLParser(XMLParser):
 818 +    def __init__(self, *args, **kw):
 819 +        super(MathMLParser, self).__init__(*args, **kw)
 820 +        self.entity = entitydefs
 821 +
 822 +
 823 +class Converter(object):
 824 +    """
 825 +    Convert XML into DOM Tree.
 826 +    """
 827 +    @classmethod
 828 +    def _factory(cls, input, output, **kw):
 829 +        return cls(input_type=input)
 830 +
 831 +    def __init__(self, input_type):
 832 +        self.input_type = input_type
 833 +
 834 +    def __call__(self, content):
 835 +        parser = MathMLParser(target=TreeBuilder())
 836 +        return parse(content, parser).getroot()
 837 +
 838 +
 839 +from . import default_registry
 840 +from MoinMoin.util.mime import Type, type_moin_document
 841 +default_registry.register(Converter._factory, Type('image/svg+xml'), type_moin_document)
 842 +default_registry.register(Converter._factory, Type('text/mathml'), type_moin_document)
 843 +
 844 diff -r 94a0eceff038 MoinMoin/items/__init__.py
 845 --- a/MoinMoin/items/__init__.py	Tue Aug 10 14:22:42 2010 +0200
 846 +++ b/MoinMoin/items/__init__.py	Sat Aug 14 20:32:16 2010 +0200
 847 @@ -213,7 +213,7 @@
 848      def _render_data(self):
 849          from MoinMoin.converter2 import default_registry as reg
 850          from MoinMoin.util.mime import Type, type_moin_document
 851 -        from MoinMoin.util.tree import html
 852 +        from MoinMoin.util.tree import html, svg, mathml
 853          request = self.request
 854          # TODO: Real output format
 855          html_conv = reg.get(type_moin_document,
 856 @@ -223,7 +223,12 @@
 857  
 858          from array import array
 859          out = array('u')
 860 -        doc.write(out.fromunicode, namespaces={html.namespace: ''}, method='xml')
 861 +        doc.write(out.fromunicode,
 862 +                  namespaces={html.namespace: '',
 863 +                              svg.namespace: '',
 864 +                              mathml.namespace: '',
 865 +                             },
 866 +                  method='xml')
 867          return out.tounicode()
 868  
 869      def _render_data_xml(self):
 870 @@ -825,6 +830,8 @@
 871      """ SVG images use <object> tag mechanism from RenderableBinary base class """
 872      supported_mimetypes = ['image/svg+xml']
 873  
 874 +    def feed_input_conv(self):
 875 +        return self.rev
 876  
 877  class RenderableBitmapImage(RenderableImage):
 878      """ PNG/JPEG/GIF images use <img> tag (better browser support than <object>) """
 879 @@ -1030,6 +1037,13 @@
 880                                )
 881  
 882  
 883 +class MathML(Text):
 884 +    """ MathML """
 885 +    supported_mimetypes = ['text/mathml']
 886 +
 887 +    def feed_input_conv(self):
 888 +        return self.rev
 889 +
 890  class MarkupItem(Text):
 891      """ some kind of item with markup (and internal links) """
 892      def before_revision_commit(self, newrev, data):

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-01-01 18:47:24, 0.5 KB) [[attachment:mathtran_example.png]]
  • [get | view] (2010-08-14 18:33:03, 22.8 KB) [[attachment:moin2-mathml.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.