"Some fluctuation-dependent properties can be calculated provided",
"the correct energy terms are selected, and that the command line option",
"[TT]-fluct_props[tt] is given. The following properties",
- "will be computed:[BR]",
- "Property Energy terms needed[BR]",
- "---------------------------------------------------[BR]",
- "Heat capacity C[SUB]p[sub] (NPT sims): Enthalpy, Temp [BR]",
- "Heat capacity C[SUB]v[sub] (NVT sims): Etot, Temp [BR]",
- "Thermal expansion coeff. (NPT): Enthalpy, Vol, Temp[BR]",
- "Isothermal compressibility: Vol, Temp [BR]",
- "Adiabatic bulk modulus: Vol, Temp [BR]",
- "---------------------------------------------------[BR]",
+ "will be computed:",
+ "",
+ "=============================== ===================",
+ "Property Energy terms needed",
+ "=============================== ===================",
+ "Heat capacity C[SUB]p[sub] (NPT sims): Enthalpy, Temp",
+ "Heat capacity C[SUB]v[sub] (NVT sims): Etot, Temp",
+ "Thermal expansion coeff. (NPT): Enthalpy, Vol, Temp",
+ "Isothermal compressibility: Vol, Temp",
+ "Adiabatic bulk modulus: Vol, Temp",
+ "=============================== ===================",
+ "",
"You always need to set the number of molecules [TT]-nmol[tt].",
"The C[SUB]p[sub]/C[SUB]v[sub] computations do [BB]not[bb] include any corrections",
"for quantum effects. Use the [gmx-dos] program if you need that (and you do).[PAR]"
return false;
}
+/*! \brief
+ * Returns `true` if a table starts in \p text at \p index.
+ *
+ * The function only inspects the first line for something that looks like a
+ * reStructuredText table, and accepts also some malformed tables.
+ * Any issues should be apparent when Sphinx parses the reStructuredText
+ * export, so full validation is not done here.
+ *
+ * Does not throw.
+ */
+bool startsTable(const std::string &text, size_t index)
+{
+ if (text[index] == '=')
+ {
+ while (index < text.length() && text[index] != '\n')
+ {
+ if (text[index] != '=' && !std::isspace(text[index]))
+ {
+ return false;
+ }
+ ++index;
+ }
+ return true;
+ }
+ else if (text[index] == '+')
+ {
+ while (index < text.length() && text[index] != '\n')
+ {
+ if (text[index] != '-' && text[index] != '+')
+ {
+ return false;
+ }
+ ++index;
+ }
+ return true;
+ }
+ return false;
+}
+
//! \}
} // namespace
}
indent = currentIndent + prefixLength;
}
+ else if (currentLine == 0 && startsTable(result, i))
+ {
+ bLiteral = true;
+ }
bLineStart = false;
}
paragraph.push_back(result[i]);
testFormatting(text);
}
+TEST_F(HelpWriterContextTest, FormatsSimpleTable)
+{
+ const char *const text[] = {
+ "Simple table:",
+ "",
+ "============ =============",
+ "First column Second header",
+ "============ =============",
+ "text text",
+ "============ =============",
+ "",
+ "Normal paragraph",
+ "again."
+ };
+ testFormatting(text);
+}
+
+TEST_F(HelpWriterContextTest, FormatsGridTable)
+{
+ const char *const text[] = {
+ "Grid table:",
+ "",
+ "+--------------+---------------+",
+ "| First column | Second header |",
+ "+--------------+---------------+",
+ "| text | text |",
+ "+--------------+---------------+",
+ "",
+ "Normal paragraph",
+ "again."
+ };
+ testFormatting(text);
+}
+
} // namespace
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <String Name="Console"><![CDATA[
+Grid table:
+
++--------------+---------------+
+| First column | Second header |
++--------------+---------------+
+| text | text |
++--------------+---------------+
+
+Normal paragraph again.]]></String>
+ <String Name="reStructuredText"><![CDATA[
+Grid table:
+
++--------------+---------------+
+| First column | Second header |
++--------------+---------------+
+| text | text |
++--------------+---------------+
+
+Normal paragraph
+again.]]></String>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <String Name="Console"><![CDATA[
+Simple table:
+
+============ =============
+First column Second header
+============ =============
+text text
+============ =============
+
+Normal paragraph again.]]></String>
+ <String Name="reStructuredText"><![CDATA[
+Simple table:
+
+============ =============
+First column Second header
+============ =============
+text text
+============ =============
+
+Normal paragraph
+again.]]></String>
+</ReferenceData>