Issues

Issue #795 resolved

Section headings in only directives are not correctly handled

Christian Jann
created an issue

I'm not completely sure if it's a bug or just my fault, because I'm relatively new to sphinx.

So the following does not work: {{{ .. only:: html

This is missing in html =======================

This is completely missing in html

  • :ref:genindex
  • :ref:modindex
  • :ref:search
  • :doc:TODO <todo> }}} while the following does: {{{ .. only:: html

This Works }}} In http://sphinx.pocoo.org/changes.html#release-1-1-oct-9-2011 is written: "Section headings in only directives are now correctly handled.", I don't think this is the case, I'm using Sphinx 1.2pre, compiled yesterday.

I've noticed that it works in other rst files which are included via toctree but not in index.rst. I've even created an new empty documentation via sphinx-quickstart with the same result. Is this even possible? Could somebody confirm this?

Comments (7)

  1. Anonymous

    I'm experiencing the same issue, with Sphinx 1.1.2. To make it more concrete, I want to include a "see also" section only in the manpage version of a document:

    .. only:: man
    
        See Also
        --------
    
        blah blah
    

    However, I notice that this problem doesn't occur if the heading level is below that of the previous section.

  2. Log in to comment