Re: Output format argument for meta directive

Guenter Milde via Docutils-users <[email protected]> Mon, 24 Aug 2020 13:12:32 -0000 (UTC)
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2020-08-12, Rickard Armiento wrote:
> Hi,

> I've been working on a set of transformations of reST to various output, 
> most notably to reveal.js-based slides (I have a repo at 
> https://github.com/rartino/httk-rsttools - but it is still very much 
> work in progress.)

> In the 'Directives' documentation file, the meta directive is presently 
> the only implemented directive under the 'HTML-Specific' headline and 
> its description is indeed very HTML-specific.

> I have multiple times found myself looking for a way to include metadata 
> in my source documents for use in other contexts and for other output 
> formats, and thus found the HTML-only nature of meta inelegant.

> Is there a reason the 'meta' directive doesn't take an output format 
> argument, making it possible to use it for meta-data in contexts also 
> outside HTML? I.e., to make it work much like the argument to the 'raw' 
> directive, e.g.:
>    .. meta:: pdf

> Is this something that could be considered for inclusion in the reST 
> standard?

Making "meta" available for other formats is a valuable extension.

There is a already some support in the ODF/ODT writer, however, I don't know
whether it works and how to test.
There is also a TODO comment in the LaTeX writer.

I wonder whether an output format option would be required or if it could be
made generic (with formats not supporting meta giving an INFO or WARNING
message about ignoring the content).
(Different meta content for different outputs from the same source could also
be achieved with more generic settings and class argument values.)

More detailled suggestions and patches are welcome and will be discussed
here or in the developers list. 
Alternatively, an enhancement ticket could be opened at
https://sourceforge.net/p/docutils/feature-requests/
so the idea is not forgotten in the long term.


Thank you for the suggestion,
Günter



_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.