Skip to content

Conversation

jonludlam
Copy link
Member

@jonludlam jonludlam commented Jan 26, 2021

Add a parameter to html-generate to format the output nicely - useful for diffing

Also this no longer causes exceptions when processing 'packed' compilation units.

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

| `Class of signature * ClassName.t
| `ClassType of signature * ClassTypeName.t ]

type leaf = [ module_ | type_ ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about classes, substs and others ?
(Would help move the assert false from render_resolved_fragment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refers to the type of the substitution - ie, X with module Y=Z or X with type t = u -- so only module or type required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I got confused by the type t below. Why does it include everything ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the union one, helpful for printers and the like. it's quite handy to have just the leaf one so we don't have to deal with the Root constructor unnecessarily

Comment on lines +380 to +382
let indent =
let doc = "Format the output HTML files with indentation" in
Arg.(value & flag (info ~doc [ "indent" ]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about enabling it by default without exposing the option ? Whitespaces compress well and indented output is always nicer to look at.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do - I've got no strong views on this. I've added it because my previous script was just running things through html tidy, and the larger my test set got the slower the tidying got!

let sg = Type_of.signature env m in
Module (signature env (id :> Id.Signature.t) sg)
| Pack _ -> failwith "Unhandled content"
| Pack p -> Pack p
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard would it be to actually compile packs ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not even looked into it to be honest - not many packages use packing right now, but the one I have installed was causing my tests to fail!

@jonludlam jonludlam merged commit 0075082 into ocaml:master Jan 27, 2021
@Drup
Copy link
Contributor

Drup commented Jan 27, 2021

As @Julow said, It should probably be enabled by default. The performance cost is probably negligible, as is the size cost after compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants