Skip to content

OCamldoc rendering in OCaml 5 worse than OCaml 4 #13896

Closed

Description

@johnwhitington

(To my eyes anyway.)

Here's 4.14.2:

Image

Here's 5.04+trunk:

Image

The vertical alignment is off in the second column. Perhaps a well-intentioned change to add a little space which went wrong?

My invocation is just ocamldoc -html ...

Activity

  1. Octachron commented on Mar 26, 2025

    @Octachron
    Member

    There is a padding problem in the css in your examples, but as far as I can see the html structure on the indexes did not change between OCaml 4.14 and OCaml 5.x. Could you link the generated html of your examples?

  2. johnwhitington commented on Mar 26, 2025

    @johnwhitington
    ContributorAuthor

    The style.css has not changed. But index.html has:

    $ diff -ua ~/Desktop/5.4.0+trunk/index.html ~/Desktop/4.14.2/index.html
    --- /Users/john/Desktop/5.4.0+trunk/index.html	2025-03-26 16:39:30
    +++ /Users/john/Desktop/4.14.2/index.html	2025-03-26 16:38:13
    @@ -1,8 +1,8 @@
    -<!DOCTYPE html>
    +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     <html>
     <head>
     <link rel="stylesheet" href="style.css" type="text/css">
    -<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    +<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="Start" href="index.html">
     <link title="Index of types" rel=Appendix href="index_types.html">
    

    No idea why that should change anything, but it does. I checked in Chrome too (screenshots above are Safari). Same result.

    Here's the full data:

    camlpdf_docs.zip

  3. Octachron commented on Mar 26, 2025

    @Octachron
    Member

    I see what is happening: the style change is due to the <!DOCTYPE html> header.
    Without this header browsers are using the quirky rendering mode, rather than correct html rendering.
    The right fix is probably to update the default css to remove the padding around first paragraphs in tables.

  4. added a commit that references this issue on Jun 19, 2025
    872b210
  5. Octachron commented on Jun 20, 2025

    @Octachron
    Member

    This will be fixed in 5.4, thanks against for the report !

  6. added a commit that references this issue on Jun 20, 2025
    19040f8
  7. added a commit that references this issue on Jun 23, 2025
    8966ab7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions