quchen / prettyprinter

A modern, extensible and well-documented prettyprinter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusion about how an HTML backend should be implemented

mitchellwrosen opened this issue · comments

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!

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.

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

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