include directive in numbered lists

11 views
Skip to first unread message

Ron Stone

unread,
May 20, 2022, 3:02:51 PM5/20/22
to sphinx-users
Hi,

I have some procedures that have variable steps depending on the build context.

For example, I may need to add one additional step for one product version that does not exist in another.

I would like to be able to achieve this using include files for the additional steps and use I don't flag to control whether it is part of the build or not. My issue is that the step numbering resets at the point where the additional numbered items are inserted. For example:

extra_step.txt:
#. Do this conditional thing.

procedure.rst:
#. Do something.

#. Do something else.

.. only:: product_b

   .. include:: extra_step.txt

#. Final step.

Result in procedure.html:
1. Do something.

2. Do something else.

1. Do this conditional thing.

2. Final step.


Is this sort of conditionalization within a procedure achievable with Sphinx?

Thanks,
Ron
Reply all
Reply to author
Forward
0 new messages