Skip to content

Commit

Permalink
Update generated MD file
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb committed May 17, 2024
1 parent 5bfdd68 commit 04c4207
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Modules/jaspDescriptives
2 changes: 1 addition & 1 deletion Modules/jaspDistributions
8 changes: 6 additions & 2 deletions QMLComponents/controls/jaspcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,15 @@ bool JASPControl::printLabelMD(QStringList& md, int depth) const
return false;

// Print the label as a header, in italic or in bold
if (infoLabelIsHeader()) md << QString{depth + 2, '#' } << " ";
if (infoLabelIsHeader()) md << "<h" << QString::number(depth + 2) << ">";
else if (infoLabelItalic()) md << "*";
else md << "**";

if (infoAddControlType()) md << (friendlyName() + (!label.isEmpty() ? " - " : ""));

md << label;

if (infoLabelIsHeader()) md << "\n";
if (infoLabelIsHeader()) md << "</h" << QString::number(depth + 2) << ">\n";
else
{
md << (infoLabelItalic() ? "*" : "**");
Expand Down Expand Up @@ -596,8 +596,12 @@ QString JASPControl::helpMD(int depth) const
bool hasLabel = printLabelMD(markdown, depth);
markdown << info();

if (infoLabelIsHeader() && !info().isEmpty())
markdown << "\n\n";

if (childMDs.length() == 0)
markdown << "\n";

else if (childMDs.length() == 1)
markdown << QString{depth * 2, ' '} << childMDs[0];
else
Expand Down

0 comments on commit 04c4207

Please sign in to comment.