Sphinx error: Inline literal start-string without end-string#
Did you Sphinx documentation project has failed with the error Inline literal start-string without end-string? This guide provides an explanation and solution to resolve the issue.
Symptom#
Sphinx build failed with the error similar to:
WARNING: Inline literal start-string without end-string.
Worry-free Sphinx?
Documatt app is a Sphinx-based tool which hides its complexity with free hosting for your books and docs.
Reason#
Inline literal is a text used usually for code examples. It must start and end with double backtick ``
.
This error means you forgot to properly terminate inline literal with trailing ``
.
Example#
Example 1#
Name RetValue
has missing trailing ``
.
Exit code of a process is stored in the ``RetValue variable.
Example 1: Solution#
Enclose name RetValue
by leading and trailing ``
.
Exit code of a process is stored in the ``RetValue`` variable.
Example 2#
More tricky example that causes this error is if you don’t separate inline literal from surrounding text by whitespace.
Python ``list``s use square bracket syntax.
Example 2: Solution#
Normally, inline elements must be separated from the each other by the whitespace(s).
Fortunately, two inline elements without no space in-between are possible with escaping mechanism using backslash character \
. Previous example fixed:
Python ``list``\s use square bracket syntax.