Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-enumerated lists not working when including content based on tags #1972

Closed
berendt opened this issue Jul 27, 2015 · 2 comments
Closed

Comments

@berendt
Copy link

berendt commented Jul 27, 2015

Auto-enumerated lists (#.) are not working when including content based on tags (.. only:: TAG).

Let's have a look at the following example document:

#. 1st entry

#. 2nd entry

.. only:: foo

   #. 3rd entry for tag ``foo``

#. 3rd entry, 4th entry for tag ``foo``

.. only:: foo or bar

   #. 5th entry for tag ``foo``, 4th entry for tag ``bar``

#. 4th entry, 6th entry for tag ``foo``, 5th entry for ``bar``

#. 5th entry, 7th entry for tag ``foo``, 6th entry for ``bar``

Result for sphinx-build -t foo ...:

1. 1st entry
2. 2nd entry

1. 3rd entry for tag foo

1. 3rd entry, 4th entry for tag foo

1. 5th entry for tag foo, 4th entry for tag bar

1. 4th entry, 6th entry for tag foo, 5th entry for bar
2. 5th entry, 7th entry for tag foo, 6th entry for bar

Expected result for sphinx-build -t foo ...:

1. 1st entry
2. 2nd entry
3. 3rd entry for tag foo
4. 3rd entry, 4th entry for tag foo
5. 5th entry for tag foo, 4th entry for tag bar
6. 4th entry, 6th entry for tag foo, 5th entry for bar
7. 5th entry, 7th entry for tag foo, 6th entry for bar

Result for sphinx-build -t bar ...:

1. 1st entry
2. 2nd entry

1. 3rd entry, 4th entry for tag foo

1. 5th entry for tag foo, 4th entry for tag bar

1. 4th entry, 6th entry for tag foo, 5th entry for bar
2. 5th entry, 7th entry for tag foo, 6th entry for bar

Expected result for sphinx-build -t bar ...:

1. 1st entry
2. 2nd entry
3. 3rd entry, 4th entry for tag foo
4. 5th entry for tag foo, 4th entry for tag bar
5. 4th entry, 6th entry for tag foo, 5th entry for bar
6. 5th entry, 7th entry for tag foo, 6th entry for bar

Result for sphinx-build ...:

1. 1st entry
2. 2nd entry

1. 3rd entry, 4th entry for tag foo

1. 4th entry, 6th entry for tag foo, 5th entry for bar
2. 5th entry, 7th entry for tag foo, 6th entry for bar

Expected result for sphinx-build ...:

1. 1st entry
2. 2nd entry
3. 3rd entry, 4th entry for tag foo
4. 4th entry, 6th entry for tag foo, 5th entry for bar
5. 5th entry, 7th entry for tag foo, 6th entry for bar
@shimizukawa
Copy link
Member

In fact, .. only:: directive doesn't match for such situation. Directives always create new paragraph block, it means that directives terminate the continuous processing of the immediately preceding.
It's a specification of docutils, so then there is no way to get the results as your expectations from sphinx side.

@berendt
Copy link
Author

berendt commented Jul 27, 2015

Thanks for the fast reply and the clarification.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants