URN Logo
UNIX Resources » Linux » China Linux Forum » Python 编 程 » 3 » 头晕了:怎么把reStructuredText格式的文档转换成html格式
announcement 声明: 本页内容为中国Linux论坛的内容镜像,文章的版权以及其他所有的相关权利属于中国Linux论坛和相应文章的作者,如果转载,请注明文章来源及相关版权信息。
Resources
China Linux Forum(finished)
Linux Forum(finished)
FreeBSD China(finished)
linuxforum.net
  业界新闻与评论
  自由软件杂谈
  IT 人生
  Linux软件快递
  翻译作坊
  Linux图书与评论
  GNU Emacs/XEmacs
  Linux 中文环境和中文化
  Linux桌面与办公软件
  Linux 多媒体与娱乐版
  自由之窗Mozilla
  笔记本电脑上的Linux
  Gentoo
  Debian 一族
  网络管理技术
  Linux 安装与入门
  WEB服务器和FTP服务器
  域名服务器和邮件服务器
  Linux防火墙和代理服务器应用
  文件及打印服务器
  技术培训与认证
  Linux内核技术
  Linux 嵌入技术
  Linux设备驱动程序
  Linux 集群技术
  LINUX平台数据库
  系统和网络安全
  CPU 与 编译器
  系统计算研究所专栏
  Linux下的GUI软件开发
  C/C++编程版
  PHP 技 术
  Java&jsp技术
  Shell编程技术
  Perl 编 程
  Python 编 程
  XML/Web Service 技术
  永远的Unix
  FreeBSD世界
   
头晕了:怎么把reStructuredText格式的文档转换成html格式
 
 
 
 
Subject: 头晕了:怎么把reStructuredText格式的文档转换成html格式
Author: hick    Posted: 2006-03-26 13:33    Length: 1,184 byte(s)
[Original] [Print] [Top]
由于敬仰python已久,只是个搞php开发的,由DocBook给我“引见”了reStructuredText,所以只能够按照现有的一些文档和工具,下面是我在windows 2k pro平台下,按照官方http://docstring.sourceforge.net/下载的 restructuredtext-0.4.tar.gz里的 readme.txt 的做法,不知道问题出在哪里?

1. 在python.org下载python2.4.2
2. 把安装路径设置到path---这只是为了能够在命令行下运行python
3. python setup.py install完成安装
4. 调用html.py转换,结果报错:
D:Down eStructuredText estructuredtext ools>python html.py D:DocumentSource D:DocumentOutput
Traceback (most recent call last):
File "html.py", line 16, in ?
from dps.core import publish
ImportError: No module named dps.core

看上去是dps.core没有安装?可是我在第三步里明明看到已经安装了,在python的安装目录(d:/program files/python24)里也看到了dps相关文件了。。。

请问怎么回事呢?请指教,谢谢!
下帖我帖一下readme.txt的内容
[Original] [Print] [Top]
Subject: Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式
Author: hick    Posted: 2006-03-26 13:37    Length: 3,020 byte(s)
[Original] [Print] [Top]
只帖我安装相关的部分吧:

To run the code, Python 2.0 or later must already be installed. You
can get Python from http://www.python.org/. You will also need the
latest DPS package, available from http://docstring.sourceforge.net/.



Project Files & Directories
===========================

* README.txt: You're reading it.

* HISTORY.txt: Release notes for the current and previous project
releases.

* setup.py: Installation script. See "Installation" below.

* install.py: Quick & dirty installation script.

* restructuredtext: The project source directory, installed as Python
package ``dps.parsers.restructuredtext``.

* test: The unit test directory (currently experimental). Not
required to use the software, but very useful if you're planning to
modify it.

* tools: Directory for standalone scripts that use reStructuredText.

- quicktest.py: Input reStructuredText, output pretty-printed
pseudo-XML and various other forms.

- publish.py: A minimal example of a complete Docutils system, using
the "standalone" reader and "pformat" writer.

- html.py: Read standalone reStructuredText documents and write
HTML4/CSS1. Uses the default.css stylesheet.

* spec: The project specification directory. Contains the markup
syntax spec and implementation notes.

* docs: The project user documentation directory.




Installation
============
Windows
-------

1. Open a DOS box (Command Shell, MSDOS Prompt, or whatever they're
calling it these days).

2. Go to the directory created by expanding the archive::

cd <archive_directory_path>

3. Install the package::

<path_to_python.exe>python setup.py install

If your system is set up to run Python when you double-click on .py
files, you can run install.py to do the same as the above.


Usage
=====

After installing both the reStructuredText and DPS packages, start
with the html.py and publish.py front-ends from the unpacked
reStructuredText "tools" subdirectory. Both take up to two arguments,
the source path and destination path, with STDIN and STDOUT being the
defaults.
[Original] [Print] [Top]
Subject: Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式
Author: limodou    Posted: 2006-03-28 10:26    Length: 248 byte(s)
[Original] [Print] [Top]
restructuredtext的包不是你所指的那个,应该是 docutils http://docutils.sourceforge.net/

要安装它才可以。你那个怎么象是生成docstring的文档,没做过。
----
[Original] [Print] [Top]
Subject: Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式
Author: hick    Posted: 2006-03-28 21:57    Length: 479 byte(s)
[Original] [Print] [Top]
嘿嘿 谢谢

后来发现确实如斑竹说的那样,我下的包下错了。
我搜索找到了restructuredtext,跑到了 http://sourceforge.net/projects/structuredtext/

那个包是个独立的restructuredtext包,还需要安装DPS等包,实际上这个包的tools里只有一个buildhtml.py,我按照里面的说明安装发现了不对头,但是没想到要下载的完整的包应该是 docutils。。。 嘿嘿
[Original] [Print] [Top]
« Previous thread
想系统的学习python,大家给点意见吧 嘿嘿
Python 编 程
3
Next thread »
Django数据库使用MySQL中产生的问题
     

Copyright © 2007 UNIX Resources Network, All Rights Reserved.      About URN | Privacy & Legal | Help | Contact us
备案序号: 京ICP备05006143    webmaster: webmaster@unixresources.net
This page created on 2008-07-17 04:10:55, cost 0.039906024932861 ms.