Skip to content
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

Incorrect section in manpages generated by ocamldoc #3412

Closed
vicuna opened this issue Jan 1, 2005 · 2 comments
Closed

Incorrect section in manpages generated by ocamldoc #3412

vicuna opened this issue Jan 1, 2005 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 1, 2005

Original bug ID: 3412
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Samuel Mimram
Version: 3.08.2
OS: linux
Submission from: 84.97.221.8 (84.97.221.8)

I think the section for the manpages generated by ocamldoc is wrong.

According to man 7 man, the .TH macro's second argument should be the section
number:

.TH title section date source manual

where "section" is the section number the man page should be placed in (e.g.,
7).

For example (in odoc_man.ml):

method generate_for_module m =
  let date = Unix.time () in
  let file = self#file_name m.m_name in
  try
    let chanout = self#open_out file in
let b = new_buf () in
    bs b ".TH \"";
bs b Odoc_messages.modul;
bs b "\" ";
    bs b (m.m_name^" ");
          ^^^^^^^^
          It should be the section here, not the module name
    [...]

The other generate_for_* functions are also affected.

I think that the most sensible thing to do would be to use
!Odoc_args.man_suffix. A quick patch follows.

Regards,

Samuel.


diff -ru ocaml-3.08.2.old/ocamldoc/odoc_man.ml
ocaml-3.08.2/ocamldoc/odoc_man.ml
--- ocaml-3.08.2.old/ocamldoc/odoc_man.ml 2004-12-28 17:44:43.000000000 +0100
+++ ocaml-3.08.2/ocamldoc/odoc_man.ml 2004-12-28 18:05:27.000000000 +0100
@@ -655,8 +655,8 @@
let chanout = self#open_out file in
let b = new_buf () in
bs b ".TH "";

  • bs b Odoc_messages.clas;
  • bs b ("" "^cl.cl_name^" ");
  • bs b cl.cl_name;
  • bs b ("" "^ !Odoc_args.man_suffix ^" ");
    bs b ("""^(Odoc_misc.string_of_date ~hour: false date)^"" ");
    bs b "OCamldoc ";
    bs b ("""^(match !Args.title with Some t -> t | None -> "")^""\n");
    @@ -714,8 +714,8 @@
    try
    let chanout = self#open_out file in
    let b = new_buf () in
  • bs b (".TH ""^Odoc_messages.class_type^"" ");
  •    bs b (ct.clt_name^" ");
    
  • bs b (".TH ""^ct.clt_name^"" ");
  •    bs b (!Odoc_args.man_suffix^" ");
       bs b ("\""^(Odoc_misc.string_of_date ~hour: false date)^"\" ");
       bs b "OCamldoc ";
       bs b ("\""^(match !Args.title with Some t -> t | None -> "")^"\"\n");
    

@@ -771,8 +771,8 @@
try
let chanout = self#open_out file in
let b = new_buf () in

  • bs b (".TH ""^Odoc_messages.module_type^"" ");
  •    bs b (mt.mt_name^" ");
    
  • bs b (".TH ""^mt.mt_name^"" ");
  •    bs b (!Odoc_args.man_suffix^" ");
       bs b ("\""^(Odoc_misc.string_of_date ~hour: false date)^"\" ");
       bs b "OCamldoc ";
       bs b ("\""^(match !Args.title with Some t -> t | None -> "")^"\"\n");
    

@@ -850,9 +850,9 @@
let chanout = self#open_out file in
let b = new_buf () in
bs b ".TH "";

  • bs b Odoc_messages.modul;
  • bs b m.m_name;
    bs b "" ";
  •    bs b (m.m_name^" ");
    
  •    bs b (!Odoc_args.man_suffix^" ");
       bs b ("\""^(Odoc_misc.string_of_date ~hour: false date)^"\" ");
       bs b "OCamldoc ";
       bs b ("\""^(match !Args.title with Some t -> t | None -> "")^"\"\n");
    

@@ -979,7 +979,7 @@
let chanout = self#open_out file in
let b = new_buf () in
bs b (".TH ""^name^"" ");

  •    bs b "man ";
    
  •    bs b (!Odoc_args.man_suffix^" ");
       bs b ("\""^(Odoc_misc.string_of_date ~hour: false date)^"\" ");
       bs b "OCamldoc ";
       bs b ("\""^(match !Args.title with Some t -> t | None -> "")^"\"\n");
    
@vicuna
Copy link
Author

vicuna commented Feb 18, 2005

Comment author: administrator

Hello,

This is now fixed in the CVS by adding a -man-section option. -man-suffix is
used for filename suffixes
(default is 3o), -man-section is for section number inside files (default is
3).

Thanks for your report and your patch.

Regards,

Maxence Guesdon

@vicuna
Copy link
Author

vicuna commented Feb 18, 2005

Comment author: administrator

Fixed by adding a -man-section option. -man-suffix is used for filename
suffixes
(default is 3o), -man-section is for section number inside files (default is 3).

@vicuna vicuna closed this as completed Feb 18, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant