Re: comments vs. directives

Schimon Jehudah via Docutils-users <[email protected]> Fri, 10 Oct 2025 08:44:51 +0300
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
--MP_/mW/oj89aJbfBUe2J5VK17xh
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Guenter. Good day.

I think that I already did that, after you asked, but upon my documents.

I have created a test file which is based only on your text.

Upon executing command rst2xml, Docutils outputs a couple of errors,
one for author and one for date.

I assume that these are errors of the directives author:: and date::
with two colons.


$ rst2xml rst_preambles_and_directives_sample.rst >rst_preambles_and_direct=
ives_sample.xml
rst_preambles_and_directives_sample.rst:7: (ERROR/3) Unknown directive type=
 "author".

.. author:: My Lin

rst_preambles_and_directives_sample.rst:11: (ERROR/3) Invalid context: the =
"date" directive can only be used within a substitution definition.


Schimon

On Thu, 9 Oct 2025 18:46:31 -0000 (UTC)
Guenter Milde via Docutils-users <[email protected]>
wrote:

> On 2025-10-09, Schimon Jehudah via Docutils-users wrote:
> ...
>=20
>=20
> >> >> The preamble seems to use no standard but a home-grown syntax
> >> >> that looks confusingly similar to reStructuredtext directives.
> >> >>  =20
>=20
> >> > How so?   =20
>=20
> ...
>=20
> Steps to find out why I call the current Rivista metadata syntax=20
> "confusingly similar" to Docutils directives:
>=20
> * create a file containing
>=20
>     .. title: My simple example
>=20
>     .. title:: My simple example
>=20
> * convert with rst2xml to see how the two statements are interpreted
> by the docutils "rst" parser.
>  =20
> * Optionally repeat with
>=20
>     .. author: My Lin
>=20
>     .. author:: My Lin
>=20
> * Optionally repeat with
>=20
>     .. date: 2025-10-09
>=20
>     .. date: 2025-10-09
>=20

Did you mean to add two consequent colons to the second instance of
"date" (i.e. "date::")?

>=20
> G=C3=BCnter
>=20
>=20
>=20
> _______________________________________________
> Docutils-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/docutils-users
>=20
> Please use "Reply All" to reply to the list.

--MP_/mW/oj89aJbfBUe2J5VK17xh
Content-Type: text/x-rst
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=rst_preambles_and_directives_sample.rst

    .. title: My simple example

    .. title:: My simple example

    .. author: My Lin

    .. author:: My Lin

    .. date: 2025-10-09

    .. date:: 2025-10-09

--MP_/mW/oj89aJbfBUe2J5VK17xh
Content-Type: application/xml
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename=rst_preambles_and_directives_sample.xml

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIGRvY3VtZW50
IFBVQkxJQyAiKy8vSUROIGRvY3V0aWxzLnNvdXJjZWZvcmdlLm5ldC8vRFREIERvY3V0aWxzIEdl
bmVyaWMvL0VOLy9YTUwiICJodHRwOi8vZG9jdXRpbHMuc291cmNlZm9yZ2UubmV0L2RvY3MvcmVm
L2RvY3V0aWxzLmR0ZCI+CjwhLS0gR2VuZXJhdGVkIGJ5IERvY3V0aWxzIDAuMjEuMiAtLT4KPGRv
Y3VtZW50IHNvdXJjZT0icnN0X3ByZWFtYmxlc19hbmRfZGlyZWN0aXZlc19zYW1wbGUucnN0IiB0
aXRsZT0iTXkgc2ltcGxlIGV4YW1wbGUiPjxibG9ja19xdW90ZT48Y29tbWVudCB4bWw6c3BhY2U9
InByZXNlcnZlIj50aXRsZTogTXkgc2ltcGxlIGV4YW1wbGU8L2NvbW1lbnQ+PGNvbW1lbnQgeG1s
OnNwYWNlPSJwcmVzZXJ2ZSI+YXV0aG9yOiBNeSBMaW48L2NvbW1lbnQ+PHN5c3RlbV9tZXNzYWdl
IGxldmVsPSIzIiBsaW5lPSI3IiBzb3VyY2U9InJzdF9wcmVhbWJsZXNfYW5kX2RpcmVjdGl2ZXNf
c2FtcGxlLnJzdCIgdHlwZT0iRVJST1IiPjxwYXJhZ3JhcGg+VW5rbm93biBkaXJlY3RpdmUgdHlw
ZSAiYXV0aG9yIi48L3BhcmFncmFwaD48bGl0ZXJhbF9ibG9jayB4bWw6c3BhY2U9InByZXNlcnZl
Ij4uLiBhdXRob3I6OiBNeSBMaW4KPC9saXRlcmFsX2Jsb2NrPjwvc3lzdGVtX21lc3NhZ2U+PGNv
bW1lbnQgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+ZGF0ZTogMjAyNS0xMC0wOTwvY29tbWVudD48c3lz
dGVtX21lc3NhZ2UgbGV2ZWw9IjMiIGxpbmU9IjExIiBzb3VyY2U9InJzdF9wcmVhbWJsZXNfYW5k
X2RpcmVjdGl2ZXNfc2FtcGxlLnJzdCIgdHlwZT0iRVJST1IiPjxwYXJhZ3JhcGg+SW52YWxpZCBj
b250ZXh0OiB0aGUgImRhdGUiIGRpcmVjdGl2ZSBjYW4gb25seSBiZSB1c2VkIHdpdGhpbiBhIHN1
YnN0aXR1dGlvbiBkZWZpbml0aW9uLjwvcGFyYWdyYXBoPjxsaXRlcmFsX2Jsb2NrIHhtbDpzcGFj
ZT0icHJlc2VydmUiPi4uIGRhdGU6OiAyMDI1LTEwLTA5PC9saXRlcmFsX2Jsb2NrPjwvc3lzdGVt
X21lc3NhZ2U+PC9ibG9ja19xdW90ZT48L2RvY3VtZW50Pg==

--MP_/mW/oj89aJbfBUe2J5VK17xh
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--MP_/mW/oj89aJbfBUe2J5VK17xh
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline