Container for both body and structural elements (sections)

30 views
Skip to first unread message

Libor Jelínek

unread,
Jan 1, 2020, 12:16:10 PM1/1/20
to sphinx-users
I'm looking at container:: directive. It does almost what I want - wraps its content to <div>. Unfortunately container's allowed content are body elements only (paragraphs, lists, ...). I need put inside <div> also sections (and maybe other structural elements like topic or sidebar).

For example trying put section into container

.. container::
   
:name: my-container-id
   
   
My section title
   
================

causes "WARNING: Unexpected section title.".

Is there builtin or third-party directive that could contain both body and structural elements? Or am I supposed to write such directive myself?
Message has been deleted

Libor Jelinek

unread,
Jan 2, 2020, 5:17:53 AM1/2/20
to sphinx...@googlegroups.com
Can administrator ban above user "<chattc...@gmail.com>"? It's obviously a spam.

st 1. 1. 2020 v 20:05 odesílatel ฉัตรชัย กํามา <chattc...@gmail.com> napsal:
เมื่อ วันพฤหัสบดีที่ 2 มกราคม ค.ศ. 2020 0 นาฬิกา 16 นาที 10 วินาที UTC+7, Libor Jelínek เขียนว่า:
--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/e6a5103c-0b35-48ba-80f7-e93da25ea4bf%40googlegroups.com.

Komiya Takeshi

unread,
Jan 2, 2020, 9:46:07 AM1/2/20
to sphinx...@googlegroups.com
Hi,

Unfortunately, no such directive is not provided as built-in. AFAIK,
you need to write own directive for that purpose.
You can do it with `match_titles=True` option for nested_parse().

Thanks,
Takeshi KOMIYA

2020年1月2日(木) 2:16 Libor Jelínek <ljel...@virtage.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/1e8f2568-a7f6-4dbb-addf-fd02df9387cc%40googlegroups.com.

Myne

unread,
Jan 31, 2020, 10:37:18 PM1/31/20
to sphinx-users
Were you able to find a directive like this? I would be interested to use it as well.

Komiya Takeshi

unread,
Jan 31, 2020, 10:42:17 PM1/31/20
to sphinx...@googlegroups.com
It's one of standard reST directives. Please refer the reference of
reST in details:
https://docutils.sourceforge.io/docs/ref/rst/directives.html#container

2020年2月1日(土) 12:37 Myne <myne...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/7daadd6e-fac6-48f7-b39d-d946d7d6a380%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages