0

I downloaded a util(cmake,actually) tar,and it's doc was written as .rst files with structure like blow.After googling,I know docutils(a python package) can convert these files to htmls,so installed it ,but I can't find a way to to do it?please tell me,is there any simple command to do it?How?

//doc files structure(generated by ls -l under ubuntu)

command
generator
include
index.rst
manual
module
policy
prop_cache
prop_dir
prop_gbl
prop_sf
prop_test
prop_tgt
release
variable
MattDMo
  • 100,794
  • 21
  • 241
  • 231
Alex Luya
  • 9,412
  • 15
  • 59
  • 91

1 Answers1

0

The docutils documentation tells you what to do. In your case, you want the rst2html.py command, which should have been installed in your PATH when you installed the module. Run

rst2html.py --help

to see what the command-line options are.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • 1
    Actually,I have installed sphinx also and tried to run: rst2html.py index.rst index.html,but got many errors like:index.rst:16: (ERROR/3) Unknown directive type "toctree". – Alex Luya Sep 21 '14 at 01:23
  • Your errors of that kind are because those are Sphinx-specific directives, which docutils will not translate (only the ReST-specific ones). It's a bummer I just ran into too. – kcrisman Nov 21 '14 at 03:37
  • You cannot execute a Python file, so this will not work at all. – 1313e Jun 29 '21 at 04:35
  • @1313e yes you can, if the executable bit is set - `chmod +x myfile.py`. When `docutils` is installed, `rst2html.py` is executable. On Windows (which this question isn't about), `.py` files are by default associated with the Python launcher. If I didn't know that what I was recommending would work, I wouldn't have answered the question. – MattDMo Jun 29 '21 at 18:59
  • Thanks for making my point. Yes, on Windows, you cannot execute Python files. This question does not specify the OS, thus all OSs must be taken into account. – 1313e Jun 30 '21 at 05:12
  • @1313e from the question, just above the code box: *generated by ls -l under ubuntu*. I'm not going to argue any more about this. – MattDMo Jun 30 '21 at 15:44