title: How to re-render certain object descriptions with Sphinx docs?
body: <p>Using <a href="https://www.sphinx-doc.org/en/1.8/usage/restructuredtext/domains.html" rel="nofollow noreferrer">Sphinx's domain-aware</a> <code>ObjectDescription</code>s I can create fancy rendered documentation for them. For example:</p>
  
  <pre><code>.. py:function:: pyfunc()
  
     Describes a Python function.
  </code></pre>
  
  <p>This renders the content in a nice way, and this works really well with module indices, references and so on. Cool so far! </p>
  
  <p>Now, let's say I have that directive in a source document <code>src/mymodule/functions.rst</code>, and I have a bunch of text in <code>src/guide/getting-started.rst</code>, I can reference to the objects like</p>
  
  <pre><code>:py:func:`pyfunc`
  </code></pre>
  
  <p>Also cool!</p>
  
  <p>Now, my actual question; Could I also tell the Sphinx writer to re-render the same documentation snippet for that object? To ease the user in not having to navigating away from the Getting Started page where I just want to include a single piece of content again.</p>
  
  <p>What I've tried to do:</p>
  
  <ul>
  <li>Simply copy the contents. This results in a warning that the object is defined multiple times, hurts the index and as a result references don't point to the "authoritative" place in your project, if unlucky. Not okay.</li>
  <li>Document each object in its own file and then use <code>.. include:: rel/path/to/pyfunc.rst</code> in each document where I want to render it. As those includes are literal on ReST-level, this results in the same downsides as the option above. :-(</li>
  </ul>
  
  <p>Thus, I'm looking for a solution where I would tell the renderer/writer of Sphinx to simply re-render the contents of a reference instead of producing a link. It should not add it to the index for a simple re-render.</p>
  
  <p>I'm okay with a custom extension or a domain-specific custom solution - I'm already using my own custom domain, but I just used the general Python domain above as a well-known example.</p>
  
  <hr>
  
  <p><sup>
  Context for the use case: I'm building a Protobuf domain. Protobuf messages and enums are reused a lot and I would like to show the context of commonly reused objects inline on pages where this is useful to the reader. This means it is repeated over the whole project on purpose where it is deemed useful rather than navigating away all the time. Yet only the reference page should be "authoritative".
  </sup></p>