Reputation: 978
Is it possible to have Sphinx ignore part of index.rst when building the pdf with latexpdf?
For example, my index.rst file contains (but does not begin with) the lines
.. image:: https://img.shields.io/....
:target: https://pypi.org/....
.. image:: https://travis-ci.org/....
:target: https://travis-ci.org/...
.. image:: https://coveralls.io/repos/github/....
:target: https://coveralls.io/github/....
.. image:: https://readthedocs.org/.....
:target: https://libensemble.readthedocs.org/....
These should appear in the html that is built, but not in the PDF. I didn't see anything here: https://www.sphinx-doc.org/en/master/latex.html
Is it possible to tell sphinx to ignore these lines?
Upvotes: 4
Views: 639
Reputation: 673
I think you could use only directive:
index.rst
.. only:: html
.. image:: https://readthedocs.org/.....
:target: https://libensemble.readthedocs.org/....
Makefile
htmldoc:
make -e SPHINXOPTS="-t html" html
Upvotes: 4