lib: replace remaining use of lucid with blaze for html rendering (#2737) - #2743
Merged
Merged
Conversation
hledgerorg#2737] - Write.Html is now the renderer - Removed: Write.Html.Lucid, Write.Html.Blaze, Write.Html.HtmlCommon. - balance, register, aregister, print, holdings, the compound reports, and hledger-web's balance page import Write.Html. - lucid dropped from hledger-lib and hledger; blaze-html added to hledger. - CLI html output unchanged: 194 reports compared - Unit tests added for Write.Html. AI usage: Claude Fable 5.1, ~70k output tokens.
Member
|
blaze-html hasn't had a release in 2.5 years, which makes me slightly nervous (unlike lucid). But as you say yesod depends on it, so it'll surely keep working. |
Member
|
Thanks for the cleanup! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2737.
hledger-lib had two renderers for
Write.Spreadsheettables:Write.Html.Lucid(the CLI's-O html) andWrite.Html.Blaze(hledger-web's balance page, since #2739). This settles on one, built on blaze-html, see for discussion #2321.What changed
Hledger.Write.Htmlis now the renderer itself:Write.Html.Lucid's cell rendering translated line for line to blaze, plus theLinesclass andborderClassesfromWrite.Html.HtmlCommon. Those two modules andWrite.Html.Blazeare deleted.balance,register,aregister,print,holdings, and the compound reports (bs/is/cf/bse) importWrite.Html; where they wrote lucid markup directly (aregister's heading row, the compound reports' extra styles) they now write blaze markup. hledger-web's balance page only changes an import.lucidis dropped from hledger-lib and hledger; hledger gainsblaze-html, already a dependency of hledger-lib and hledger-web.Write.Html: cell rendering (amount spans, date class, links, totals, borders, colspan/rowspan, escaping), rows, and the styled table.Output
The CLI's HTML output is byte for byte what it was. I rendered 194 reports with the main build and with this branch and diffed them:
balance(single and multi period,--tree,--transpose,--layout bare/tidy/barewide,--budget,-V,-B,--title,--base-url),bs/is/cf/bse,register,aregister(with and without heading),print, andholdings, overexamples/sample.journal,examples/multicurrency.journal, a large generated journal, and a journal with multiple commodities, prices, lots, and& < > " 'in account names, descriptions, and the base URL. No differences.hledger-web's balance now matches CLI's html output: one
<span class="amount">per amount, and a newline after each row. Pages fetched with both builds are otherwise identical.How to test