@@ -812,11 +812,11 @@ struct HelpPass : public Pass {
812812 fprintf (f, " %s" , title_line.c_str ());
813813 fprintf (f, " %s - %s\n " , cmd.c_str (), title.c_str ());
814814 fprintf (f, " %s\n " , title_line.c_str ());
815- fprintf (f, " .. raw:: latex\n\n \\ begin{comment}\n\n " );
816815
817816 // render html
818817 fprintf (f, " .. cmd:def:: %s\n " , cmd.c_str ());
819- fprintf (f, " :title: %s\n\n " , title.c_str ());
818+ fprintf (f, " :title: %s\n\n " , title.c_str ());
819+ fprintf (f, " .. only:: html\n\n " );
820820 std::stringstream ss;
821821 std::string textcp = text;
822822 ss << text;
@@ -852,46 +852,45 @@ struct HelpPass : public Pass {
852852 if (IsUsage) {
853853 if (stripped_line.compare (0 , 4 , " See " ) == 0 ) {
854854 // description refers to another function
855- fprintf (f, " \n %s\n " , stripped_line.c_str ());
855+ fprintf (f, " \n %s\n " , stripped_line.c_str ());
856856 } else {
857857 // usage should be the first line of help output
858- fprintf (f, " \n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
858+ fprintf (f, " \n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
859859 WasDefinition = true ;
860860 }
861861 IsUsage = false ;
862862 } else if (IsIndent && NewUsage && (blank_count >= 2 || WasDefinition)) {
863863 // another usage block
864- fprintf (f, " \n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
864+ fprintf (f, " \n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
865865 WasDefinition = true ;
866866 def_strip_count = 0 ;
867867 } else if (IsIndent && IsDefinition && (blank_count || WasDefinition)) {
868868 // format definition term
869- fprintf (f, " \n\n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
869+ fprintf (f, " \n\n .. code:: yoscrypt\n\n %s\n\n " , stripped_line.c_str ());
870870 WasDefinition = true ;
871871 def_strip_count = first_pos;
872872 } else {
873873 if (IsDedent) {
874- fprintf (f, " \n\n ::\n " );
874+ fprintf (f, " \n\n ::\n " );
875875 def_strip_count = first_pos;
876876 } else if (WasDefinition) {
877- fprintf (f, " ::\n " );
877+ fprintf (f, " ::\n " );
878878 WasDefinition = false ;
879879 }
880- fprintf (f, " \n %s" , line.substr (def_strip_count, std::string::npos).c_str ());
880+ fprintf (f, " \n %s" , line.substr (def_strip_count, std::string::npos).c_str ());
881881 }
882882
883883 blank_count = 0 ;
884884 }
885885 fputc (' \n ' , f);
886886
887887 // render latex
888- fprintf (f, " .. raw:: latex\n\n \\ end{comment}\n\n " );
889888 fprintf (f, " .. only:: latex\n\n " );
890- fprintf (f, " ::\n\n " );
889+ fprintf (f, " ::\n\n " );
891890 std::stringstream ss2;
892891 ss2 << textcp;
893892 for (std::string line; std::getline (ss2, line, ' \n ' );) {
894- fprintf (f, " %s\n " , line.c_str ());
893+ fprintf (f, " %s\n " , line.c_str ());
895894 }
896895 fclose (f);
897896 }
0 commit comments