crate / crate-docs

Common build system, QA tools, style guides, and other meta miscellanies for doing docs at Crate.io.
Apache License 2.0
2 stars 1 forks source link

Render standalone directories of RST files #79

Open nomicode opened 3 years ago

nomicode commented 3 years ago

from @amotl:

Add capability to instantly render whole directories instead of single files only. When detecting an index.rst within the directory, open that file in the Browser.

right now, the preview script can only render a single standalone file. if that file references image in the same directory, they will be broken when viewing the HTML

additionally, it might be possible to allow linking to other documents in the directory

the only problem I see with this is that for the standalone preview to work, we essentially build a simple sphinx project with one file (named index.rst and soft linked to your original file). to create a sphinx project on the fly from a directory with multiple files, we would have to link all the files together using a toctree directive

you could do this by placing an index.rst file in each directory and generating the toctree so that there is an automatic navigation system in place for any ad-hoc collection of files. however, the actual index.rst files would be empty aside from a table of contents