-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 11.03.2010 16:42, schrieb dankelley: > I'm trying to use a relative filename in my toc, but cannot see how. > I have my code below. Is there a way to do this? (The reason I want > to do it is that I'm trying to document a data archive, and I'd like > the files in the archive to be familiar to users, e.g. without having > things like "conf.py" in the directory.) > > .. toctree:: > > ../data_archive/README
You can reference relative files in a toctree, but only if they are within or under the Sphinx source directory. This is because the location of the file in the directory structure also determines its output path (for HTML output at least). What you can do however (and this is also how Sphinx does it for its CHANGES and EXAMPLES files, look at doc/changes.rst and doc/examples.rst) is to create a new document with the wanted name and only an "include" directive in it: .. this is readme.txt (or readme.rst) .. include:: ../README The file in question will then be included at build time. It will also be noted as a dependency of the reST file and therefore rebuilt if README changes. cheers, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAku7cWwACgkQN9GcIYhpnLAdlACfahtCbNnNyfae8OPDJiZcPKkz +NUAnRwiiNk7rKaIbA6aLjAiTbTDsEft =SK4i -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
