quchen / prettyprinter

A modern, extensible and well-documented prettyprinter.
BSD 2-Clause "Simplified" License
293 stars 34 forks source link

Confusion about how an HTML backend should be implemented #238

Closed mitchellwrosen closed 1 year ago

mitchellwrosen commented 1 year ago

Hi all,

The README claims an HTML backend is trivial to implement:

Screenshot from 2023-04-05 11-07-42

And the main library documentation suggests you might start the conversion from a SimpleDocTree:

Screenshot from 2023-04-05 11-08-30

However, the SimpleDocTree documentation suggests it's not suitable for rendering to HTML:

Screenshot from 2023-04-05 11-09-30

Perhaps the diagram in the second screenshot is a bit out of date? Thanks!

Lev135 commented 1 year ago

However, the SimpleDocTree documentation suggests it's not suitable for rendering to HTML

It seems that you've misread the documentation: here just said that SimpleDocStream is not suitable for rendering HTML and you should use SimpleDocTree.

georgefst commented 1 year ago

For what it's worth, I have actually implemented an HTML backend, though I haven't actually used it extensively or recently.

mitchellwrosen commented 1 year ago

@Lev135 Ah, thanks! Yes, I did misread the docs. It's confusing for the reader to begin the documentation for SimpleDocTree with "A SimpleDocStream ..." :sweat_smile: