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

refactor Hledger.Write.Html etc #2321

Merged
merged 2 commits into from
Jan 25, 2025
Merged

refactor Hledger.Write.Html etc #2321

merged 2 commits into from
Jan 25, 2025

Conversation

simonmichael
Copy link
Owner

  • dev: rename printHtml -> styledTableHtml
  • dev: refactor Hledger.Write.Html etc, reducing Lucid references

@simonmichael simonmichael changed the title sm web refactor refactor Hledger.Write.Html etc Jan 23, 2025
@simonmichael
Copy link
Owner Author

simonmichael commented Jan 23, 2025

This is FYI @thielema:

So that I could troubleshoot hledger's HTML output or inspect report diffs, I attempted to "quickly" add newlines to it. Instead I did some refactoring and research in that direction. Here's the new doc for Hledger.Write.Html:

HTML writing helpers.
This module would ideally hide the details of which HTML library is used, but it doesn't yet.

Currently hledger-web uses blaze-html, but hledger CLI reports use lucid.
lucid has a more usable API than blaze-html (https://chrisdone.com/posts/lucid).
lucid2's is even better.
Unfortunately lucid* can not render multi-line or indented text.
We want this so that humans can read and troubleshoot our HTML output.
So a transition to blaze-html may be coming.

It seems to me that moving hledger to blaze-html is forced here, even though its API is ugly. At least until/unless chrisdone/lucid#161 happens. Let me know if you agree.

@simonmichael simonmichael added the web The hledger-web tool. label Jan 23, 2025
@simonmichael simonmichael merged commit 29885d1 into master Jan 25, 2025
1 check passed
@simonmichael simonmichael deleted the sm-web-refactor branch January 25, 2025 21:53
@thielema
Copy link
Contributor

I do not see the actual advantages of the Lucid API and I am completely ok with Blaze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web The hledger-web tool.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants