Insert text depending on output file type.

13 views
Skip to first unread message

Jason Viloria

unread,
Oct 27, 2021, 3:43:40 AM10/27/21
to sphinx-users
Hi, 

Is it possible to add text conditionaly. The use case I am thinking of is, that I create wikimedia output which I currently automatically post to our internal wiki. 

I would like it to conditially output a  notice that says "Generated from sphinx.Do not edit, update and build  <git url for sphinx sources>  will update this wiki entry"

But I would not want the message showing when the output is html or pdf. 

Thanks

Komiya Takeshi

unread,
Oct 27, 2021, 12:44:54 PM10/27/21
to sphinx...@googlegroups.com
Hi,

How about using the "only" directive? It can output only on generating
arbitrary format.
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-only

Thanks,
Takeshi KOMIYA

2021年10月27日(水) 16:44 Jason Viloria <jnv...@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/c9de65cc-48f4-4d0b-a812-8794b55a3d22n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages