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

Add hyperlinks to accounts and dates in HTML and FODS export #2226

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thielema
Copy link
Contributor

This adds the option --anchor to hledger-cli. If the user passes this option, then in HTML and FODS output the account and date header cells become hyperlinks to hledger-web.
If you like this feature, I add some documentation.
I could also rename the option to --base-url for consistency with hledger-web.
There is a problem though. Some special characters like + or umlauts in account names are not correctly escaped in percent URL syntax by Lucid. I do not know how to solve this correctly with Lucid and whether it is solvable with Lucid, at all.

@thielema
Copy link
Contributor Author

The feature could also be used in hledger-web. That is, in hledger-web there could be hyperlinks to auto-generated multi-balance HTML's, that link back to hledger-web.

@simonmichael
Copy link
Owner

Interesting feature!

--base-url sounds good. I assume its value will be the same as what hledger-web prints at startup ? Eg

...
with base url http://127.0.0.1:5000
...

I don't know the url escaping function offhand but it sounds resolvable. Maybe there's ideas in hledger-web.

The reverse feature (linking to static HTML reports) could be a separate PR. I'd like to have multi-period tabular reports as a normal view in hledger-web, but linking to static html reports saved in temporary files, or better, serving the static html generated in memory, might be easier.

@thielema
Copy link
Contributor Author

thielema commented Sep 12, 2024 via email

@thielema
Copy link
Contributor Author

We could also add the query from the command-line to the hyperlinks. That is, if someone restricts transactions in a certain way for the balance command, the hledger-web register page would respect these restrictions, too.

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.

2 participants