title: How to correctly include other ReST-files in a sphinx-project?
body: <p>My hand-written documentation/user-guide (written in ReStructuredText with sphinx) has become quite big so I started organize my .rst-files in sub-directories. </p>
  
  <p>In the <code>index.rst</code> I'm including a <code>subindex.rst</code> of each sub-directory which itselfs includes other <code>.rst</code>-files for further sub-directories.</p>
  
  <p><code>index.rst</code>:</p>
  
  <pre><code>.. include:: subdir1/subindex.rst
  .. include:: subdir2/subindex.rst
  </code></pre>
  
  <p><code>subdir1/subindex.rst</code>:</p>
  
  <pre><code>.. include:: file1.rst
  .. include:: file2.rst
  </code></pre>
  
  <p>In principle this works well, except that sphinx is recursively looking for <code>.rst</code>-files which it tries to parse. without changing the current-working dir. So, it fails when seeing <code>include:: file1.rst</code> inside <code>subdir1</code>.</p>
  
  <p>I'm working around this issue by setting <code>exclude_pattern</code> to ignore my subdirs. This seems not right.</p>
  
  <p>What would be the right way to include a <code>.rst</code>-file of a subdir?</p>