Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2008-05-30 04:35:43 (GMT)
committer Chris Ball <cjb@laptop.org>2008-05-30 04:35:43 (GMT)
commit63da8ef6ad1c98379b4a776eb6e69829c6c8ac9f (patch)
tree59c2673fb93300e8e4a90b1255f6975419a84282 /server.py
parentcd1b9eb590e39386540f2fb9938533cf5aaa5f0c (diff)
Remove old code. (itex2MML, object embedding.)
Diffstat (limited to 'server.py')
-rwxr-xr-xserver.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/server.py b/server.py
index a503244..c5c7c14 100755
--- a/server.py
+++ b/server.py
@@ -151,7 +151,6 @@ class HTMLOutputBuffer:
class WPMathRenderer:
def render(self, latex):
- #process = subprocess.Popen(('bin/itex2MML', '--inline'), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
process = subprocess.Popen(('bin/blahtex', '--mathml', '--texvc-compatible-commands'), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
(mathml, err) = process.communicate(latex.encode('utf8'))
@@ -174,48 +173,6 @@ class WPMathRenderer:
# Straight embedding. Requires parent document to be XHTML.
return mathml
- # Object embedding (ala SVG files), no real advantages.
- #filename = md5(latex).hexdigest()
- #xmlname = filename + '.xml'
- #with codecs.open("generated/"+xmlname, "w", "utf-8") as f:
- # f.write('<?xml version="1.0"?>')
- # f.write(mathml)
- # f.close()
- #
- #return '<object type="text/xml" data="/generated/%s"></object>' % xmlname
-
- # IFrame embedding allows parent document to be non-XHTML.
- #filename = md5(latex).hexdigest()
- #xmlname = filename + '.xhtml'
- #with codecs.open("generated/"+xmlname, "w", "utf-8") as f:
- # f.write(
- # '<?xml version="1.0"?>'\
- # '<!DOCTYPE html PUBLIC '\
- # '"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" '\
- # '"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" '\
- # '[ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> '\
- # '<html xmlns="http://www.w3.org/1999/xhtml"> ')
- # f.write('<body>')
- # f.write(mathml)
- # f.write('</body>')
- # f.write('</html>')
- # f.close()
- #
- #return '<iframe frameborder="0" width="100%%" height="100%%" marginwidth="0" marginheight="0" src="/generated/%s"></iframe>' % xmlname
-
- # PNG embedding. Requires latex and dvipng.
- #filename = md5(latex).hexdigest()
- #pngname = filename + '.png'
- #
- #pngf = os.open("generated/" + pngname, os.O_CREAT)
- #process = subprocess.Popen(('bin/blahtex', '--png'), stdin=subprocess.PIPE, stdout=pngf)
- #process.stdin.write(latex)
- #process.wait()
- #if process.returncode is not 0:
- # return ""
- #
- #return '<img src="/generated/%s""></img>' % pngname
-
class WPHTMLWriter(mwlib.htmlwriter.HTMLWriter):
"""Customizes HTML output from mwlib."""