50

In many django projects, in the docs directory I can see *.rst files:

Is there a standard, simple, or common way of rendering and displaying these, instead of viewing their contents as plain text?

Is it possible to generate HTML from the .rst files?

1of7
  • 13
  • 3
Eric
  • 5,101
  • 10
  • 37
  • 45
  • 1
    Can you please edit the description to expand on the "without using a text editor of course"? That would seem to be a good way, and your reasons for rejecting it aren't clear. – bignose Apr 05 '10 at 23:23
  • 1
    Edits have been made to try to salvage this question from being opinion-based. Is there a process for removing the `opinion-based` flag now? – EL_DON Oct 12 '20 at 22:27

3 Answers3

40

.rst files are ReStructuredText format. They look like text files, but can be rendered into HTML with the Python docutils package.

Mike DeSimone
  • 41,631
  • 10
  • 72
  • 96
25

As zjk says, you can use restview:

restview is available from the Python Package Index: http://pypi.python.org/pypi/restview. You can also pip install restview.

Here is what I did to test it out using a virtual environment:

mkdir restview
cd restview/
virtualenv-2.7 venv   # The second system I used just used 'virtualenv venv'
./venv/bin/pip install restview
./venv/bin/restview ~/path/MANUAL.rst 

This launched a web server and opened the documentation page in my browser.

Note: I only used virtualenv because I don't like installing things globally. It may be overkill for many others, but I also have better luck with these one-off environemnets. When I tried pip install restview on an Ubuntu 14.04 VM it failed, whereas the approach above worked like a charm for me on that system as well as this one.

sage
  • 4,863
  • 2
  • 44
  • 47
11

Try restview

zjk
  • 2,043
  • 3
  • 28
  • 45
  • 17
    Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Aug 08 '11 at 12:31