-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
manpage paragraph incorrect indentation #13803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For the cmdline docs (parsed by |
Like when we list a series of options and then want to add "normal" text again afterwards. Without this, the indentation level wrongly continues even after the final "##" header, making following text wrongly appear to belong to the header above. Adjusted CURLOPT_SSLVERSION.md to use this to show the idea. Fixes #13803 Reported-by: Jay Satiro
That's a good idea but it runs into the same issue I had with .PP when generating the html via roffit. If I decrease the indent level on .pp that seems to work. Or maybe reset the indent level to 0? diff --git a/roffit b/roffit
index 56c1fda..c01cfef 100755
--- a/roffit
+++ b/roffit
@@ -499,12 +499,13 @@ sub parsefile {
elsif($keyword =~ /^pp$/i) {
# PP ends a TP section, but some TP sections don't use it
# Often used to separate paragraphs
$within_tp=0;
showp(@p);
@p="";
+ $indentlevel-- if ($indentlevel);
}
elsif($keyword =~ /^fi$/i) {
# .fi = fill-in, extra space will be ignored and text that is
# entered like this, the fill-in command will continue until
# you enter a .nf command and vice-versa
|
That seems to be a roffit issue as the man page looks fine with this fix. |
Prior to this change when .PP (regular paragraph) was used after .IP (indented paragraph) roffit would not change the indent level which resulted in regular paragraphs having the same indent as the previously indented paragraph. Ref: curl/curl#13803 (comment) Closes #xxxxx
Thanks. Yes I agree, see proposal at bagder/roffit#48 |
Prior to this change when .PP (regular paragraph) was used after .IP (indented paragraph) roffit would not change the indent level which resulted in regular paragraphs having the same indent as the previously indented paragraph. Ref: curl/curl#13803 (comment) Closes #xxxxx
The manpages display correctly in curldown format but paragraphs may have incorrect indentation when converted to nroff format (via cd2nroff) and then further to html (via roffit). The incorrect indentation is visible in a few places in the libcurl option website documentation.
The problem seems to be
## header
in curldown format starts indented paragraph format (.IP
) for nroff but there's no way to stop the indentation for future paragraphs in the same section. CURLOPT_SSLVERSION for example:curl/docs/libcurl/opts/CURLOPT_SSLVERSION.md
Lines 66 to 82 in fd567d4
In this example
## CURL_SSLVERSION_TLSv1_3
will be converted by cd2nroff as.IP CURL_SSLVERSION_TLSv1_3
and then subsequent paragraphs are all indented so says nroff format. However that is not desired because the second paragraph that starts "The maximum TLS version..." is not supposed to be indented. In the pictures below I used a red arrow to indicate where the paragraph should be.scripts/cd2nroff < docs/libcurl/opts/CURLOPT_SSLVERSION.md | nroff -Tascii -man | grep ""
website version after roffit conversion of nroff generated by cd2nroff:
Older versions of curl used the nroff manpage format and so they had .RS/.RE for relative start/end of indentation, and roffit knew to end the indentation. For example this from 8.5.0:
curl/docs/libcurl/opts/CURLOPT_SSLVERSION.3
Lines 57 to 70 in 7161cb1
I tried for some time to fix this but nothing worked well enough that I want to build on it. The simplest fix I tried was resetting subsequent paragraph style via
.PP
rather than processing .RS .RE. Though that works for nroff to reset the indentation it does not work for roffit. Also- I'm not sure if this does what I intend in nroff anyway albeit it seems to work visually, at the cost of ending all indented paragraphs after a single paragraph.The text was updated successfully, but these errors were encountered: