0

I'm generating a documentation with sphinx and i would like to include some xml examples that are stored in separate files. Is it possible to include an external xml file in such a way that the output doc uses the proper highlighting?

I tried .. include:: file.xml inside my rst. but the highlighting was broken and I could not fix it.

1

1 Answer 1

1

Use the literalinclude directive.

.. literalinclude:: file.xml :language: xml 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.