Personal tools

reST->OpenOffice的转换

发现有人提供了rest->openoffice的转换代码,在这里:

发现有人提供了rest->openoffice的转换代码,在这里:

http://artiemestieri.tn.it/~azazel/odwriter

这个产品还在pre-alpha的阶段,拿来测试了一下,感觉未来前景不错,拿来就可用,速度也不错,不需要依赖包.

作者使用darcs在管理源代码,在debian下连装darcs带下载使用例子如下:

apt-get install darcs
darcs get http://artiemestieri.tn.it/~azazel/darcs/odwrite
cd odwriter/
python rest2od.py samples/sample.rst > sample.odt

使用的过程中,发现问题,稍微hack了一下utils.py中的getId函数如下:

def getId(node):
  """ Returns the id of the node, if its assigned, elsewhere returns
  None. Created to stabilize api while hiding docutils lookup
  internals."""
  try:
      node_id = node['ids'][0]
  except KeyError:
      # keep compatibility with older versions of docutils which use
      # the attribute 'id'
      node_id = node['id']
  except:
      return None
  return node_id

发现存在的的主要问题是:

  1. 还不支持内嵌图片
  2. 发现默认中文的字体设置还大对, 需要生成完后手工设置下字体,否则一些汉字不会显示,看起来好像漏了字一样。
 

本站由 润普公司资助, 采用 易度CMS 构建。

广而告之:润普公司 易度云办公平台,包括 易度文档管理系统 易度项目管理系统 , 易度部门管理 ,均采用Zope 3/BFG技术开发。
沪ICP备05008050