|
|
|
|
| 头晕了:怎么把reStructuredText格式的文档转换成html格式 |
 头晕了:怎么把reStructuredText格式的文档转换成html格式 - hick [ 2006-03-26 13:33 | 1,184 byte(s)]
 Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式 - limodou [ 2006-03-28 10:26 | 248 byte(s)]
 Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式 - hick [ 2006-03-28 21:57 | 479 byte(s)]
 Re: 头晕了:怎么把reStructuredText格式的文档转换成html格式 - hick [ 2006-03-26 13:37 | 3,020 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]
|
|
[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]
|
|
|