Clarify python doxygen code block indentation handling
Clarify usage and comments for the codeIndent string, the intent of which was not clear after recent updates.
This commit is contained in:
parent
0c6930d966
commit
08ac56b7f2
1 changed files with 6 additions and 4 deletions
|
|
@ -499,16 +499,18 @@ void PyDocConverter::handleCode(DoxygenEntity &tag, std::string &translatedComme
|
||||||
translatedComment += '\n';
|
translatedComment += '\n';
|
||||||
|
|
||||||
// Use the current indent for the code-block line itself.
|
// Use the current indent for the code-block line itself.
|
||||||
string codeIndent = indent.getFirstLineIndent();
|
translatedComment += indent.getFirstLineIndent();
|
||||||
translatedComment += codeIndent;
|
|
||||||
|
|
||||||
// Go out on a limb and assume that examples in the C or C++ sources use C++.
|
// Go out on a limb and assume that examples in the C or C++ sources use C++.
|
||||||
// In the worst case, we'll highlight C code using C++ syntax which is not a
|
// In the worst case, we'll highlight C code using C++ syntax which is not a
|
||||||
// big deal (TODO: handle Doxygen code command language argument).
|
// big deal (TODO: handle Doxygen code command language argument).
|
||||||
translatedComment += ".. code-block:: c++\n\n";
|
translatedComment += ".. code-block:: c++\n\n";
|
||||||
|
|
||||||
// For now on, use extra indent level for all the subsequent lines.
|
// Specify the level of extra indentation that will be used for
|
||||||
codeIndent = m_indent;
|
// subsequent lines within the code block. Note that the correct
|
||||||
|
// "starting indentation" is already present in the input, so we
|
||||||
|
// only need to add the desired code block indentation.
|
||||||
|
string codeIndent = m_indent;
|
||||||
|
|
||||||
std::string code;
|
std::string code;
|
||||||
handleTagVerbatim(tag, code, arg);
|
handleTagVerbatim(tag, code, arg);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue